diff --git a/glide.lock b/glide.lock index ee01b781..ab51bab5 100644 --- a/glide.lock +++ b/glide.lock @@ -13,8 +13,6 @@ imports: version: 91c326c3f7bd20f0226d3d1c289dd9f8ce28d33d subpackages: - statsd -- name: github.com/facebookgo/clock - version: 600d898af40aa09a7a93ecb9265d87b0504b6f03 - name: github.com/golang/protobuf version: 130e6b02ab059e7b717a096f397c5b60111cae74 subpackages: diff --git a/glide.yaml b/glide.yaml index 3ece1314..046e2de5 100644 --- a/glide.yaml +++ b/glide.yaml @@ -5,8 +5,6 @@ import: version: ~3.1.0 subpackages: - statsd -- package: github.com/facebookgo/clock - version: 600d898af40aa09a7a93ecb9265d87b0504b6f03 - package: github.com/prometheus/client_golang version: ^0.8.0 subpackages: diff --git a/scope.go b/scope.go index 8db3a239..f8ff2f00 100644 --- a/scope.go +++ b/scope.go @@ -25,8 +25,6 @@ import ( "io" "sync" "time" - - "github.com/facebookgo/clock" ) var ( @@ -35,7 +33,7 @@ var ( // DefaultSeparator is the default separator used to join nested scopes DefaultSeparator = "." - globalClock = clock.New() + globalNow = time.Now defaultScopeBuckets = DurationBuckets{ 0 * time.Millisecond, diff --git a/stats.go b/stats.go index f6244684..98ac4ba4 100644 --- a/stats.go +++ b/stats.go @@ -181,11 +181,11 @@ func (t *timer) Record(interval time.Duration) { } func (t *timer) Start() Stopwatch { - return NewStopwatch(globalClock.Now(), t) + return NewStopwatch(globalNow(), t) } func (t *timer) RecordStopwatch(stopwatchStart time.Time) { - d := globalClock.Now().Sub(stopwatchStart) + d := globalNow().Sub(stopwatchStart) t.Record(d) } @@ -367,11 +367,11 @@ func (h *histogram) RecordDuration(value time.Duration) { } func (h *histogram) Start() Stopwatch { - return NewStopwatch(globalClock.Now(), h) + return NewStopwatch(globalNow(), h) } func (h *histogram) RecordStopwatch(stopwatchStart time.Time) { - d := globalClock.Now().Sub(stopwatchStart) + d := globalNow().Sub(stopwatchStart) h.RecordDuration(d) }