metrics lint; cache infrastructure (#74, #76)

This commit is contained in:
Michael Quigley
2022-10-19 11:25:08 -04:00
parent 095024c179
commit 83c12e30cb
2 changed files with 31 additions and 22 deletions

View File

@ -36,15 +36,22 @@ type metricsAgent struct {
cfg *MetricsConfig
influx influxdb2.Client
writeApi api.WriteAPIBlocking
envCache map[string]*envCacheEntry
zCtx ziti.Context
zListener edge.Listener
shutdown chan struct{}
joined chan struct{}
}
type envCacheEntry struct {
env string
lastAccess time.Time
}
func newMetricsAgent(cfg *MetricsConfig) *metricsAgent {
ma := &metricsAgent{
cfg: cfg,
envCache: make(map[string]*envCacheEntry),
shutdown: make(chan struct{}),
joined: make(chan struct{}),
}