newExemplarBucketSet creates a new bucket set for the aligned time range start and end are in nanoseconds. If the range is instant, empty bucket set is returned.
(exemplars uint32, start, end, step uint64, instant bool)
| 54 | // start and end are in nanoseconds. |
| 55 | // If the range is instant, empty bucket set is returned. |
| 56 | func newExemplarBucketSet(exemplars uint32, start, end, step uint64, instant bool) bucketSet { |
| 57 | if instant { |
| 58 | return &alwaysFullBucketSet{} |
| 59 | } |
| 60 | |
| 61 | start = alignStart(start, end, step, instant) |
| 62 | end = alignEnd(start, end, step, instant) |
| 63 | |
| 64 | return newBucketSet(exemplars, start, end) |
| 65 | } |
| 66 | |
| 67 | type alwaysFullBucketSet struct{} |
| 68 |