Skip to content

Commit

Permalink
Revert "config: set proper default value for aggregator_buffer_size
Browse files Browse the repository at this point in the history
… and `dogstatsd_string_interner_size` (#4893)"

This reverts commit d454524.
  • Loading branch information
xornivore committed Mar 6, 2020
1 parent 6a85b78 commit 74a2caa
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions pkg/aggregator/aggregator.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,11 @@ type BufferedAggregator struct {

// NewBufferedAggregator instantiates a BufferedAggregator
func NewBufferedAggregator(s serializer.MetricSerializer, metricPool *metrics.MetricSamplePool, hostname, agentName string, flushInterval time.Duration) *BufferedAggregator {

bufferSize := config.Datadog.GetInt("aggregator_buffer_size")
if bufferSize == 0 {
bufferSize = 100
}

aggregator := &BufferedAggregator{
metricPool: metricPool,
Expand Down
2 changes: 0 additions & 2 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,6 @@ func initConfig(config Config) {
config.BindEnvAndSetDefault("histogram_aggregates", []string{"max", "median", "avg", "count"})
config.BindEnvAndSetDefault("histogram_percentiles", []string{"0.95"})
config.BindEnvAndSetDefault("aggregator_stop_timeout", 2)
config.BindEnvAndSetDefault("aggregator_buffer_size", 100)
// Serializer
config.BindEnvAndSetDefault("enable_stream_payload_serialization", true)
config.BindEnvAndSetDefault("enable_service_checks_stream_payload_serialization", true)
Expand Down Expand Up @@ -295,7 +294,6 @@ func initConfig(config Config) {
config.BindEnvAndSetDefault("dogstatsd_metrics_stats_enable", false)
config.BindEnvAndSetDefault("dogstatsd_tags", []string{})
config.BindEnvAndSetDefault("dogstatsd_mapper_cache_size", 1000)
config.BindEnvAndSetDefault("dogstatsd_string_interner_size", 4096)
// Enable check for Entity-ID presence when enriching Dogstatsd metrics with tags
config.BindEnvAndSetDefault("dogstatsd_entity_id_precedence", false)
config.SetKnown("dogstatsd_mapper_profiles")
Expand Down
3 changes: 3 additions & 0 deletions pkg/dogstatsd/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ type parser struct {

func newParser() *parser {
stringInternerCacheSize := config.Datadog.GetInt("dogstatsd_string_interner_size")
if stringInternerCacheSize == 0 {
stringInternerCacheSize = 4096
}

return &parser{
interner: newStringInterner(stringInternerCacheSize),
Expand Down

0 comments on commit 74a2caa

Please sign in to comment.