fix: uptime metrics

This commit is contained in:
yusing
2025-04-25 11:26:24 +08:00
parent af8d2c74f6
commit 3947152336
3 changed files with 47 additions and 0 deletions

View File

@@ -16,6 +16,23 @@ const (
IdlingMask = StatusNapping | StatusStarting
)
func NewStatus(s string) Status {
switch s {
case "healthy":
return StatusHealthy
case "unhealthy":
return StatusUnhealthy
case "napping":
return StatusNapping
case "starting":
return StatusStarting
case "error":
return StatusError
default:
return StatusUnknown
}
}
func (s Status) String() string {
switch s {
case StatusHealthy: