A scripted percentiles agg might work for you. You can access the time_difference and flag field in the script and emit whatever values you need.
Can you describe the output a bit more, maybe give an example? The "Success Rate Percentile" equation doesn't look like a percentile, more like an average?
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.