code: public double kPercentileLatencyAsDouble(double percentile) {
          if (m_latencyHistogram.getTotalCount() == 0) return 0.0;
          percentile = Math.max(0.0D, percentile);
          //Convert from micros to millis for return value, enjoy having precision
          return m_latencyHistogram.getValueAtPercentile(percentile * 100.0D) / 1000.0;
      }
docs: <p>Using the latency bucketing statistics gathered by the client, estimate
  the k-percentile latency value for the time period covered by this stats
  instance.</p>
  
  <p>For example, k=.5 returns an estimate of the median. k=0 returns the
  minimum. k=1.0 returns the maximum.</p>
  
  <p>Latencies longer than the highest trackable value (10 seconds) will be
  reported as multiple entries at the highest trackable value</p>
  
  @param percentile A floating point number between 0.0 and 1.0.
  @return An estimate of k-percentile latency in whole milliseconds.