mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
Remove references to custom values record
This commit is contained in:
parent
6d413fad36
commit
cfcd51538d
|
@ -87,7 +87,6 @@ type Head struct {
|
||||||
logger *slog.Logger
|
logger *slog.Logger
|
||||||
appendPool zeropool.Pool[[]record.RefSample]
|
appendPool zeropool.Pool[[]record.RefSample]
|
||||||
exemplarsPool zeropool.Pool[[]exemplarWithSeriesRef]
|
exemplarsPool zeropool.Pool[[]exemplarWithSeriesRef]
|
||||||
customValuesPool zeropool.Pool[[]record.RefCustomValues]
|
|
||||||
histogramsPool zeropool.Pool[[]record.RefHistogramSample]
|
histogramsPool zeropool.Pool[[]record.RefHistogramSample]
|
||||||
floatHistogramsPool zeropool.Pool[[]record.RefFloatHistogramSample]
|
floatHistogramsPool zeropool.Pool[[]record.RefFloatHistogramSample]
|
||||||
metadataPool zeropool.Pool[[]record.RefMetadata]
|
metadataPool zeropool.Pool[[]record.RefMetadata]
|
||||||
|
@ -2135,7 +2134,6 @@ type memSeries struct {
|
||||||
// We keep the last histogram value here (in addition to appending it to the chunk) so we can check for duplicates.
|
// We keep the last histogram value here (in addition to appending it to the chunk) so we can check for duplicates.
|
||||||
lastHistogramValue *histogram.Histogram
|
lastHistogramValue *histogram.Histogram
|
||||||
lastFloatHistogramValue *histogram.FloatHistogram
|
lastFloatHistogramValue *histogram.FloatHistogram
|
||||||
customValues []float64
|
|
||||||
|
|
||||||
// Current appender for the head chunk. Set when a new head chunk is cut.
|
// Current appender for the head chunk. Set when a new head chunk is cut.
|
||||||
// It is nil only if headChunks is nil. E.g. if there was an appender that created a new series, but rolled back the commit
|
// It is nil only if headChunks is nil. E.g. if there was an appender that created a new series, but rolled back the commit
|
||||||
|
|
|
@ -1458,17 +1458,6 @@ func (a *headAppender) Commit() (err error) {
|
||||||
a.commitFloatHistograms(acc)
|
a.commitFloatHistograms(acc)
|
||||||
a.commitMetadata()
|
a.commitMetadata()
|
||||||
|
|
||||||
a.head.metrics.outOfOrderSamples.WithLabelValues(sampleMetricTypeFloat).Add(float64(acc.floatOOORejected))
|
|
||||||
a.head.metrics.outOfOrderSamples.WithLabelValues(sampleMetricTypeHistogram).Add(float64(acc.histoOOORejected))
|
|
||||||
a.head.metrics.outOfBoundSamples.WithLabelValues(sampleMetricTypeFloat).Add(float64(acc.floatOOBRejected))
|
|
||||||
a.head.metrics.tooOldSamples.WithLabelValues(sampleMetricTypeFloat).Add(float64(acc.floatTooOldRejected))
|
|
||||||
a.head.metrics.samplesAppended.WithLabelValues(sampleMetricTypeFloat).Add(float64(acc.floatsAppended))
|
|
||||||
a.head.metrics.samplesAppended.WithLabelValues(sampleMetricTypeHistogram).Add(float64(acc.histogramsAppended))
|
|
||||||
a.head.metrics.outOfOrderSamplesAppended.WithLabelValues(sampleMetricTypeFloat).Add(float64(acc.oooFloatsAccepted))
|
|
||||||
a.head.metrics.outOfOrderSamplesAppended.WithLabelValues(sampleMetricTypeHistogram).Add(float64(acc.oooHistogramAccepted))
|
|
||||||
a.head.updateMinMaxTime(acc.inOrderMint, acc.inOrderMaxt)
|
|
||||||
a.head.updateMinOOOMaxOOOTime(acc.oooMinT, acc.oooMaxT)
|
|
||||||
|
|
||||||
acc.collectOOORecords(a)
|
acc.collectOOORecords(a)
|
||||||
if a.head.wbl != nil {
|
if a.head.wbl != nil {
|
||||||
if err := a.head.wbl.Log(acc.oooRecords...); err != nil {
|
if err := a.head.wbl.Log(acc.oooRecords...); err != nil {
|
||||||
|
|
|
@ -332,19 +332,6 @@ Outer:
|
||||||
if r, ok := multiRef[sam.Ref]; ok {
|
if r, ok := multiRef[sam.Ref]; ok {
|
||||||
sam.Ref = r
|
sam.Ref = r
|
||||||
}
|
}
|
||||||
if histogram.IsCustomBucketsSchema(sam.H.Schema) {
|
|
||||||
ms := h.series.getByID(sam.Ref)
|
|
||||||
if ms == nil {
|
|
||||||
unknownHistogramRefs.Inc()
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
if ms.lastFloatHistogramValue != nil {
|
|
||||||
sam.H.CustomValues = ms.lastFloatHistogramValue.CustomValues
|
|
||||||
} else {
|
|
||||||
sam.H.CustomValues = ms.customValues
|
|
||||||
}
|
|
||||||
}
|
|
||||||
mod := uint64(sam.Ref) % uint64(concurrency)
|
mod := uint64(sam.Ref) % uint64(concurrency)
|
||||||
histogramShards[mod] = append(histogramShards[mod], histogramRecord{ref: sam.Ref, t: sam.T, h: sam.H})
|
histogramShards[mod] = append(histogramShards[mod], histogramRecord{ref: sam.Ref, t: sam.T, h: sam.H})
|
||||||
}
|
}
|
||||||
|
@ -381,14 +368,6 @@ Outer:
|
||||||
if r, ok := multiRef[sam.Ref]; ok {
|
if r, ok := multiRef[sam.Ref]; ok {
|
||||||
sam.Ref = r
|
sam.Ref = r
|
||||||
}
|
}
|
||||||
if histogram.IsCustomBucketsSchema(sam.FH.Schema) {
|
|
||||||
ms := h.series.getByID(sam.Ref)
|
|
||||||
if ms == nil {
|
|
||||||
unknownHistogramRefs.Inc()
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
sam.FH.CustomValues = ms.customValues
|
|
||||||
}
|
|
||||||
mod := uint64(sam.Ref) % uint64(concurrency)
|
mod := uint64(sam.Ref) % uint64(concurrency)
|
||||||
histogramShards[mod] = append(histogramShards[mod], histogramRecord{ref: sam.Ref, t: sam.T, fh: sam.FH})
|
histogramShards[mod] = append(histogramShards[mod], histogramRecord{ref: sam.Ref, t: sam.T, fh: sam.FH})
|
||||||
}
|
}
|
||||||
|
@ -641,22 +620,8 @@ func (wp *walSubsetProcessor) processWALSamples(h *Head, mmappedChunks, oooMmapp
|
||||||
|
|
||||||
var chunkCreated bool
|
var chunkCreated bool
|
||||||
if s.h != nil {
|
if s.h != nil {
|
||||||
//if histogram.IsCustomBucketsSchema(s.h.Schema) {
|
|
||||||
// if ms.lastHistogramValue != nil {
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
_, chunkCreated = ms.appendHistogram(s.t, s.h, 0, appendChunkOpts)
|
_, chunkCreated = ms.appendHistogram(s.t, s.h, 0, appendChunkOpts)
|
||||||
} else {
|
} else {
|
||||||
//if histogram.IsCustomBucketsSchema(s.fh.Schema) {
|
|
||||||
// if ms.lastFloatHistogramValue != nil {
|
|
||||||
// s.h.CustomValues = ms.lastFloatHistogramValue.CustomValues
|
|
||||||
// } else {
|
|
||||||
// s.h.CustomValues = ms.customValues
|
|
||||||
// }
|
|
||||||
// //customVals := h.
|
|
||||||
// //s.h.CustomValues =
|
|
||||||
//}
|
|
||||||
_, chunkCreated = ms.appendFloatHistogram(s.t, s.fh, 0, appendChunkOpts)
|
_, chunkCreated = ms.appendFloatHistogram(s.t, s.fh, 0, appendChunkOpts)
|
||||||
}
|
}
|
||||||
if chunkCreated {
|
if chunkCreated {
|
||||||
|
|
|
@ -52,7 +52,6 @@ const (
|
||||||
HistogramSamples Type = 7
|
HistogramSamples Type = 7
|
||||||
// FloatHistogramSamples is used to match WAL records of type Float Histograms.
|
// FloatHistogramSamples is used to match WAL records of type Float Histograms.
|
||||||
FloatHistogramSamples Type = 8
|
FloatHistogramSamples Type = 8
|
||||||
CustomValues Type = 9
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func (rt Type) String() string {
|
func (rt Type) String() string {
|
||||||
|
@ -73,8 +72,6 @@ func (rt Type) String() string {
|
||||||
return "mmapmarkers"
|
return "mmapmarkers"
|
||||||
case Metadata:
|
case Metadata:
|
||||||
return "metadata"
|
return "metadata"
|
||||||
case CustomValues:
|
|
||||||
return "custom_values"
|
|
||||||
default:
|
default:
|
||||||
return "unknown"
|
return "unknown"
|
||||||
}
|
}
|
||||||
|
@ -150,11 +147,6 @@ type RefSeries struct {
|
||||||
Labels labels.Labels
|
Labels labels.Labels
|
||||||
}
|
}
|
||||||
|
|
||||||
type RefCustomValues struct {
|
|
||||||
Ref chunks.HeadSeriesRef
|
|
||||||
CustomValues []float64
|
|
||||||
}
|
|
||||||
|
|
||||||
// RefSample is a timestamp/value pair associated with a reference to a series.
|
// RefSample is a timestamp/value pair associated with a reference to a series.
|
||||||
// TODO(beorn7): Perhaps make this "polymorphic", including histogram and float-histogram pointers? Then get rid of RefHistogramSample.
|
// TODO(beorn7): Perhaps make this "polymorphic", including histogram and float-histogram pointers? Then get rid of RefHistogramSample.
|
||||||
type RefSample struct {
|
type RefSample struct {
|
||||||
|
@ -215,7 +207,7 @@ func (d *Decoder) Type(rec []byte) Type {
|
||||||
return Unknown
|
return Unknown
|
||||||
}
|
}
|
||||||
switch t := Type(rec[0]); t {
|
switch t := Type(rec[0]); t {
|
||||||
case Series, Samples, Tombstones, Exemplars, MmapMarkers, Metadata, HistogramSamples, FloatHistogramSamples, CustomValues:
|
case Series, Samples, Tombstones, Exemplars, MmapMarkers, Metadata, HistogramSamples, FloatHistogramSamples:
|
||||||
return t
|
return t
|
||||||
}
|
}
|
||||||
return Unknown
|
return Unknown
|
||||||
|
|
Loading…
Reference in a new issue