docs: public long getLatency() {
      if (latency >= 0L) {
        return latency;
      } else if (events.size() >= 2) {
        return events.get(events.size() - 1).timestamp() - events.get(0).timestamp();
      } else {
        return -1;
      }
    }