Skip to content

Commit

Permalink
Addressed comments, rebased.
Browse files Browse the repository at this point in the history
Signed-off-by: Bartek Plotka <[email protected]>
  • Loading branch information
bwplotka committed Oct 21, 2019
1 parent e9a3e2c commit bbb579d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ We use *breaking* word for marking changes that are not backward compatible (rel

### Changed

- [#1666](https://github.com/thanos-io/thanos/pull/1666) `thanos_compact_group_compactions_total` now counts block compactions, so operation that resulted in compacted block. The old behaviour
- [#1666](https://github.com/thanos-io/thanos/pull/1666) `thanos_compact_group_compactions_total` now counts block compactions, so operations that resulted in a compacted block. The old behaviour
is now exposed by new metric: `thanos_compact_group_compaction_runs_started_total` and `thanos_compact_group_compaction_runs_completed_total` which counts compaction runs overall.

## [v0.8.1](https://github.com/thanos-io/thanos/releases/tag/v0.8.1) - 2019.10.14
Expand Down
8 changes: 4 additions & 4 deletions pkg/compact/compact.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,15 @@ func newSyncerMetrics(reg prometheus.Registerer) *syncerMetrics {

m.compactions = prometheus.NewCounterVec(prometheus.CounterOpts{
Name: "thanos_compact_group_compactions_total",
Help: "Total number of group compactions attempts, resulted with new block.",
Help: "Total number of group compaction attempts that resulted in a new block.",
}, []string{"group"})
m.compactionRunsStarted = prometheus.NewCounterVec(prometheus.CounterOpts{
Name: "thanos_compact_group_compaction_runs_started_total",
Help: "Total number of group compactions run attempts.",
Help: "Total number of group compaction attempts.",
}, []string{"group"})
m.compactionRunsCompleted = prometheus.NewCounterVec(prometheus.CounterOpts{
Name: "thanos_compact_group_compaction_runs_completed_total",
Help: "Total number of group compactions run completed. This also includes compactor group runs that resulted with no compaction.",
Help: "Total number of group completed compaction runs. This also includes compactor group runs that resulted with no compaction.",
}, []string{"group"})
m.compactionFailures = prometheus.NewCounterVec(prometheus.CounterOpts{
Name: "thanos_compact_group_compactions_failures_total",
Expand Down Expand Up @@ -352,7 +352,7 @@ func GroupKey(meta metadata.Thanos) string {
}

func groupKey(res int64, lbls labels.Labels) string {
return fmt.Sprintf("%d@%s", res, fmt.Sprintf("%v", lbls.Hash()))
return fmt.Sprintf("%d@%v", res, lbls.Hash())
}

// Groups returns the compaction groups for all blocks currently known to the syncer.
Expand Down
6 changes: 3 additions & 3 deletions pkg/objstore/inmem/inmem.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
var errNotFound = errors.New("inmem: object not found")

// Bucket implements the store.Bucket and shipper.Bucket interfaces against local memory.
// methods from Bucket interface are thread-save. Object are assumed immutable.
// methods from Bucket interface are thread-safe. Object are assumed to be immutable.
type Bucket struct {
mtx sync.RWMutex
objects map[string][]byte
Expand Down Expand Up @@ -93,8 +93,8 @@ func (b *Bucket) Get(_ context.Context, name string) (io.ReadCloser, error) {
}

b.mtx.RLock()
defer b.mtx.RUnlock()
file, ok := b.objects[name]
b.mtx.RUnlock()
if !ok {
return nil, errNotFound
}
Expand All @@ -109,8 +109,8 @@ func (b *Bucket) GetRange(_ context.Context, name string, off, length int64) (io
}

b.mtx.RLock()
defer b.mtx.RUnlock()
file, ok := b.objects[name]
b.mtx.RUnlock()
if !ok {
return nil, errNotFound
}
Expand Down

0 comments on commit bbb579d

Please sign in to comment.