mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-26 06:04:05 -08:00
Get label set from cache in addReportSample.
This commit is contained in:
parent
b568ace7ce
commit
2ac1809a5b
|
@ -946,11 +946,9 @@ func (sl *scrapeLoop) addReportSample(app storage.Appender, s string, t int64, v
|
|||
// Suffix s with the invalid \xff unicode rune to avoid collisions
|
||||
// with scraped metrics.
|
||||
s2 := s + "\xff"
|
||||
met := labels.Labels{
|
||||
labels.Label{Name: labels.MetricName, Value: s},
|
||||
}
|
||||
ref, ok := sl.cache.getRef(s2)
|
||||
if ok {
|
||||
met := sl.cache.lsets[ref].lset
|
||||
err := app.AddFast(met, ref, t, v)
|
||||
switch err {
|
||||
case nil:
|
||||
|
@ -966,6 +964,9 @@ func (sl *scrapeLoop) addReportSample(app storage.Appender, s string, t int64, v
|
|||
}
|
||||
}
|
||||
|
||||
met := labels.Labels{
|
||||
labels.Label{Name: labels.MetricName, Value: s},
|
||||
}
|
||||
ref, err := app.Add(met, t, v)
|
||||
switch err {
|
||||
case nil:
|
||||
|
|
Loading…
Reference in a new issue