Skip to content

Commit

Permalink
Adding benchmark for alerts
Browse files Browse the repository at this point in the history
  • Loading branch information
yosiat committed Apr 4, 2016
1 parent e30ec41 commit 4245f21
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions integrations/benchmark_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,16 @@ const (
|count('value')
|log()
`

alertM1Task = `stream
|from()
.measurement('m1')
|alert()
.id('{{ .Name }}_{{ .TaskName }}')
.info(lambda: "value" > 10)
.warn(lambda: "value" > 20)
.crit(lambda: "value" > 30)
`
)

//----------------------------
Expand Down Expand Up @@ -93,6 +103,24 @@ func Benchmark_T1000_P50000_CountTask(b *testing.B) {
Bench(b, 1000, 50000, "dbname", "rpname", "m1", countM1Task)
}

//----------------------------
// Alert Task Benchmarks

// Few tasks, few points
func Benchmark_T10_P500_AlertTask(b *testing.B) {
Bench(b, 10, 500, "dbname", "rpname", "m1", alertM1Task)
}

// Few tasks, many points
func Benchmark_T10_P50000_AlertTask(b *testing.B) {
Bench(b, 10, 50000, "dbname", "rpname", "m1", alertM1Task)
}

// Many tasks, few points
func Benchmark_T1000_P500_AlertTask(b *testing.B) {
Bench(b, 1000, 500, "dbname", "rpname", "m1", alertM1Task)
}

// Generic Benchmark method
func Bench(b *testing.B, tasksCount, pointCount int, db, rp, measurement, tickScript string) {
// Setup HTTPD service
Expand Down

0 comments on commit 4245f21

Please sign in to comment.