aboutsummaryrefslogtreecommitdiffstats
path: root/vnfs/DAaaS/sample-apps/m3db_promql/sample_promql_query.py
blob: 270c508709fe331882305dc2302b28fe424b7478 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from promql_api.prom_ql_api import query
import pprint

LABELS = ['irate(collectd_cpufreq{exported_instance="otconap7",cpufreq="1"}[2m])']

#Other examples
#LABELS = [ 'irate(http_requests_total{code="200"}[1m])', 'collectd_cpu_percent{job="collectd", exported_instance="an11-31"}[1m]' ]
#LABELS = ['irate(collectd_cpufreq{exported_instance="otconap7",cpufreq="1"}[2m])', 'go_info']

def main():
    list_of_result_sets = query(LABELS)
    for each_result in list_of_result_sets:
        pprint.pprint(each_result)

if __name__ == "__main__":
     main()