mirror of
https://github.com/idanoo/go-mastodon-stats
synced 2025-07-16 21:21:53 +00:00
Add calckey
This commit is contained in:
parent
c252860d87
commit
6fdda6c360
3 changed files with 23 additions and 0 deletions
|
@ -155,6 +155,23 @@ func getUserCounts() ([]metric, error) {
|
|||
}
|
||||
}
|
||||
|
||||
if CALCKEY_DB_SCHEMA != "" {
|
||||
userCount, err := runIntQuery(CALCKEY_DB_SCHEMA, CALCKEY_USER_QUERY)
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
} else {
|
||||
m := metric{
|
||||
Service: CALCKEY_IDENTIFIER,
|
||||
MetricName: METRICNAME_USERCOUNT,
|
||||
MetricValue: userCount,
|
||||
PreviousDayMetricValue: getLastMetric(CALCKEY_IDENTIFIER),
|
||||
PreviousWeekMetricValue: getLastWeekMetric(CALCKEY_IDENTIFIER),
|
||||
}
|
||||
log.Printf("%s user count: %d", CALCKEY_IDENTIFIER, userCount)
|
||||
metrics = append(metrics, m)
|
||||
}
|
||||
}
|
||||
|
||||
return metrics, nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue