From 20853427cde07abc1ec26c77147ac0c46ed8b4af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Pilliet?= Date: Mon, 25 Jan 2021 14:31:45 +0100 Subject: [PATCH] feat: add 'itunes' ratings histogram --- src/config/metrics.json | 12 ++++++------ src/lib/prometheus.js | 1 + 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/config/metrics.json b/src/config/metrics.json index 2230100a..3f167ce3 100644 --- a/src/config/metrics.json +++ b/src/config/metrics.json @@ -12,32 +12,32 @@ "ratings": { "name": "appstores_ratings_total", "help": "App ratings since the launch of the app", - "compatibility": ["gplay"] + "compatibility": ["itunes", "gplay"] }, "ratings1": { "name": "appstores_ratings_1_total", "help": "App ratings with 1 star since the launch of the app", - "compatibility": ["gplay"] + "compatibility": ["itunes", "gplay"] }, "ratings2": { "name": "appstores_ratings_2_total", "help": "App ratings with 2 stars since the launch of the app", - "compatibility": ["gplay"] + "compatibility": ["itunes", "gplay"] }, "ratings3": { "name": "appstores_ratings_3_total", "help": "App ratings with 3 stars since the launch of the app", - "compatibility": ["gplay"] + "compatibility": ["itunes", "gplay"] }, "ratings4": { "name": "appstores_ratings_4_total", "help": "App ratings with 4 stars since the launch of the app", - "compatibility": ["gplay"] + "compatibility": ["itunes", "gplay"] }, "ratings5": { "name": "appstores_ratings_5_total", "help": "App ratings with 5 stars since the launch of the app", - "compatibility": ["gplay"] + "compatibility": ["itunes", "gplay"] }, "currentVersionScore": { "name": "appstores_current_version_score_total", diff --git a/src/lib/prometheus.js b/src/lib/prometheus.js index 0d97c81f..a308761e 100644 --- a/src/lib/prometheus.js +++ b/src/lib/prometheus.js @@ -119,6 +119,7 @@ function getAppData(store, opt) { itunes.app({ appId: opt.appId, country: opt.country, // TODO: Support more countries + ratings: true, }) .then((data) => { setMetrics(store, opt.country, data) // TODO: Support more countries