Skip to content

Commit

Permalink
Also add metrics for the saved visualizations for the past 7 days
Browse files Browse the repository at this point in the history
  • Loading branch information
stratoula committed Jun 4, 2020
1 parent 3df908c commit dfc0915
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ describe('visualizationsTaskRunner', () => {
spaces_max: 1,
spaces_min: 1,
total: 1,
saved_7_days_total: 1,
saved_30_days_total: 1,
saved_90_days_total: 1,
},
Expand Down Expand Up @@ -157,6 +158,7 @@ describe('visualizationsTaskRunner', () => {
spaces_min: 1,
spaces_max: 1,
spaces_avg: 1,
saved_7_days_total: 1,
saved_30_days_total: 2,
saved_90_days_total: 3,
},
Expand All @@ -165,6 +167,7 @@ describe('visualizationsTaskRunner', () => {
spaces_min: 1,
spaces_max: 1,
spaces_avg: 1,
saved_7_days_total: 0,
saved_30_days_total: 1,
saved_90_days_total: 1,
},
Expand All @@ -173,6 +176,7 @@ describe('visualizationsTaskRunner', () => {
spaces_min: 2,
spaces_max: 2,
spaces_avg: 2,
saved_7_days_total: 1,
saved_30_days_total: 1,
saved_90_days_total: 1,
},
Expand All @@ -181,6 +185,7 @@ describe('visualizationsTaskRunner', () => {
spaces_min: 2,
spaces_max: 2,
spaces_avg: 2,
saved_7_days_total: 2,
saved_30_days_total: 2,
saved_90_days_total: 3,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ async function getStats(callCluster: APICaller, index: string) {
spaces_min: _.min(spaceCounts),
spaces_max: _.max(spaceCounts),
spaces_avg: total / spaceCounts.length,
saved_7_days_total: curr.filter((c) => c.past_days <= 7).length,
saved_30_days_total: curr.filter((c) => c.past_days <= 30).length,
saved_90_days_total: curr.filter((c) => c.past_days <= 90).length,
};
Expand Down

0 comments on commit dfc0915

Please sign in to comment.