-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support configurable bucket ranges for bulk_process_time Histogram (#48)
* node/elasticsearch: support configurable bucket range for indexing time * helpers.go, node/elasticsearch: allow user configuration of configurable bucket range represented as float64 * docs/node-elasticsearch.md: document configurable indexing time bucket, and format tables so that my IDE stops shouting * node/elasticsearch/metrics_test.go: test that n buckets exist, ignoring values. also, stop testing behaviors specific to prometheus, as that is not firebolts concern
- Loading branch information
Showing
7 changed files
with
131 additions
and
24 deletions.
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
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
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,35 @@ | ||
package elasticsearch | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func Test_generateElasticsearchProcessTimeBuckets(t *testing.T) { | ||
type args struct { | ||
min float64 | ||
max float64 | ||
count int | ||
} | ||
tests := []struct { | ||
name string | ||
args args | ||
wantCount int | ||
}{ | ||
{ | ||
name: "creates expected number of default buckets", | ||
args: args{ | ||
min: 0.01, | ||
max: 10, | ||
count: 8, | ||
}, | ||
wantCount: 8, | ||
}, | ||
} | ||
for _, tt := range tests { | ||
t.Run(tt.name, func(t *testing.T) { | ||
assert.Equalf(t, tt.wantCount, len(generateElasticsearchProcessTimeBuckets(tt.args.min, tt.args.max, tt.args.count)), "generateElasticsearchProcessTimeBuckets(%v, %v, %v)", tt.args.min, tt.args.max, tt.args.count) | ||
}) | ||
} | ||
} |