Skip to content

Commit

Permalink
Merge pull request prometheus#2050 from prometheus/unpublish-series-m…
Browse files Browse the repository at this point in the history
…ethods

Unpublish accidentally published series methods
  • Loading branch information
juliusv authored Oct 3, 2016
2 parents f07e676 + c9d4526 commit 9172728
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions storage/local/persistence_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -462,16 +462,16 @@ func testCheckpointAndLoadSeriesMapAndHeads(t *testing.T, encoding chunk.Encodin
s3, _ := newMemorySeries(m3, nil, time.Time{})
s4, _ := newMemorySeries(m4, nil, time.Time{})
s5, _ := newMemorySeries(m5, nil, time.Time{})
s1.Add(model.SamplePair{Timestamp: 1, Value: 3.14})
s3.Add(model.SamplePair{Timestamp: 2, Value: 2.7})
s1.add(model.SamplePair{Timestamp: 1, Value: 3.14})
s3.add(model.SamplePair{Timestamp: 2, Value: 2.7})
s3.headChunkClosed = true
s3.persistWatermark = 1
for i := 0; i < 10000; i++ {
s4.Add(model.SamplePair{
s4.add(model.SamplePair{
Timestamp: model.Time(i),
Value: model.SampleValue(i) / 2,
})
s5.Add(model.SamplePair{
s5.add(model.SamplePair{
Timestamp: model.Time(i),
Value: model.SampleValue(i * i),
})
Expand Down
8 changes: 4 additions & 4 deletions storage/local/series.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ func newMemorySeries(m model.Metric, chunkDescs []*chunk.Desc, modTime time.Time
// completed chunks (which are now eligible for persistence).
//
// The caller must have locked the fingerprint of the series.
func (s *memorySeries) Add(v model.SamplePair) (int, error) {
func (s *memorySeries) add(v model.SamplePair) (int, error) {
if len(s.chunkDescs) == 0 || s.headChunkClosed {
newHead := chunk.NewDesc(chunk.New(), v.Timestamp)
s.chunkDescs = append(s.chunkDescs, newHead)
Expand Down Expand Up @@ -383,18 +383,18 @@ func (s *memorySeries) preloadChunks(
}

iter := &boundedIterator{
it: s.NewIterator(pinnedChunkDescs, curriedQuarantineSeries, mss.evictRequests),
it: s.newIterator(pinnedChunkDescs, curriedQuarantineSeries, mss.evictRequests),
start: model.Now().Add(-mss.dropAfter),
}

return iter, nil
}

// NewIterator( returns a new SeriesIterator for the provided chunkDescs (which
// newIterator returns a new SeriesIterator for the provided chunkDescs (which
// must be pinned).
//
// The caller must have locked the fingerprint of the memorySeries.
func (s *memorySeries) NewIterator(
func (s *memorySeries) newIterator(
pinnedChunkDescs []*chunk.Desc,
quarantine func(error),
evictRequests chan<- chunk.EvictRequest,
Expand Down
4 changes: 2 additions & 2 deletions storage/local/series_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ func TestDropChunks(t *testing.T) {
t.Fatal(err)
}

s.Add(model.SamplePair{
s.add(model.SamplePair{
Timestamp: 100,
Value: 42,
})
s.Add(model.SamplePair{
s.add(model.SamplePair{
Timestamp: 110,
Value: 4711,
})
Expand Down
2 changes: 1 addition & 1 deletion storage/local/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,7 @@ func (s *MemorySeriesStorage) Append(sample *model.Sample) error {
s.discardedSamplesCount.WithLabelValues(outOfOrderTimestamp).Inc()
return ErrOutOfOrderSample // Caused by the caller.
}
completedChunksCount, err := series.Add(model.SamplePair{
completedChunksCount, err := series.add(model.SamplePair{
Value: sample.Value,
Timestamp: sample.Timestamp,
})
Expand Down

0 comments on commit 9172728

Please sign in to comment.