Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
11f13f3
[m3comparator] a feature to clear data on memory storage
May 4, 2020
e7090fb
test added
May 4, 2020
0c5a739
Merge branch 'master' into gg/m3comparator-clear-data
May 4, 2020
6aadbf1
[comparator] Generate random multi series metrics
linasm May 6, 2020
efb837d
Remove unnecessary comment
linasm May 6, 2020
2a261c9
Address review feedback
linasm May 6, 2020
6662778
Merge branch 'master' into gg/m3comparator-clear-data
arnikola May 6, 2020
5ec9d40
[comparator] Filter query results by tag matchers
linasm May 6, 2020
229d964
Merge remote-tracking branch 'origin/linasm/comparator-filter-by-tags…
May 7, 2020
0e58657
[m3comparator] Querying without metric name
May 12, 2020
652f736
Merge branch 'master' into m3comparator-query-wo-metric-name
schallert May 12, 2020
699f09a
promql testdata migrated to m3 stack
May 13, 2020
95c91ed
test files added
May 15, 2020
ae327dc
Merge remote-tracking branch 'origin/master' into m3comparator-query-…
May 26, 2020
e5c6d92
Merge branch 'master' into m3comparator-query-wo-metric-name
May 26, 2020
8e6922f
querier test refactored
May 26, 2020
9e21cf4
Merge remote-tracking branch 'origin/master' into gg/m3comparator-pro…
May 28, 2020
67fa717
fixes
May 28, 2020
ace6250
Merge remote-tracking branch 'origin/master' into gg/m3comparator-pro…
May 29, 2020
d7ad16e
Merge branch 'master' into m3comparator-query-wo-metric-name
May 29, 2020
14b92fe
fixes
May 29, 2020
78b4715
trigger
May 29, 2020
4f56e65
Merge branch 'm3comparator-query-wo-metric-name' into gg/m3comparator…
May 29, 2020
0957a9a
Merge remote-tracking branch 'origin/master' into gg/m3comparator-pro…
May 29, 2020
b679377
fixes
May 29, 2020
2043869
Merge remote-tracking branch 'origin/master' into gg/m3comparator-pro…
Jun 1, 2020
dc28992
test run fix
Jun 2, 2020
7d7bb09
Update src/query/test/testdata/histograms.test
gediminasgu Jun 3, 2020
a3fa2f2
Update src/query/test/testdata/histograms.test
gediminasgu Jun 3, 2020
643ad56
Update src/query/test/testdata/literals.test
gediminasgu Jun 3, 2020
8f113db
minor changes
Jun 3, 2020
178618c
Merge remote-tracking branch 'origin/master' into gg/m3comparator-pro…
Jun 3, 2020
e1a388c
Merge branch 'gg/m3comparator-promql-testdata' of github.com:gedimina…
Jun 3, 2020
b48b46d
Merge remote-tracking branch 'origin/master' into gg/m3comparator-pro…
Jun 8, 2020
533dcf0
minor changes
Jun 8, 2020
8e62d84
[query] return 0 if there was at least one valid number
Jun 9, 2020
a5dffd4
Merge remote-tracking branch 'origin/master' into gg/only-nan-fix
Jun 11, 2020
89f0b26
rollback of some changes
Jun 11, 2020
83a36f7
trigger
Jul 2, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion src/query/api/v1/handler/prometheus/native/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -442,9 +442,22 @@
jw.EndObject()

jw.BeginObjectField("value")

onlynans := true
for a := 0; a < length; a++ {
if !math.IsNaN(vals.ValueAt(a)) {
onlynans = false
break
}
}
Comment on lines +445 to +452
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this return the last non nan value, or explicitly 0 if there are trailing nans?


jw.BeginArray()
jw.WriteInt(int(dp.Timestamp.Unix()))
jw.WriteString(utils.FormatFloat(dp.Value))
if math.IsNaN(dp.Value) && !onlynans {
jw.WriteString("0")

Check warning on line 457 in src/query/api/v1/handler/prometheus/native/common.go

View check run for this annotation

Codecov / codecov/patch

src/query/api/v1/handler/prometheus/native/common.go#L457

Added line #L457 was not covered by tests
} else {
jw.WriteString(utils.FormatFloat(dp.Value))
}
jw.EndArray()
jw.EndObject()
}
Expand Down
27 changes: 13 additions & 14 deletions src/query/test/testdata/functions.test
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@ load 5m
http_requests{path="/biz"} 0 0 0 0 0 1 1 1 1 1

# Tests for resets().
# FAILING issue #16
#eval instant at 50m resets(http_requests[5m])
# {path="/foo"} 0
# {path="/bar"} 0
# {path="/biz"} 0
eval instant at 50m resets(http_requests[5m])
{path="/foo"} 0
{path="/bar"} 0
{path="/biz"} 0

eval instant at 50m resets(http_requests[20m])
{path="/foo"} 1
Expand All @@ -29,11 +28,10 @@ eval instant at 50m resets(http_requests[50m])
# FAILING. eval instant at 50m resets(nonexistent_metric[50m])

# Tests for changes().
# FAILING issue #17
#eval instant at 50m changes(http_requests[5m])
# {path="/foo"} 0
# {path="/bar"} 0
# {path="/biz"} 0
eval instant at 50m changes(http_requests[5m])
{path="/foo"} 0
{path="/bar"} 0
{path="/biz"} 0

eval instant at 50m changes(http_requests[20m])
{path="/foo"} 3
Expand All @@ -45,10 +43,10 @@ eval instant at 50m changes(http_requests[30m])
{path="/bar"} 5
{path="/biz"} 1

#eval instant at 50m changes(http_requests[50m])
# {path="/foo"} 8
# {path="/bar"} 9
# {path="/biz"} 1
eval instant at 50m changes(http_requests[50m])
{path="/foo"} 8
{path="/bar"} 9
{path="/biz"} 1

#eval instant at 50m changes((http_requests[50m]))
# {path="/foo"} 8
Expand Down Expand Up @@ -642,3 +640,4 @@ load 1m

# FAILING. eval instant at 10m absent_over_time({job="ingress"}[4m])
# FAILING. {job="ingress"} 1