mirror of
https://github.com/grafana/grafana.git
synced 2024-11-29 04:04:00 -06:00
78978048c3
Signed-off-by: bergquist <carl.bergquist@gmail.com> Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com> Co-authored-by: Dave Henderson <dave.henderson@grafana.com>
20 lines
361 B
Go
20 lines
361 B
Go
package log
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestCountingDatabaseCalls(t *testing.T) {
|
|
ctx := context.Background()
|
|
|
|
ctx = IncDBCallCounter(ctx)
|
|
ctx = IncDBCallCounter(ctx)
|
|
ctx = IncDBCallCounter(ctx)
|
|
|
|
count := TotalDBCallCount(ctx)
|
|
assert.Equal(t, int64(3), count, "expect counter to increase three times")
|
|
}
|