Skip to content

Commit

Permalink
default metrics to visitors
Browse files Browse the repository at this point in the history
  • Loading branch information
gernest committed Feb 15, 2024
1 parent c69ab56 commit baf6332
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions stats/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ func parseDate(ctx context.Context, query url.Values, now func() time.Time) time

func ParseMetrics(ctx context.Context, query url.Values) (o []v1.Metric) {
metrics := query.Get("metrics")
if metrics == "" {
return []v1.Metric{v1.Metric_visitors}
}
for _, m := range strings.Split(metrics, ",") {
v, ok := v1.Metric_value[m]
if !ok {
Expand Down

0 comments on commit baf6332

Please sign in to comment.