Percentile with group aggregation

Hi Vipin,

Thank you for posting this here. I agree with @Justin that you would benefit from the article he is pointing you at. As to the percentile calculations for mbps and iops…perhaps a more experienced person knows the math tricks needed with that.

I did copy your sample data and put it in a collection on my own MongoDB instance, but then I had to look up resources on how to do percentile calculations and I need to study these. Also, my skill with aggregation queries is rusty. I believe I must create separate aggregation queries: one for mbps and one for iops. The reason for separate aggregation queries is because you have to sort the documents in a sort stage prior to an actual calculation for percentile. So there will be one aggregation query for iops which sorts the values in a sort stage. A totally separate aggregation is needed to sort the values for mbps in its own sort stage.

I could have spent time experimenting with this, but I had some other things to do. I will try to experiment over this week and do my best, but others with more skill and experience than I could offer really good suggestions to you. I don’t know what you will do with the time series data e.g. the time stamp. It will help you to read that article that @Justin pointed you to.

Thanks so much

Bob

1 Like