Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trie/realtime: set wspConfigRetriever when realtime index is enabled #395 #396

Merged
merged 2 commits into from
Jan 24, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 11 additions & 5 deletions carbon/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -463,19 +463,25 @@ func (app *App) Start(version string) (err error) {
carbonserver.SetPercentiles(conf.Carbonserver.Percentiles)
// carbonserver.SetQueryTimeout(conf.Carbonserver.QueryTimeout.Value())

var setConfigRetriever bool
if conf.Carbonserver.CacheScan {
carbonserver.SetCacheGetMetricsFunc(core.GetRecentNewMetrics)

retriever := &wspConfigRetriever{
getRetentionFunc: app.Persister.GetRetentionPeriod,
getAggrNameFunc: app.Persister.GetAggrConf,
}
carbonserver.SetConfigRetriever(retriever)
setConfigRetriever = true
}

if conf.Carbonserver.RealtimeIndex > 0 {
ch := carbonserver.SetRealtimeIndex(conf.Carbonserver.RealtimeIndex)
core.SetNewMetricsChan(ch)

setConfigRetriever = true
}
if setConfigRetriever {
retriever := &wspConfigRetriever{
getRetentionFunc: app.Persister.GetRetentionPeriod,
getAggrNameFunc: app.Persister.GetAggrConf,
}
carbonserver.SetConfigRetriever(retriever)
}

if conf.Prometheus.Enabled {
Expand Down