mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-21 16:01:22 +02:00
api: add /v1/health/ws for health bubbles on dashboard
This commit is contained in:
@@ -142,6 +142,14 @@ func (mon *monitor) Uptime() time.Duration {
|
||||
return time.Since(mon.startTime)
|
||||
}
|
||||
|
||||
// Latency implements HealthMonitor.
|
||||
func (mon *monitor) Latency() time.Duration {
|
||||
if mon.lastResult == nil {
|
||||
return 0
|
||||
}
|
||||
return mon.lastResult.Latency
|
||||
}
|
||||
|
||||
// Name implements HealthMonitor.
|
||||
func (mon *monitor) Name() string {
|
||||
parts := strutils.SplitRune(mon.service, '/')
|
||||
|
||||
Reference in New Issue
Block a user