mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
Round time to nearest second in memory storage.
When samples get flushed to disk, they lose sub-second precision anyways. By already dropping sub-second precision, data fetched from memory vs. disk will behave the same. Later, we should consider also storing a more compact representation than time.Time in memory if we're not going to use its full precision.
This commit is contained in:
parent
4d15f8fefe
commit
5d88e8cc45
|
@ -55,7 +55,7 @@ func (s *stream) add(timestamp time.Time, value clientmodel.SampleValue) {
|
||||||
// BUG(all): https://github.com/prometheus/prometheus/pull/265/files#r4336435.
|
// BUG(all): https://github.com/prometheus/prometheus/pull/265/files#r4336435.
|
||||||
|
|
||||||
s.values = append(s.values, &SamplePair{
|
s.values = append(s.values, &SamplePair{
|
||||||
Timestamp: timestamp,
|
Timestamp: timestamp.Round(time.Second).UTC(),
|
||||||
Value: value,
|
Value: value,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue