Skip to content

Commit 6760c3a

Browse files
committed
Merge pull request #71 from prometheus/beorn7/timestamp
Remove obsolete comment and add Earliest and Latest timestamp.
2 parents c70db11 + 7d56056 commit 6760c3a

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

model/timestamp.go

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,14 @@
1414
package model
1515

1616
import (
17+
"math"
1718
"strconv"
1819

1920
native_time "time"
2021
)
2122

22-
// TODO(julius): Should this use milliseconds/nanoseconds instead? This is
23-
// mostly hidden from the user of these types when using the
24-
// methods below, so it will be easy to change this later
25-
// without requiring significant user code changes.
26-
27-
// Timestamp is the number of seconds since the epoch (1970-01-01 00:00 UTC)
28-
// without leap seconds.
23+
// Timestamp is the number of milliseconds since the epoch
24+
// (1970-01-01 00:00 UTC) excluding leap seconds.
2925
type Timestamp int64
3026

3127
const (
@@ -36,6 +32,13 @@ const (
3632
second = int64(native_time.Second / MinimumTick)
3733
// The number of nanoseconds per minimum tick.
3834
nanosPerTick = int64(MinimumTick / native_time.Nanosecond)
35+
36+
// Earliest is the earliest timestamp representable. Handy for
37+
// initializing a high watermark.
38+
Earliest = Timestamp(math.MinInt64)
39+
// Latest is the latest timestamp representable. Handy for initializing
40+
// a low watermark.
41+
Latest = Timestamp(math.MaxInt64)
3942
)
4043

4144
// Equal reports whether two timestamps represent the same instant.

0 commit comments

Comments
 (0)