fix: quality change direction is boolean
This commit is contained in:
parent
7e4221c49d
commit
4aa016325f
1 changed files with 2 additions and 2 deletions
4
main.go
4
main.go
|
@ -13,7 +13,7 @@ import (
|
|||
type telemetry struct {
|
||||
slug string `json:"slug"`
|
||||
eventType string `json:"type"`
|
||||
qualityChangeUp string `json:"isUp"`
|
||||
qualityChangeUp bool `json:"isUp"`
|
||||
}
|
||||
|
||||
type metrics struct {
|
||||
|
@ -72,7 +72,7 @@ func telemetryHandler(m metrics) echo.HandlerFunc {
|
|||
case type_recovery:
|
||||
m.recovery.WithLabelValues(v.slug).Inc()
|
||||
case type_quality_switch:
|
||||
if v.qualityChangeUp == "up" {
|
||||
if v.qualityChangeUp {
|
||||
m.qualityUp.WithLabelValues(v.slug).Inc()
|
||||
} else {
|
||||
m.qualityDown.WithLabelValues(v.slug).Inc()
|
||||
|
|
Loading…
Reference in a new issue