code: private int calculateFrequency(long seasonLength) {
          long startTime = timestamps[0];
          //Prevents frequency from being 0
          if (timestamps[1] - timestamps[0] > seasonLength) {
              throw new RuntimeException("Provided length of season is too small. No data points exist " +
                      "within the first season of the metric.");
          }
  
          int numDatapointsInSeason = 0;
          for (long timestamp : timestamps) {
              if ((timestamp - startTime) < seasonLength) {
                  numDatapointsInSeason++;
              } else {
                  break;
              }
          }
  
          return numDatapointsInSeason;
      }
docs: /*
  Calculates the frequency of the metric (the number of data
  points in one season of the metric)