Esempio n. 1
0
func NewVarz(r *registry.CFRegistry) Varz {
	x := &RealVarz{r: r}

	x.activeApps = stats.NewActiveApps()
	x.topApps = stats.NewTopApps()

	x.All = NewHttpMetric()
	x.Tags.Component = make(map[string]*HttpMetric)

	return x
}
Esempio n. 2
0
func NewRegistry(c *config.Config, mbus yagnats.NATSClient) *Registry {
	r := &Registry{}

	r.Logger = steno.NewLogger("router.registry")

	r.ActiveApps = stats.NewActiveApps()
	r.TopApps = stats.NewTopApps()

	r.byUri = make(map[route.Uri]*route.Pool)

	r.table = make(map[tableKey]*tableEntry)

	r.pruneStaleDropletsInterval = c.PruneStaleDropletsInterval
	r.dropletStaleThreshold = c.DropletStaleThreshold

	r.messageBus = mbus

	return r
}
Esempio n. 3
0
func NewRegistry(c *Config, messageBusClient mbus.CFMessageBus) *Registry {
	r := &Registry{
		messageBus: messageBusClient,
	}

	r.Logger = steno.NewLogger("router.registry")

	r.ActiveApps = stats.NewActiveApps()
	r.TopApps = stats.NewTopApps()

	r.byUri = make(map[Uri][]*Backend)
	r.byBackendId = make(map[BackendId]*Backend)

	r.staleTracker = util.NewListMap()

	r.pruneStaleDropletsInterval = c.PruneStaleDropletsInterval
	r.dropletStaleThreshold = c.DropletStaleThreshold

	return r
}
Esempio n. 4
0
func (_ nullVarz) ActiveApps() *stats.ActiveApps                                                    { return stats.NewActiveApps() }