From abbee1b46d58da6f3b297724f11f873a2567c3a8 Mon Sep 17 00:00:00 2001 From: Rajamohan Raj Date: Thu, 30 May 2019 23:33:35 +0000 Subject: Refactor promql_api after project structure change Refactored prompql_api after project structure change. Fix review comments and make a better read me. Change-Id: I40b7b2da40d85e9f297d4bb87d8633c71bdd1ec0 Issue-ID: ONAPARC-452 Signed-off-by: Rajamohan Raj --- .../sample-apps/m3db_promql/promql_api/README.md | 50 ---------------------- 1 file changed, 50 deletions(-) delete mode 100644 vnfs/DAaaS/sample-apps/m3db_promql/promql_api/README.md (limited to 'vnfs/DAaaS/sample-apps/m3db_promql/promql_api/README.md') diff --git a/vnfs/DAaaS/sample-apps/m3db_promql/promql_api/README.md b/vnfs/DAaaS/sample-apps/m3db_promql/promql_api/README.md deleted file mode 100644 index 4493af22..00000000 --- a/vnfs/DAaaS/sample-apps/m3db_promql/promql_api/README.md +++ /dev/null @@ -1,50 +0,0 @@ -## What does this API do ? -This api as of now provides a function which takes in a lits of 'LABELS' of prometheus -and returns the corresponding result_sets in a list. - -For eg: -If the labels is - -``` -LABELS = ['irate(collectd_cpufreq{exported_instance="otconap7",cpufreq="1"}[2m])'] -``` - -The return is: - -``` -[{'metric': {'cpufreq': '1', - 'endpoint': 'collectd-prometheus', - 'exported_instance': 'otconap7', - 'instance': '172.25.103.1:9103', - 'job': 'collectd', - 'namespace': 'edge1', - 'pod': 'plundering-liger-collectd-wz7xg', - 'service': 'collectd'}, - 'value': [1559177169.415, '119727200']}] -``` - -## How to use this API ? - -``` -1. Copy the directory 'promql_api' to your working directory. -``` - -``` -2. Import the API function: query_m3db -from promql_api.prom_ql_api import query_m3db -``` - -``` -3. have a global or local variable as 'LABELS' -LABELS = ['irate(collectd_cpufreq{exported_instance="otconap7",cpufreq="1"}[2m])'] -``` - -``` -4. Store the result set in a list: -list_of_result_sets = query_m3db(LABELS) -``` - -## How to troubleshoot ? - -* Check the sample file - sample_promql_query.py in the repo. -* Make sure the file __init__.py is present in promql_api directory after you copy the directory. -- cgit 1.2.3-korg