@Override
    public void record(MetricConfig config, double value, long currentTimestampMs) {
        if (intervalStartTimestampMs < 0) {
            // Discard the initial value since the value occurred prior to the interval start
            intervalStartTimestampMs = currentTimestampMs;
        } else {
            totalRecordedDurationMs += value;
            lastRecordedTimestampMs = currentTimestampMs;
        }
    }
Maintains an approximate ratio of the duration of a specific event
over all time. For example, this can be used to compute the ratio of
time that a thread is busy or idle. The value is approximate since the
measurement and recording intervals may not be aligned.

Note that the duration of the event is assumed to be small relative to
the interval of measurement.
raft/src/main/java/org/apache/kafka/raft/internals/TimeRatio.java