mirror of
https://github.com/prometheus/prometheus.git
synced 2024-11-14 17:44:06 -08:00
minimally-tested exemplar support for rw 1.1
Signed-off-by: Nicolás Pazos <npazosmendez@gmail.com>
This commit is contained in:
parent
8426752e0f
commit
8353c337b4
|
@ -1620,21 +1620,13 @@ func populateMinimizedTimeSeries(symbolTable *rwSymbolTable, batch []timeSeries,
|
|||
Timestamp: d.timestamp,
|
||||
})
|
||||
nPendingSamples++
|
||||
// TODO: handle all types
|
||||
//case tExemplar:
|
||||
// // TODO(npazosmendez) optimize?
|
||||
// l := make([]prompb.LabelRef, 0, d.exemplarLabels.Len())
|
||||
// d.exemplarLabels.Range(func(el labels.Label) {
|
||||
// nRef := pool.intern(el.Name)
|
||||
// vRef := pool.intern(el.Value)
|
||||
// l = append(l, prompb.LabelRef{NameRef: nRef, ValueRef: vRef})
|
||||
// })
|
||||
// pendingData[nPending].Exemplars = append(pendingData[nPending].Exemplars, prompb.ExemplarRef{
|
||||
// Labels: l,
|
||||
// Value: d.value,
|
||||
// Timestamp: d.timestamp,
|
||||
// })
|
||||
// nPendingExemplars++
|
||||
case tExemplar:
|
||||
pendingData[nPending].Exemplars = append(pendingData[nPending].Exemplars, prompb.Exemplar{
|
||||
Labels: labelsToLabelsProto(d.exemplarLabels, nil),
|
||||
Value: d.value,
|
||||
Timestamp: d.timestamp,
|
||||
})
|
||||
nPendingExemplars++
|
||||
case tHistogram:
|
||||
pendingData[nPending].Histograms = append(pendingData[nPending].Histograms, HistogramToHistogramProto(d.timestamp, d.histogram))
|
||||
nPendingHistograms++
|
||||
|
|
|
@ -1503,11 +1503,9 @@ func BenchmarkBuildMinimizedWriteRequest(b *testing.B) {
|
|||
symbolTable := newRwSymbolTable()
|
||||
buff := make([]byte, 0)
|
||||
seriesBuff := make([]prompb.MinimizedTimeSeries, len(tc.batch))
|
||||
//total := 0
|
||||
for i := range seriesBuff {
|
||||
seriesBuff[i].Samples = []prompb.Sample{{}}
|
||||
// todo: add other types
|
||||
//seriesBuff[i].Exemplars = []prompb.Exemplar{{}}
|
||||
seriesBuff[i].Exemplars = []prompb.Exemplar{{}}
|
||||
}
|
||||
pBuf := []byte{}
|
||||
|
||||
|
|
|
@ -308,7 +308,6 @@ func (h *writeHandler) writeMin(ctx context.Context, req *prompb.MinimizedWriteR
|
|||
|
||||
for _, ep := range ts.Exemplars {
|
||||
e := exemplarProtoToExemplar(ep)
|
||||
//e := exemplarRefProtoToExemplar(req.StringSymbolTable, ep)
|
||||
h.appendExemplar(app, e, ls, &outOfOrderExemplarErrs)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue