@@ -141,7 +141,6 @@ func TestSyncError(t *testing.T) {
141141
142142 injectedErr := errors .New ("injected error" )
143143 w := NewLogWriter (syncErrorFile {f , injectedErr }, 0 , LogWriterConfig {
144- WALFsyncLatency : prometheus .NewHistogram (prometheus.HistogramOpts {}),
145144 WriteWALSyncOffsets : func () bool { return false },
146145 })
147146
@@ -184,7 +183,6 @@ func (f *syncFile) Sync() error {
184183func TestSyncRecord (t * testing.T ) {
185184 f := & syncFile {}
186185 w := NewLogWriter (f , 0 , LogWriterConfig {
187- WALFsyncLatency : prometheus .NewHistogram (prometheus.HistogramOpts {}),
188186 WriteWALSyncOffsets : func () bool { return false },
189187 })
190188
@@ -212,7 +210,6 @@ func TestSyncRecordWithSignalChan(t *testing.T) {
212210 semChan <- struct {}{}
213211 }
214212 w := NewLogWriter (f , 0 , LogWriterConfig {
215- WALFsyncLatency : prometheus .NewHistogram (prometheus.HistogramOpts {}),
216213 QueueSemChan : semChan ,
217214 WriteWALSyncOffsets : func () bool { return false },
218215 })
@@ -264,7 +261,6 @@ func TestMinSyncInterval(t *testing.T) {
264261 WALMinSyncInterval : func () time.Duration {
265262 return minSyncInterval
266263 },
267- WALFsyncLatency : prometheus .NewHistogram (prometheus.HistogramOpts {}),
268264 WriteWALSyncOffsets : func () bool { return false },
269265 })
270266
@@ -337,7 +333,6 @@ func TestMinSyncIntervalClose(t *testing.T) {
337333 WALMinSyncInterval : func () time.Duration {
338334 return minSyncInterval
339335 },
340- WALFsyncLatency : prometheus .NewHistogram (prometheus.HistogramOpts {}),
341336 WriteWALSyncOffsets : func () bool { return false },
342337 })
343338
@@ -389,7 +384,6 @@ func TestMetricsWithoutSync(t *testing.T) {
389384 f := & syncFileWithWait {}
390385 f .writeWG .Add (1 )
391386 w := NewLogWriter (f , 0 , LogWriterConfig {
392- WALFsyncLatency : prometheus .NewHistogram (prometheus.HistogramOpts {}),
393387 WriteWALSyncOffsets : func () bool { return false },
394388 })
395389 offset , err := w .SyncRecord ([]byte ("hello" ), nil , nil )
@@ -435,10 +429,9 @@ func TestMetricsWithSync(t *testing.T) {
435429 })
436430
437431 w := NewLogWriter (f , 0 , LogWriterConfig {
438- WALFsyncLatency : syncLatencyMicros ,
439432 WriteWALSyncOffsets : func () bool { return false },
440- } ,
441- )
433+ WALFileOpHistogram : syncLatencyMicros ,
434+ } )
442435 var wg sync.WaitGroup
443436 wg .Add (100 )
444437 for i := 0 ; i < 100 ; i ++ {
@@ -542,7 +535,6 @@ func TestQueueWALBlocks(t *testing.T) {
542535 return nil
543536 }))
544537 w := NewLogWriter (f , 0 , LogWriterConfig {
545- WALFsyncLatency : prometheus .NewHistogram (prometheus.HistogramOpts {}),
546538 WriteWALSyncOffsets : func () bool { return false },
547539 })
548540 const numBlocks = 1024
@@ -651,7 +643,6 @@ func TestSyncRecordGeneralized(t *testing.T) {
651643 lastSync := int64 (- 1 )
652644 cbChan := make (chan struct {}, 2 )
653645 w := NewLogWriter (f , 0 , LogWriterConfig {
654- WALFsyncLatency : prometheus .NewHistogram (prometheus.HistogramOpts {}),
655646 ExternalSyncQueueCallback : func (doneSync PendingSyncIndex , err error ) {
656647 require .NoError (t , err )
657648 require .Equal (t , lastSync + 1 , doneSync .Index )
@@ -703,7 +694,6 @@ func TestSyncRecordGeneralizedWithCloseError(t *testing.T) {
703694 lastSync := int64 (- 1 )
704695 cbChan := make (chan struct {}, 2 )
705696 w := NewLogWriter (f , 0 , LogWriterConfig {
706- WALFsyncLatency : prometheus .NewHistogram (prometheus.HistogramOpts {}),
707697 ExternalSyncQueueCallback : func (doneSync PendingSyncIndex , err error ) {
708698 if doneSync .Index == 1 {
709699 require .Error (t , err )
@@ -744,7 +734,6 @@ func TestSyncRecordGeneralizedWithCloseError(t *testing.T) {
744734func writeWALSyncRecords (t * testing.T , numRecords int , recordSizes []int ) * syncFile {
745735 f := & syncFile {}
746736 w := NewLogWriter (f , 1 , LogWriterConfig {
747- WALFsyncLatency : prometheus .NewHistogram (prometheus.HistogramOpts {}),
748737 WriteWALSyncOffsets : func () bool { return true },
749738 })
750739 var syncErr error
@@ -853,7 +842,6 @@ func BenchmarkQueueWALBlocks(b *testing.B) {
853842 return nil
854843 }))
855844 w := NewLogWriter (f , 0 , LogWriterConfig {
856- WALFsyncLatency : prometheus .NewHistogram (prometheus.HistogramOpts {}),
857845 WriteWALSyncOffsets : func () bool { return false },
858846 })
859847
@@ -886,7 +874,6 @@ func BenchmarkWriteWALBlocksAllocs(b *testing.B) {
886874 b .StopTimer ()
887875 f := vfstest .DiscardFile
888876 w := NewLogWriter (f , 0 , LogWriterConfig {
889- WALFsyncLatency : prometheus .NewHistogram (prometheus.HistogramOpts {}),
890877 ExternalSyncQueueCallback : func (doneSync PendingSyncIndex , err error ) {},
891878 WriteWALSyncOffsets : func () bool { return false },
892879 })
0 commit comments