cloudflare/cloudflared

Public

mirrored from https://github.com/cloudflare/cloudflaredAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
2018.12.0

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

metrics/timer_test.go

24lines · modeblame

d06fc520Areg Harutyunyan8 years ago1package metrics
2
3import (
4"testing"
5"time"
6
7"github.com/prometheus/client_golang/prometheus"
8"github.com/stretchr/testify/assert"
9)
10
11func TestEnd(t *testing.T) {
12m := prometheus.NewHistogramVec(
13prometheus.HistogramOpts{
14Namespace: "TestCallLatencyWithoutMeasurement",
15Name: "Latency",
16Buckets: prometheus.LinearBuckets(0, 50, 100),
17},
18[]string{"key"},
19)
20timer := NewTimer(m, time.Millisecond, "key")
21assert.Equal(t, time.Duration(0), timer.End("dne"))
22timer.Start("test")
23assert.NotEqual(t, time.Duration(0), timer.End("test"))
24}