mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-26 22:19:40 -08:00
Add return error to Appender.Add
This commit is contained in:
parent
3a5468f251
commit
eb4f366988
6
db.go
6
db.go
|
@ -113,7 +113,7 @@ type Appender interface {
|
||||||
// AddSeries(Labels) uint64
|
// AddSeries(Labels) uint64
|
||||||
|
|
||||||
// Add adds a sample pair for the referenced series.
|
// Add adds a sample pair for the referenced series.
|
||||||
Add(lset labels.Labels, t int64, v float64)
|
Add(lset labels.Labels, t int64, v float64) error
|
||||||
|
|
||||||
// Commit submits the collected samples and purges the batch.
|
// Commit submits the collected samples and purges the batch.
|
||||||
Commit() error
|
Commit() error
|
||||||
|
@ -132,7 +132,7 @@ type bucketAppender struct {
|
||||||
buckets [][]hashedSample
|
buckets [][]hashedSample
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ba *bucketAppender) Add(lset labels.Labels, t int64, v float64) {
|
func (ba *bucketAppender) Add(lset labels.Labels, t int64, v float64) error {
|
||||||
h := lset.Hash()
|
h := lset.Hash()
|
||||||
s := h >> (64 - shardShift)
|
s := h >> (64 - shardShift)
|
||||||
|
|
||||||
|
@ -142,6 +142,8 @@ func (ba *bucketAppender) Add(lset labels.Labels, t int64, v float64) {
|
||||||
t: t,
|
t: t,
|
||||||
v: v,
|
v: v,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ba *bucketAppender) reset() {
|
func (ba *bucketAppender) reset() {
|
||||||
|
|
Loading…
Reference in a new issue