class SearchLatencyListener extends AbstractLifecycleComponent implements SearchOperationListener, SearchLatencyProbe {

    public List<LatencyStat> getLatencyStats(Set<Double> percentiles) {
        return statBuckets.entrySet().stream()
                .flatMap(entry -> percentiles.stream().map(percentile -> {
                    TimeValue tv = entry.getValue().getTimeValueAtPercentile(percentile);
                    return new LatencyStat(entry.getKey(), percentile, tv);
                }))
                .collect(toList());
    }

    public  SearchLatencyListener(Settings settings, Supplier<ThreadPool> threadPoolSupplier);

}