code: public long avgRate() {
          long sum = 0L;
          for (Sample s : samples) {
              sum += s.rate();
          }
          return sum / (long) samples.size();
      }
docs: Returns the average of the message rates in the SampleGroup.
  
  @return the average of the message rates in the SampleGroup