Skip to content

Commit

Permalink
Rename func, add doc
Browse files Browse the repository at this point in the history
  • Loading branch information
jotak committed Oct 16, 2023
1 parent 99ca4b0 commit 29a38e1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
15 changes: 13 additions & 2 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,24 @@ Following is the supported API format for prometheus encode:
agg_histogram: counts samples in configurable buckets, pre-aggregated via an Aggregate stage
filter: an optional criterion to filter entries by. Deprecated: use filters instead.
key: the key to match and filter by
value: the value to match and filter by. Use !nil / nil to match presence / absence. Add multiple matching values using '|' rune such as 'a|b' to match either 'a' or 'b'.
value: the value to match and filter by
type: (enum) the type of filter match: exact (default), presence, absence or regex
exact: match exactly the provided fitler value
presence: filter key must be present (filter value is ignored)
absence: filter key must be absent (filter value is ignored)
regex: match filter value as a regular expression
filters: a list of criteria to filter entries by
key: the key to match and filter by
value: the value to match and filter by. Use !nil / nil to match presence / absence. Add multiple matching values using '|' rune such as 'a|b' to match either 'a' or 'b'.
value: the value to match and filter by
type: (enum) the type of filter match: exact (default), presence, absence or regex
exact: match exactly the provided fitler value
presence: filter key must be present (filter value is ignored)
absence: filter key must be absent (filter value is ignored)
regex: match filter value as a regular expression
valueKey: entry key from which to resolve metric value
labels: labels to be associated with the metric
buckets: histogram buckets
valueScale: scale factor of the value (MetricVal := FlowVal / Scale)
prefix: prefix added to each metric name
expiryTime: time duration of no-flow to wait before deleting prometheus data item
maxMetrics: maximum number of metrics to report (default: unlimited)
Expand Down
4 changes: 2 additions & 2 deletions pkg/pipeline/encode/encode_prom_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ func buildFlow() config.GenericMap {
}
}

func hundredFlows() []config.GenericMap {
func thousandsFlows() []config.GenericMap {
flows := make([]config.GenericMap, 1000)
for i := 0; i < 1000; i++ {
flows[i] = buildFlow()
Expand Down Expand Up @@ -573,7 +573,7 @@ func BenchmarkPromEncode(b *testing.B) {
require.NoError(b, err)

for i := 0; i < b.N; i++ {
for _, metric := range hundredFlows() {
for _, metric := range thousandsFlows() {
prom.Encode(metric)
}
}
Expand Down

0 comments on commit 29a38e1

Please sign in to comment.