Skip to content

Commit

Permalink
feat(wavefront output): rename HTTPBatchSize to HTTPMaximumBatchSize
Browse files Browse the repository at this point in the history
  • Loading branch information
LukeWinikates committed Jun 29, 2022
1 parent 96207a0 commit 39ddfc1
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 29 deletions.
4 changes: 2 additions & 2 deletions plugins/outputs/wavefront/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ Wavefront data format over TCP.
## Authentication Token for Wavefront. Only required if using Direct Ingestion
#token = "DUMMY_TOKEN"

## Number of metrics to send per batch for Direct Ingestion. Ignored unless 'url' is set. Default is 10,000. Values higher than 40,000 are not recommended.
# http_batch_size = 10000
## Maximum number of metrics to send per batch for Direct Ingestion. Ignored unless 'url' is set. This value should be higher than the `metric_batch_size`. Default is 10,000. Values higher than 40,000 are not recommended.
# http_maximum_batch_size = 10000

## DNS name of the wavefront proxy server. Do not use if url is specified
#host = "wavefront.example.com"
Expand Down
4 changes: 2 additions & 2 deletions plugins/outputs/wavefront/sample.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
## Authentication Token for Wavefront. Only required if using Direct Ingestion
#token = "DUMMY_TOKEN"

## Number of metrics to send per batch for Direct Ingestion. Ignored unless 'url' is set. Default is 10,000. Values higher than 40,000 are not recommended.
# http_batch_size = 10000
## Maximum number of metrics to send per batch for Direct Ingestion. Ignored unless 'url' is set. This value should be higher than the `metric_batch_size`. Default is 10,000. Values higher than 40,000 are not recommended.
# http_maximum_batch_size = 10000

## DNS name of the wavefront proxy server. Do not use if url is specified
#host = "wavefront.example.com"
Expand Down
48 changes: 24 additions & 24 deletions plugins/outputs/wavefront/wavefront.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,22 @@ var sampleConfig string
const maxTagLength = 254

type Wavefront struct {
URL string `toml:"url"`
Token string `toml:"token"`
Host string `toml:"host"`
Port int `toml:"port"`
Prefix string `toml:"prefix"`
SimpleFields bool `toml:"simple_fields"`
MetricSeparator string `toml:"metric_separator"`
ConvertPaths bool `toml:"convert_paths"`
ConvertBool bool `toml:"convert_bool"`
HTTPBatchSize int `toml:"http_batch_size"`
UseRegex bool `toml:"use_regex"`
UseStrict bool `toml:"use_strict"`
TruncateTags bool `toml:"truncate_tags"`
ImmediateFlush bool `toml:"immediate_flush"`
SourceOverride []string `toml:"source_override"`
StringToNumber map[string][]map[string]float64 `toml:"string_to_number" deprecated:"1.9.0;use the enum processor instead"`
URL string `toml:"url"`
Token string `toml:"token"`
Host string `toml:"host"`
Port int `toml:"port"`
Prefix string `toml:"prefix"`
SimpleFields bool `toml:"simple_fields"`
MetricSeparator string `toml:"metric_separator"`
ConvertPaths bool `toml:"convert_paths"`
ConvertBool bool `toml:"convert_bool"`
HTTPMaximumBatchSize int `toml:"http_maximum_batch_size"`
UseRegex bool `toml:"use_regex"`
UseStrict bool `toml:"use_strict"`
TruncateTags bool `toml:"truncate_tags"`
ImmediateFlush bool `toml:"immediate_flush"`
SourceOverride []string `toml:"source_override"`
StringToNumber map[string][]map[string]float64 `toml:"string_to_number" deprecated:"1.9.0;use the enum processor instead"`

sender wavefront.Sender
Log telegraf.Logger `toml:"-"`
Expand Down Expand Up @@ -88,7 +88,7 @@ func (w *Wavefront) Connect() error {
Server: w.URL,
Token: w.Token,
FlushIntervalSeconds: flushSeconds,
BatchSize: w.HTTPBatchSize,
BatchSize: w.HTTPMaximumBatchSize,
})
if err != nil {
return fmt.Errorf("could not create Wavefront Sender for Url: %s", w.URL)
Expand Down Expand Up @@ -294,13 +294,13 @@ func (w *Wavefront) Close() error {
func init() {
outputs.Add("wavefront", func() telegraf.Output {
return &Wavefront{
Token: "DUMMY_TOKEN",
MetricSeparator: ".",
ConvertPaths: true,
ConvertBool: true,
TruncateTags: false,
ImmediateFlush: true,
HTTPBatchSize: 10000,
Token: "DUMMY_TOKEN",
MetricSeparator: ".",
ConvertPaths: true,
ConvertBool: true,
TruncateTags: false,
ImmediateFlush: true,
HTTPMaximumBatchSize: 10000,
}
})
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/outputs/wavefront/wavefront_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ func TestTagLimits(t *testing.T) {

func TestDefaults(t *testing.T) {
defaultWavefront := outputs.Outputs["wavefront"]().(*Wavefront)
require.Equal(t, 10000, defaultWavefront.HTTPBatchSize)
require.Equal(t, 10000, defaultWavefront.HTTPMaximumBatchSize)
}

// Benchmarks to test performance of string replacement via Regex and Replacer
Expand Down

0 comments on commit 39ddfc1

Please sign in to comment.