How to make a percentile calculation using MQL
Stay organized with collections
Save and categorize content based on your preferences.
Problem
How can you make a percentile calculation using MQL over a data type that is not a distribution type?
Environment
Solution
- Use MQL to create a distribution value prior to invoking the percentile_from function.
fetch gce_instance
| metric 'compute.googleapis.com/instance/cpu/usage_time'
| align rate(1m)
| every 1m
| distribution(fixed_width(0.2).num_buckets(5) )
| percentile_from (90)
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-12-12 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-12-12 UTC."],[],[]]