mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-25 10:18:59 +02:00
perf(mem): reduced memory usage in metrics and task by string interning and deduplicating fields
This commit is contained in:
@@ -17,8 +17,8 @@ import (
|
||||
|
||||
type (
|
||||
StatusByAlias struct {
|
||||
Map map[string]routes.HealthInfo `json:"statuses"`
|
||||
Timestamp int64 `json:"timestamp"`
|
||||
Map map[string]routes.HealthInfoWithoutDetail `json:"statuses"`
|
||||
Timestamp int64 `json:"timestamp"`
|
||||
} // @name RouteStatusesByAlias
|
||||
Status struct {
|
||||
Status types.HealthStatus `json:"status" swaggertype:"string" enums:"healthy,unhealthy,unknown,napping,starting"`
|
||||
@@ -44,7 +44,7 @@ var Poller = period.NewPoller("uptime", getStatuses, aggregateStatuses)
|
||||
|
||||
func getStatuses(ctx context.Context, _ StatusByAlias) (StatusByAlias, error) {
|
||||
return StatusByAlias{
|
||||
Map: routes.GetHealthInfo(),
|
||||
Map: routes.GetHealthInfoWithoutDetail(),
|
||||
Timestamp: time.Now().Unix(),
|
||||
}, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user