this repo has no description

bsky-modactions: add 15m moving average smoothing

Changed files
+7 -6
cmd
bsky-modactions
+7 -6
cmd/bsky-modactions/munin.go
···
return
}
-
fmt.Fprint(w, "graph_title bluesky labels added (top 8)\n")
+
fmt.Fprint(w, "graph_title bluesky labels added (top 8, 15m MA)\n")
fmt.Fprint(w, "graph_category bluesky\n")
fmt.Fprint(w, "graph_vlabel labels / ${graph_period}\n")
fmt.Fprint(w, "graph_period minute\n")
fmt.Fprint(w, "graph_width 600\n")
fmt.Fprint(w, "graph_height 300\n")
-
for _, label := range labels {
-
slug := sanitize.ReplaceAll([]byte(label), []byte("_"))
-
fmt.Fprintf(w, "%s.label %s\n", slug, label)
+
for _, labelName := range labels {
+
slug := sanitize.ReplaceAll([]byte(labelName), []byte("_"))
+
fmt.Fprintf(w, "%s.label %s\n", slug, labelName)
fmt.Fprintf(w, "%s.type DERIVE\n", slug)
+
fmt.Fprintf(w, "%s.cdef %s,900,TRENDNAN\n", slug, slug)
}
}
···
}
for _, label := range labels {
-
key := label.Member.(string)
-
slug := sanitize.ReplaceAll([]byte(key), []byte("_"))
+
labelName := label.Member.(string)
+
slug := sanitize.ReplaceAll([]byte(labelName), []byte("_"))
fmt.Fprintf(w, "%s.value %0.f\n", slug, label.Score)
}
}