Methods to detect anomalies in dataset

I’m developing a Chrome Extension and want to detect cpu and gpu usage anomalies. I have two arrays: cpu and gpu usage of last 60 seconds of my computer.

I want to detect the anomalies in cpu and gpu usage, to find out:

  • Is cpu and gpu usage normal?
  • to compare those arrays with each other, if they are directly proportional or not

Could you please suggest me some methods to do such detections?

Javascript – Detecting Opinionated Text

I’m trying write a script that detects, and highlights, opinionated strings in web pages. I can highlight the text just fine, but I’m having trouble detecting the opinionated text. As an alpha version, maybe simply putting in a list of strings (ei: I think, This is, etc) and if it detects those strings, highlighting the entire sentence they’re in. I’m not sure how complicated the code will have to be to make this, but currently I’m not sure how to even test this current function because I don’t know how to execute it, to make it running every time you open a new web page. Would I put it in background.js? This code is currently in a file named algorithm.js. Thanks!

 var result;
 var scanned;
 function opinion(); {
     if (
    document.documentElement.textContent || document.documentElement.innerText
  ).indexOf('I think', 'This is', 'He is', 'She is') > -1
) {
  var result = 1;
  console.log('Detected Opinion');