Rolling 1 week stats

This commit is contained in:
idanoo 2023-02-13 18:39:44 +13:00
parent 17b1f261a0
commit 88ee8ac2a7
Signed by: idanoo
GPG key ID: 387387CDBC02F132
2 changed files with 22 additions and 4 deletions

View file

@ -86,6 +86,22 @@ func getUserCounts() ([]metric, error) {
log.Printf("%s user count: %d", MASTODON_IDENTIFIER, userCount)
metrics = append(metrics, m)
}
// Extra metrics for DB only
userCount1W, err := runIntQuery(MASTODON_DB_SCHEMA, MASTODON_1W_ACTIVE_USER_QUERY)
if err != nil {
log.Println(err)
} else {
customMetrics := []metric{
{
Service: MATRIX_IDENTIFIDER,
MetricName: METRICNAME_1W_USERCOUNT,
MetricValue: userCount1W,
},
}
_ = persistMetrics(customMetrics)
}
}
if MOBILIZON_DB_SCHEMA != "" {