update docstrings to remove references to removed function
CI / Go tests (push) Waiting to run Details
CI / More Go tests (push) Waiting to run Details
CI / Go tests with previous Go version (push) Waiting to run Details
CI / UI tests (push) Waiting to run Details
CI / Go tests on Windows (push) Waiting to run Details
CI / Mixins tests (push) Waiting to run Details
CI / Build Prometheus for common architectures (0) (push) Waiting to run Details
CI / Build Prometheus for common architectures (1) (push) Waiting to run Details
CI / Build Prometheus for common architectures (2) (push) Waiting to run Details
CI / Build Prometheus for all architectures (0) (push) Waiting to run Details
CI / Build Prometheus for all architectures (1) (push) Waiting to run Details
CI / Build Prometheus for all architectures (10) (push) Waiting to run Details
CI / Build Prometheus for all architectures (11) (push) Waiting to run Details
CI / Build Prometheus for all architectures (2) (push) Waiting to run Details
CI / Build Prometheus for all architectures (3) (push) Waiting to run Details
CI / Build Prometheus for all architectures (4) (push) Waiting to run Details
CI / Build Prometheus for all architectures (5) (push) Waiting to run Details
CI / Build Prometheus for all architectures (6) (push) Waiting to run Details
CI / Build Prometheus for all architectures (7) (push) Waiting to run Details
CI / Build Prometheus for all architectures (8) (push) Waiting to run Details
CI / Build Prometheus for all architectures (9) (push) Waiting to run Details
CI / Report status of build Prometheus for all architectures (push) Blocked by required conditions Details
CI / Check generated parser (push) Waiting to run Details
CI / golangci-lint (push) Waiting to run Details
CI / fuzzing (push) Waiting to run Details
CI / codeql (push) Waiting to run Details
CI / Publish main branch artifacts (push) Blocked by required conditions Details
CI / Publish release artefacts (push) Blocked by required conditions Details
CI / Publish UI on npm Registry (push) Blocked by required conditions Details

expandSpansForward is no more, replaced by expandFloatSpansAndBuckets
and expandIntSpansAndBuckets

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
This commit is contained in:
György Krajcsovits 2025-07-22 08:47:06 +02:00
parent a6097c51f2
commit ba0cf82333
No known key found for this signature in database
GPG Key ID: 47A8F9CE80FD7C7F
6 changed files with 11 additions and 10 deletions

View File

@ -343,7 +343,7 @@ func (a *FloatHistogramAppender) appendable(h *histogram.FloatHistogram) (
// original deltas to a new set of deltas to match a new span layout that adds // original deltas to a new set of deltas to match a new span layout that adds
// buckets, we simply need to generate a list of inserts. // buckets, we simply need to generate a list of inserts.
// //
// Note: Within expandSpansForward we don't have to worry about the changes to the // Note: Within expandFloatSpansAndBuckets we don't have to worry about the changes to the
// spans themselves, thanks to the iterators we get to work with the more useful // spans themselves, thanks to the iterators we get to work with the more useful
// bucket indices (which of course directly correspond to the buckets we have to // bucket indices (which of course directly correspond to the buckets we have to
// adjust). // adjust).

View File

@ -195,7 +195,7 @@ func TestFloatHistogramChunkSameBuckets(t *testing.T) {
require.Equal(t, ValNone, it4.Seek(exp[len(exp)-1].t+1)) require.Equal(t, ValNone, it4.Seek(exp[len(exp)-1].t+1))
} }
// Mimics the scenario described for expandSpansForward. // Mimics the scenario described for expandFloatSpansAndBuckets.
func TestFloatHistogramChunkBucketChanges(t *testing.T) { func TestFloatHistogramChunkBucketChanges(t *testing.T) {
c := Chunk(NewFloatHistogramChunk()) c := Chunk(NewFloatHistogramChunk())

View File

@ -374,7 +374,7 @@ func (a *HistogramAppender) appendable(h *histogram.Histogram) (
// original deltas to a new set of deltas to match a new span layout that adds // original deltas to a new set of deltas to match a new span layout that adds
// buckets, we simply need to generate a list of inserts. // buckets, we simply need to generate a list of inserts.
// //
// Note: Within expandSpansForward we don't have to worry about the changes to the // Note: Within expandIntSpansAndBuckets we don't have to worry about the changes to the
// spans themselves, thanks to the iterators we get to work with the more useful // spans themselves, thanks to the iterators we get to work with the more useful
// bucket indices (which of course directly correspond to the buckets we have to // bucket indices (which of course directly correspond to the buckets we have to
// adjust). // adjust).

View File

@ -284,11 +284,12 @@ type Insert struct {
bucketIdx int bucketIdx int
} }
// expandSpansBothWays is similar to expandSpansForward, but now b may also // expandSpansBothWays is similar to expandFloatSpansAndBuckets and
// cover an entirely different set of buckets. The function returns the // expandIntSpansAndBuckets, but now b may also cover an entirely different set
// “forward” inserts to expand 'a' to also cover all the buckets exclusively // of buckets and counter resets are ignored. The function returns the “forward”
// covered by 'b', and it returns the “backward” inserts to expand 'b' to also // inserts to expand 'a' to also cover all the buckets exclusively covered by
// cover all the buckets exclusively covered by 'a'. // 'b', and it returns the “backward” inserts to expand 'b' to also cover all
// the buckets exclusively covered by 'a'.
func expandSpansBothWays(a, b []histogram.Span) (forward, backward []Insert, mergedSpans []histogram.Span) { func expandSpansBothWays(a, b []histogram.Span) (forward, backward []Insert, mergedSpans []histogram.Span) {
ai := newBucketIterator(a) ai := newBucketIterator(a)
bi := newBucketIterator(b) bi := newBucketIterator(b)

View File

@ -78,7 +78,7 @@ func TestBucketIterator(t *testing.T) {
}, },
idxs: []int{100, 101, 102, 103, 112, 113, 114, 115, 116, 117, 118, 119}, idxs: []int{100, 101, 102, 103, 112, 113, 114, 115, 116, 117, 118, 119},
}, },
// The below 2 sets ore the ones described in expandSpansForward's comments. // The below 2 sets ore the ones described in expandFloatSpansAndBuckets's comments.
{ {
spans: []histogram.Span{ spans: []histogram.Span{
{Offset: 0, Length: 2}, {Offset: 0, Length: 2},

View File

@ -206,7 +206,7 @@ func TestHistogramChunkSameBuckets(t *testing.T) {
require.Equal(t, ValNone, it4.Seek(exp[len(exp)-1].t+1)) require.Equal(t, ValNone, it4.Seek(exp[len(exp)-1].t+1))
} }
// Mimics the scenario described for expandSpansForward. // Mimics the scenario described for expandIntSpansAndBuckets.
func TestHistogramChunkBucketChanges(t *testing.T) { func TestHistogramChunkBucketChanges(t *testing.T) {
c := Chunk(NewHistogramChunk()) c := Chunk(NewHistogramChunk())