Move expvar under the registry section
For consistency with other systems, the redis and caching monitoring data has been moved under the "registry" section in expvar. This ensures the entire registry state is kept to a single section. Signed-off-by: Stephen J Day <stephen.day@docker.com>
This commit is contained in:
parent
4e1ecad6cc
commit
6b748a74ef
2 changed files with 27 additions and 3 deletions
|
@ -272,13 +272,18 @@ func (app *App) configureRedis(configuration *configuration.Configuration) {
|
|||
|
||||
app.redis = pool
|
||||
|
||||
expvar.Publish("redis", expvar.Func(func() interface{} {
|
||||
// setup expvar
|
||||
registry := expvar.Get("registry")
|
||||
if registry == nil {
|
||||
registry = expvar.NewMap("registry")
|
||||
}
|
||||
|
||||
registry.(*expvar.Map).Set("redis", expvar.Func(func() interface{} {
|
||||
return map[string]interface{}{
|
||||
"Config": configuration.Redis,
|
||||
"Active": app.redis.ActiveCount(),
|
||||
}
|
||||
}))
|
||||
|
||||
}
|
||||
|
||||
func (app *App) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue