Skip to content

Commit 057febb

Browse files
bborehamtomwilkie
authored andcommitted
Lower the sine-wave frequency
Signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>
1 parent b9e65a3 commit 057febb

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

cmd/test-exporter/main.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,9 @@ func main() {
4242
}))
4343

4444
runner.Add(test.NewSimpleTestCase("sine_wave", func(t time.Time) float64 {
45-
degrees := t.Sub(unixStart).Seconds() * (float64(runnerConfig.ScrapeInterval) / float64(time.Second))
46-
radians := (degrees * math.Pi) / 180.
45+
// With a 15-second scrape interval this gives a ten-minute period
46+
period := 40 * runnerConfig.ScrapeInterval.Seconds()
47+
radians := float64(t.Unix()) / period * 2 * math.Pi
4748
return math.Sin(radians)
4849
}))
4950

0 commit comments

Comments
 (0)