aboutsummaryrefslogtreecommitdiffstats
path: root/vnfs/DAaaS/sample-apps/m3db_promql/promql_api/README.md
diff options
context:
space:
mode:
authorDileep Ranganathan <dileep.ranganathan@intel.com>2019-05-30 12:38:37 -0700
committerDileep Ranganathan <dileep.ranganathan@intel.com>2019-05-30 21:11:52 +0000
commit3d5a3e06530c1250d48f7d838c619f3bfbcd019d (patch)
tree349e370c43ce7318b3f7eb7736345de6872cbef2 /vnfs/DAaaS/sample-apps/m3db_promql/promql_api/README.md
parent31802660dfe74a8671ae29789f0018f0f887ea1a (diff)
Refactor Distributed Analytics project structure
Modified the project structure to improve maintainability and to add future CI and integration test support. Change-Id: Id30bfb1f83f23785a6b5f99e81f42f752d59c0f8 Issue-ID: ONAPARC-280 Signed-off-by: Dileep Ranganathan <dileep.ranganathan@intel.com>
Diffstat (limited to 'vnfs/DAaaS/sample-apps/m3db_promql/promql_api/README.md')
-rw-r--r--vnfs/DAaaS/sample-apps/m3db_promql/promql_api/README.md50
1 files changed, 50 insertions, 0 deletions
diff --git a/vnfs/DAaaS/sample-apps/m3db_promql/promql_api/README.md b/vnfs/DAaaS/sample-apps/m3db_promql/promql_api/README.md
new file mode 100644
index 00000000..4493af22
--- /dev/null
+++ b/vnfs/DAaaS/sample-apps/m3db_promql/promql_api/README.md
@@ -0,0 +1,50 @@
+## 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.