Skip to content

Commit

Permalink
happy linter
Browse files Browse the repository at this point in the history
  • Loading branch information
Exca-DK committed Sep 20, 2023
1 parent 68d9314 commit 8754e2e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 4 additions & 4 deletions db/pebble/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func NewMemTest() db.DB {
}

func newPebble(path string, options *pebble.Options) (*DB, error) {
// initialize metrics
// initialise metrics
var (
levels = newLevelsReporter()
disk = newDiskReporter()
Expand All @@ -84,7 +84,7 @@ func newPebble(path string, options *pebble.Options) (*DB, error) {
logs = newLogsReporter()
)

db := &DB{
database := &DB{
wMutex: new(sync.Mutex),
reporters: []metricsReporter{
levels,
Expand Down Expand Up @@ -116,8 +116,8 @@ func newPebble(path string, options *pebble.Options) (*DB, error) {
if err != nil {
return nil, err
}
db.pebble = pDB
return db, nil
database.pebble = pDB
return database, nil

Check warning on line 120 in db/pebble/db.go

View check run for this annotation

Codecov / codecov/patch

db/pebble/db.go#L119-L120

Added lines #L119 - L120 were not covered by tests
}

// NewTransaction : see db.DB.NewTransaction
Expand Down
4 changes: 4 additions & 0 deletions db/pebble/db_metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,14 @@ func newLevelsReporter() *levelsReporter {
return reporter
}

//nolint:gocritic
func (reporter *levelsReporter) onCompBegin(ci pebble.CompactionInfo) {
for _, input := range ci.Input {
reporter.compLvls[input.Level].Add(1)
}

Check warning on line 198 in db/pebble/db_metrics.go

View check run for this annotation

Codecov / codecov/patch

db/pebble/db_metrics.go#L195-L198

Added lines #L195 - L198 were not covered by tests
}

//nolint:gocritic
func (reporter *levelsReporter) onCompEnd(ci pebble.CompactionInfo) {
reporter.compDuration.Add(int64(ci.TotalDuration))

Check warning on line 203 in db/pebble/db_metrics.go

View check run for this annotation

Codecov / codecov/patch

db/pebble/db_metrics.go#L202-L203

Added lines #L202 - L203 were not covered by tests
}
Expand Down Expand Up @@ -636,6 +638,7 @@ type memtableReporter struct {
}
}

//nolint:dupl
func newMemtableReporter() *memtableReporter {
const subsystem = "memtable"
reporter := &memtableReporter{}
Expand Down Expand Up @@ -725,6 +728,7 @@ type snapshotsReporter struct {
}
}

//nolint:dupl
func newSnapshotReporter() *snapshotsReporter {
const subsystem = "snapshots"
reporter := &snapshotsReporter{}
Expand Down

0 comments on commit 8754e2e

Please sign in to comment.