Skip to content

Commit

Permalink
Rename staticTime to y2k
Browse files Browse the repository at this point in the history
  • Loading branch information
MrAlias committed May 8, 2024
1 parent 139157f commit 50e9fe2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions sdk/metric/internal/aggregate/aggregate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ var (
fltrBob = attribute.NewSet(userBob)

// Sat Jan 01 2000 00:00:00 GMT+0000.
staticTime = time.Unix(946684800, 0)
y2k = time.Unix(946684800, 0)
)

// y2kPlus returns the timestamp at n seconds past Sat Jan 01 2000 00:00:00 GMT+0000.
func y2kPlus(n int64) time.Time {
d := time.Duration(n) * time.Second
return staticTime.Add(d)
return y2k.Add(d)
}

type clock struct {
Expand Down
2 changes: 1 addition & 1 deletion sdk/metric/internal/aggregate/histogram_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ func TestCumulativeHistogramImutableCounts(t *testing.T) {

func TestDeltaHistogramReset(t *testing.T) {
orig := now
now = func() time.Time { return staticTime }
now = func() time.Time { return y2k }
t.Cleanup(func() {now = orig})

h := newHistogram[int64](bounds, noMinMax, false, 0, dropExemplars[int64])
Expand Down

0 comments on commit 50e9fe2

Please sign in to comment.