Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Commit

Permalink
Add a column to /metrics that shows the number of shots that are set …
Browse files Browse the repository at this point in the history
…to never expire (#5271)
  • Loading branch information
ianb authored and jaredhirsch committed Jan 3, 2019
1 parent c6c7490 commit e2ace50
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions server/src/pages/metrics/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ const queries = {
SELECT
(SELECT COUNT(devices.id) FROM devices) AS total_devices,
(SELECT COUNT(data.id) FROM data WHERE NOT deleted AND expire_time < CURRENT_TIMESTAMP) AS active_shots,
(SELECT COUNT(data.id) FROM data WHERE NOT deleted AND expire_time IS NULL) AS forever_shots,
(SELECT COUNT(data.id) FROM data WHERE NOT deleted AND expire_time >= CURRENT_TIMESTAMP) AS expired_recoverable_shots,
(SELECT COUNT(data.id) FROM data WHERE deleted) AS expired_deleted_shots;
`,
columns: [
{title: "Total devices registered", name: "total_devices"},
{title: "Active shots", name: "active_shots"},
{title: "Never expiring shots", name: "forever_shots"},
{title: "Expired (recoverable)", name: "expired_recoverable_shots"},
{title: "... (deleted)", name: "expired_deleted_shots"},
],
Expand Down

0 comments on commit e2ace50

Please # to comment.