-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add the histogram bucket bridge #3937
Merged
Merged
Changes from 13 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
4032c74
Add the histogram bucket bridge
mfpierre 6472c7d
Add sender test
mfpierre b4481bf
Introduce MetricSampleContext interface
mfpierre ab6b8f2
[wip] flush sketches in check sampler
mfpierre aa82cdf
change integrations-core version
mfpierre b98591a
Fix python init
mfpierre 7a9ceda
Add release note
mfpierre 021afeb
Store bucket deltas
mfpierre df2a290
Handle arbitrarily infinity buckets
mfpierre b5f802c
Add benchmark
mfpierre 42789bd
Optimize using InsertN into the sketch
mfpierre 709cac2
Change infinity logic + add tests
mfpierre 1b5b872
Consider monotonic bucket parameter
mfpierre dedcb45
Address feedback
mfpierre 1e91b99
Address feedback
mfpierre 2bc840b
Revert release.json
mfpierre File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// Unless explicitly stated otherwise all files in this repository are licensed | ||
// under the Apache License Version 2.0. | ||
// This product includes software developed at Datadog (https://www.datadoghq.com/). | ||
// Copyright 2016-2019 Datadog, Inc. | ||
|
||
package aggregator | ||
|
||
import ( | ||
"testing" | ||
"time" | ||
|
||
"github.com/DataDog/datadog-agent/pkg/aggregator/ckey" | ||
"github.com/DataDog/datadog-agent/pkg/metrics" | ||
) | ||
|
||
func benchmarkAddBucket(bucketValue int, b *testing.B) { | ||
checkSampler := newCheckSampler() | ||
|
||
bucket := &metrics.HistogramBucket{ | ||
Name: "my.histogram", | ||
Value: bucketValue, | ||
LowerBound: 10.0, | ||
UpperBound: 20.0, | ||
Tags: []string{"foo", "bar"}, | ||
Timestamp: 12345.0, | ||
} | ||
|
||
for n := 0; n < b.N; n++ { | ||
checkSampler.addBucket(bucket) | ||
// reset bucket cache | ||
checkSampler.lastBucketValue = make(map[ckey.ContextKey]int) | ||
checkSampler.lastSeenBucket = make(map[ckey.ContextKey]time.Time) | ||
} | ||
} | ||
|
||
func BenchmarkAddBucket1(b *testing.B) { benchmarkAddBucket(1, b) } | ||
func BenchmarkAddBucket10(b *testing.B) { benchmarkAddBucket(10, b) } | ||
func BenchmarkAddBucket100(b *testing.B) { benchmarkAddBucket(100, b) } | ||
func BenchmarkAddBucket1000(b *testing.B) { benchmarkAddBucket(1000, b) } | ||
func BenchmarkAddBucket10000(b *testing.B) { benchmarkAddBucket(10000, b) } | ||
func BenchmarkAddBucket1000000(b *testing.B) { benchmarkAddBucket(1000000, b) } | ||
func BenchmarkAddBucket10000000(b *testing.B) { benchmarkAddBucket(10000000, b) } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jbarciauskas I'm not sure how to handle this field in the context of checks?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do checks run at a standard interval? I think it's only important for counts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jbarciauskas they usually do (15 sec), but a custom check interval can be defined per check