improved metrics implementation

This commit is contained in:
yusing
2025-02-13 05:58:30 +08:00
parent fd50f8fcab
commit 3c7fafa91f
11 changed files with 262 additions and 83 deletions

View File

@@ -13,6 +13,7 @@ const (
NumStatuses int = iota - 1
HealthyMask = StatusHealthy | StatusNapping | StatusStarting
IdlingMask = StatusNapping | StatusStarting
)
func (s Status) String() string {
@@ -43,3 +44,7 @@ func (s Status) Good() bool {
func (s Status) Bad() bool {
return s&HealthyMask == 0
}
func (s Status) Idling() bool {
return s&IdlingMask != 0
}