Skip to content

Commit 0fb0acf

Browse files
authored
Align default step for /render with Grafana (#3326)
In Grafana's native Explore Profiles view, the default step is 15 seconds. This is only used when the data source doesn't supply a configured min step: https://github.com/grafana/grafana/blob/24d65fa32f6ba7af3dc2e0ffa115c64aa7c97184/pkg/tsdb/grafana-pyroscope-datasource/query.go#L71-L87
1 parent 65ad9d6 commit 0fb0acf

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

pkg/querier/timeline/calculator.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88

99
var (
1010
DefaultRes int64 = 1500
11-
DefaultMinInterval = time.Second * 10
11+
DefaultMinInterval = time.Second * 15
1212
)
1313

1414
// CalcPointInterval calculates the appropriate interval between each point (aka step)

pkg/querier/timeline/calculator_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ func Test_CalcPointInterval(t *testing.T) {
1818
end time.Time
1919
want int64
2020
}{
21-
{name: "1 second", start: TestDate, end: TestDate.Add(1 * time.Second), want: 10},
22-
{name: "1 hour", start: TestDate, end: TestDate.Add(1 * time.Hour), want: 10},
21+
{name: "1 second", start: TestDate, end: TestDate.Add(1 * time.Second), want: 15},
22+
{name: "1 hour", start: TestDate, end: TestDate.Add(1 * time.Hour), want: 15},
2323
{name: "7 days", start: TestDate, end: TestDate.Add(7 * 24 * time.Hour), want: 300},
2424
{name: "30 days", start: TestDate, end: TestDate.Add(30 * 24 * time.Hour), want: 1800},
2525
{name: "90 days", start: TestDate, end: TestDate.Add(30 * 24 * time.Hour), want: 1800},

0 commit comments

Comments
 (0)