Skip to content

Commit

Permalink
feat: mongo health
Browse files Browse the repository at this point in the history
  • Loading branch information
adityathebe authored and moshloop committed Aug 4, 2024
1 parent a5d6b98 commit c4d27a6
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions pkg/health/health_mongo.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package health

func GetMongoHealth(obj map[string]any) (health HealthStatus) {
hr := HealthStatus{
Status: HealthStatusUnknown,
Health: HealthUnknown,
Ready: false,
}

if v, ok := obj["clusterType"]; ok && v.(string) == "REPLICASET" {
if v, ok := obj["stateName"]; ok {
hr.Status = HealthStatusCode(v.(string))
hr.Ready = true
}
}

return hr
}

0 comments on commit c4d27a6

Please sign in to comment.