@Override
  public double getValue(double quantile) {
    int prevIndex = 0;
    for (int i = 0; i < this.histogramSnapshot.percentileValues().length; i++) {
      if (this.histogramSnapshot.percentileValues()[i].percentile() <= quantile) {
        prevIndex = i;
      }
      if (this.histogramSnapshot.percentileValues()[i].percentile() >= quantile) {
        // Find the value of the first matching or most suitable insertion position
        break;
      }
    }

    return this.histogramSnapshot.percentileValues()[prevIndex].value(baseTimeUnit);
  }
This implementation is just for a timer as it needs the TimeUnit to convert from nanoseconds.
iotdb-core/metrics/core/src/main/java/org/apache/iotdb/metrics/core/type/IoTDBTimerHistogramSnapshot.java