Skip to content

Commit 81569da

Browse files
authored
Improve usage metrics system (#1670)
Instead of maintaining the official xlsform+xml and the data template separately, this PR includes the xml of the live analytics form (produced via pyxform `xls2xform` with ` --pretty-print` flag) and compares it with the data template.
1 parent dc6d4a1 commit 81569da

File tree

3 files changed

+1136
-9
lines changed

3 files changed

+1136
-9
lines changed

lib/data/analytics.js

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,17 @@ const metricsTemplate = {
1818
"recent": 0,
1919
"total": 0
2020
},
21-
"num_questions_biggest_form": {},
21+
"num_questions_biggest_form": 0,
2222
"max_geo_per_form": 0,
2323
"num_audit_log_entries": {
2424
"recent": 0,
2525
"total": 0
2626
},
27-
"num_archived_projects": {},
28-
"num_unique_managers": {},
29-
"num_unique_viewers": {},
30-
"num_unique_collectors": {},
31-
"database_size": {},
27+
"num_archived_projects": 0,
28+
"num_unique_managers": 0,
29+
"num_unique_viewers": 0,
30+
"num_unique_collectors": 0,
31+
"database_size": 0,
3232
"uses_external_db": 0,
3333
"uses_external_blob_store": 0,
3434
"sso_enabled": 0,
@@ -58,7 +58,7 @@ const metricsTemplate = {
5858
},
5959
"projects": [
6060
{
61-
"id": {},
61+
"id": 0,
6262
"users": {
6363
"num_managers": {
6464
"recent": 0,
@@ -172,12 +172,24 @@ const metricsTemplate = {
172172
"description_length": 0
173173
},
174174
"datasets": [{
175-
"id": {},
175+
"id": 0,
176176
"num_properties": 0,
177177
"num_entities": {
178178
"recent": 0,
179179
"total": 0
180180
},
181+
"num_entity_creates_sub": {
182+
"recent": 0,
183+
"total": 0
184+
},
185+
"num_entity_creates_api": {
186+
"recent": 0,
187+
"total": 0
188+
},
189+
"num_entity_creates_bulk": {
190+
"recent": 0,
191+
"total": 0
192+
},
181193
"num_creation_forms": 0,
182194
"num_followup_forms": 0,
183195
"num_failed_entities": {
@@ -217,7 +229,6 @@ const metricsTemplate = {
217229
};
218230
/* eslint-enable quotes, quote-props */
219231

220-
221232
module.exports = {
222233
metricsTemplate
223234
};

0 commit comments

Comments
 (0)