Skip to content

Commit

Permalink
lint fix
Browse files Browse the repository at this point in the history
Signed-off-by: Jimmy Moore <[email protected]>
  • Loading branch information
jimmyaxod committed Nov 27, 2024
1 parent f25b953 commit 2a0bd60
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 28 deletions.
4 changes: 2 additions & 2 deletions pkg/storage/device/device.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ func NewDeviceWithLoggingMetrics(ds *config.DeviceSchema, log types.Logger, met

dirtyBlockSize := bs >> ds.Sync.Config.BlockShift

//numBlocks := (int(prov.Size()) + bs - 1) / bs
// numBlocks := (int(prov.Size()) + bs - 1) / bs

vm := volatilitymonitor.NewVolatilityMonitor(prov, bs, syncVolatilityExpiry)

Expand All @@ -322,7 +322,7 @@ func NewDeviceWithLoggingMetrics(ds *config.DeviceSchema, log types.Logger, met

// Setup a block order
orderer := vm
//orderer := blocks.NewAnyBlockOrder(numBlocks, nil)
// orderer := blocks.NewAnyBlockOrder(numBlocks, nil)
orderer.AddAll()

checkPeriod, err := time.ParseDuration(ds.Sync.Config.CheckPeriod)
Expand Down
20 changes: 0 additions & 20 deletions pkg/storage/metrics/prometheus/prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -475,26 +475,6 @@ func New(reg prometheus.Registerer, config *MetricsConfig) *Metrics {
met.waitingCacheAvailableRemote,
)

// Do a test histogram...
// This *seems* to work with heatmap set to time series...
// query is: sum(silo_test_test1_bucket) by (le)
test1 := prometheus.NewGaugeVec(prometheus.GaugeOpts{
Namespace: config.Namespace, Subsystem: "test", Name: "test1_bucket", Help: "test1_sum"}, []string{"le"})
// test1sum := prometheus.NewGauge(prometheus.GaugeOpts{
// Namespace: config.Namespace, Subsystem: "test", Name: "test1_sum", Help: "test1_sum"})
// test1count := prometheus.NewGauge(prometheus.GaugeOpts{
// Namespace: config.Namespace, Subsystem: "test", Name: "test1_count", Help: "test1_sum"})
reg.MustRegister(test1) //, test1sum, test1count)

test1.WithLabelValues("1").Set(10)
test1.WithLabelValues("2").Set(20)
test1.WithLabelValues("3").Set(10)
test1.WithLabelValues("4").Set(30)
test1.WithLabelValues("6").Set(10)

// test1sum.Set(10 + 20 + 10 + 30 + 10)
// test1count.Set(5)

return met
}

Expand Down
10 changes: 4 additions & 6 deletions pkg/storage/migrator/migrator_s3_assisted_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ func TestMigratorS3Assisted(t *testing.T) {
_ = destFrom.HandleDevInfo()
}()
go func() {
_ = destFrom.HandleEvent(func(p *packets.Event) {})
_ = destFrom.HandleEvent(func(_ *packets.Event) {})
}()
}

Expand Down Expand Up @@ -205,9 +205,8 @@ func TestMigratorS3Assisted(t *testing.T) {
syncRunning := storage.SendSiloEvent(provDest, "sync.running", nil)[0].(bool)
if syncRunning {
break
} else {
time.Sleep(100 * time.Millisecond)
}
time.Sleep(100 * time.Millisecond)
}

// This will end with migration completed, and consumer Locked.
Expand Down Expand Up @@ -297,7 +296,7 @@ func TestMigratorS3AssistedChangeSource(t *testing.T) {
_ = destFrom.HandleDevInfo()
}()
go func() {
_ = destFrom.HandleEvent(func(p *packets.Event) {})
_ = destFrom.HandleEvent(func(_ *packets.Event) {})
}()
}

Expand Down Expand Up @@ -357,9 +356,8 @@ func TestMigratorS3AssistedChangeSource(t *testing.T) {
syncRunning := storage.SendSiloEvent(provDest, "sync.running", nil)[0].(bool)
if syncRunning {
break
} else {
time.Sleep(100 * time.Millisecond)
}
time.Sleep(100 * time.Millisecond)
}

// This will end with migration completed, and consumer Locked.
Expand Down

0 comments on commit 2a0bd60

Please sign in to comment.