@@ -150,7 +150,6 @@ func TestSyncError(t *testing.T) {
150150
151151 injectedErr := errors .New ("injected error" )
152152 w := NewLogWriter (syncErrorFile {f , injectedErr }, 0 , LogWriterConfig {
153- WALFsyncLatency : prometheus .NewHistogram (prometheus.HistogramOpts {}),
154153 WriteWALSyncOffsets : func () bool { return false },
155154 })
156155
@@ -193,7 +192,6 @@ func (f *syncFile) Sync() error {
193192func TestSyncRecord (t * testing.T ) {
194193 f := & syncFile {}
195194 w := NewLogWriter (f , 0 , LogWriterConfig {
196- WALFsyncLatency : prometheus .NewHistogram (prometheus.HistogramOpts {}),
197195 WriteWALSyncOffsets : func () bool { return false },
198196 })
199197
@@ -221,7 +219,6 @@ func TestSyncRecordWithSignalChan(t *testing.T) {
221219 semChan <- struct {}{}
222220 }
223221 w := NewLogWriter (f , 0 , LogWriterConfig {
224- WALFsyncLatency : prometheus .NewHistogram (prometheus.HistogramOpts {}),
225222 QueueSemChan : semChan ,
226223 WriteWALSyncOffsets : func () bool { return false },
227224 })
@@ -273,7 +270,6 @@ func TestMinSyncInterval(t *testing.T) {
273270 WALMinSyncInterval : func () time.Duration {
274271 return minSyncInterval
275272 },
276- WALFsyncLatency : prometheus .NewHistogram (prometheus.HistogramOpts {}),
277273 WriteWALSyncOffsets : func () bool { return false },
278274 })
279275
@@ -346,7 +342,6 @@ func TestMinSyncIntervalClose(t *testing.T) {
346342 WALMinSyncInterval : func () time.Duration {
347343 return minSyncInterval
348344 },
349- WALFsyncLatency : prometheus .NewHistogram (prometheus.HistogramOpts {}),
350345 WriteWALSyncOffsets : func () bool { return false },
351346 })
352347
@@ -398,7 +393,6 @@ func TestMetricsWithoutSync(t *testing.T) {
398393 f := & syncFileWithWait {}
399394 f .writeWG .Add (1 )
400395 w := NewLogWriter (f , 0 , LogWriterConfig {
401- WALFsyncLatency : prometheus .NewHistogram (prometheus.HistogramOpts {}),
402396 WriteWALSyncOffsets : func () bool { return false },
403397 })
404398 offset , err := w .SyncRecord ([]byte ("hello" ), nil , nil )
@@ -444,10 +438,9 @@ func TestMetricsWithSync(t *testing.T) {
444438 })
445439
446440 w := NewLogWriter (f , 0 , LogWriterConfig {
447- WALFsyncLatency : syncLatencyMicros ,
448441 WriteWALSyncOffsets : func () bool { return false },
449- } ,
450- )
442+ WALFileOpHistogram : syncLatencyMicros ,
443+ } )
451444 var wg sync.WaitGroup
452445 wg .Add (100 )
453446 for i := 0 ; i < 100 ; i ++ {
@@ -551,7 +544,6 @@ func TestQueueWALBlocks(t *testing.T) {
551544 return nil
552545 }))
553546 w := NewLogWriter (f , 0 , LogWriterConfig {
554- WALFsyncLatency : prometheus .NewHistogram (prometheus.HistogramOpts {}),
555547 WriteWALSyncOffsets : func () bool { return false },
556548 })
557549 const numBlocks = 1024
@@ -662,7 +654,6 @@ func TestSyncRecordGeneralized(t *testing.T) {
662654 lastSync := int64 (- 1 )
663655 cbChan := make (chan struct {}, 2 )
664656 w := NewLogWriter (f , 0 , LogWriterConfig {
665- WALFsyncLatency : prometheus .NewHistogram (prometheus.HistogramOpts {}),
666657 ExternalSyncQueueCallback : func (doneSync PendingSyncIndex , err error ) {
667658 require .NoError (t , err )
668659 require .Equal (t , lastSync + 1 , doneSync .Index )
@@ -714,7 +705,6 @@ func TestSyncRecordGeneralizedWithCloseError(t *testing.T) {
714705 lastSync := int64 (- 1 )
715706 cbChan := make (chan struct {}, 2 )
716707 w := NewLogWriter (f , 0 , LogWriterConfig {
717- WALFsyncLatency : prometheus .NewHistogram (prometheus.HistogramOpts {}),
718708 ExternalSyncQueueCallback : func (doneSync PendingSyncIndex , err error ) {
719709 if doneSync .Index == 1 {
720710 require .Error (t , err )
@@ -755,7 +745,6 @@ func TestSyncRecordGeneralizedWithCloseError(t *testing.T) {
755745func writeWALSyncRecords (t * testing.T , numRecords int , recordSizes []int ) * syncFile {
756746 f := & syncFile {}
757747 w := NewLogWriter (f , 1 , LogWriterConfig {
758- WALFsyncLatency : prometheus .NewHistogram (prometheus.HistogramOpts {}),
759748 WriteWALSyncOffsets : func () bool { return true },
760749 })
761750 var syncErr error
@@ -864,7 +853,6 @@ func BenchmarkQueueWALBlocks(b *testing.B) {
864853 return nil
865854 }))
866855 w := NewLogWriter (f , 0 , LogWriterConfig {
867- WALFsyncLatency : prometheus .NewHistogram (prometheus.HistogramOpts {}),
868856 WriteWALSyncOffsets : func () bool { return false },
869857 })
870858
@@ -897,7 +885,6 @@ func BenchmarkWriteWALBlocksAllocs(b *testing.B) {
897885 b .StopTimer ()
898886 f := vfstest .DiscardFile
899887 w := NewLogWriter (f , 0 , LogWriterConfig {
900- WALFsyncLatency : prometheus .NewHistogram (prometheus.HistogramOpts {}),
901888 ExternalSyncQueueCallback : func (doneSync PendingSyncIndex , err error ) {},
902889 WriteWALSyncOffsets : func () bool { return false },
903890 })
0 commit comments