@@ -1431,7 +1431,7 @@ func (d *DB) maybeScheduleDelayedFlush(tbl *memTable, dur time.Duration) {
14311431 if mem == nil || mem .flushForced {
14321432 return
14331433 }
1434- deadline := d .timeNow ().Add (dur )
1434+ deadline := d .opts . private . timeNow ().Add (dur )
14351435 if ! mem .delayedFlushForcedAt .IsZero () && deadline .After (mem .delayedFlushForcedAt ) {
14361436 // Already scheduled to flush sooner than within `dur`.
14371437 return
@@ -1720,7 +1720,7 @@ func (d *DB) flush1() (bytesFlushed uint64, err error) {
17201720 d .mu .versions .latest .l0Organizer ,
17211721 d .mu .versions .picker .getBaseLevel (),
17221722 d .mu .mem .queue [:n ],
1723- d .timeNow (),
1723+ d .opts . private . timeNow (),
17241724 d .shouldCreateShared (0 ),
17251725 d .determineCompactionValueSeparation ,
17261726 )
@@ -1738,7 +1738,7 @@ func (d *DB) flush1() (bytesFlushed uint64, err error) {
17381738 }
17391739 d .opts .EventListener .FlushBegin (info )
17401740
1741- startTime := d .timeNow ()
1741+ startTime := d .opts . private . timeNow ()
17421742
17431743 var ve * manifest.VersionEdit
17441744 var stats compact.Stats
@@ -1758,7 +1758,7 @@ func (d *DB) flush1() (bytesFlushed uint64, err error) {
17581758 if c .kind == compactionKindIngestedFlushable {
17591759 ve , err = d .runIngestFlush (c )
17601760 }
1761- info .Duration = d .timeNow ().Sub (startTime )
1761+ info .Duration = d .opts . private . timeNow ().Sub (startTime )
17621762 if err != nil {
17631763 return versionUpdate {}, err
17641764 }
@@ -1885,7 +1885,7 @@ func (d *DB) flush1() (bytesFlushed uint64, err error) {
18851885 info .Err = errEmptyTable
18861886 }
18871887 info .Done = true
1888- info .TotalDuration = d .timeNow ().Sub (startTime )
1888+ info .TotalDuration = d .opts . private . timeNow ().Sub (startTime )
18891889 d .opts .EventListener .FlushEnd (info )
18901890
18911891 // The order of these operations matters here for ease of testing.
@@ -2280,7 +2280,7 @@ func (d *DB) tryScheduleDeleteOnlyCompaction() bool {
22802280 d .mu .compact .deletionHints = unresolvedHints
22812281
22822282 if len (inputs ) > 0 {
2283- c := newDeleteOnlyCompaction (d .opts , v , inputs , d .timeNow (), resolvedHints , exciseEnabled )
2283+ c := newDeleteOnlyCompaction (d .opts , v , inputs , d .opts . private . timeNow (), resolvedHints , exciseEnabled )
22842284 d .mu .compact .compactingCount ++
22852285 d .mu .compact .compactProcesses ++
22862286 c .AddInProgressLocked (d )
@@ -2635,7 +2635,7 @@ func (d *DB) compact(c compaction, errChannel chan error) {
26352635 // must be atomic with the above removal of c from
26362636 // d.mu.compact.InProgress to ensure Metrics.Compact.Duration does not
26372637 // miss or double count a completing compaction's duration.
2638- d .mu .compact .duration += d .timeNow ().Sub (c .BeganAt ())
2638+ d .mu .compact .duration += d .opts . private . timeNow ().Sub (c .BeganAt ())
26392639 }()
26402640 // Done must not be called while holding any lock that needs to be
26412641 // acquired by Schedule. Also, it must be called after new Version has
@@ -2737,12 +2737,12 @@ func (d *DB) cleanupVersionEdit(ve *manifest.VersionEdit) {
27372737func (d * DB ) compact1 (jobID JobID , c * tableCompaction ) (err error ) {
27382738 info := c .makeInfo (jobID )
27392739 d .opts .EventListener .CompactionBegin (info )
2740- startTime := d .timeNow ()
2740+ startTime := d .opts . private . timeNow ()
27412741
27422742 ve , stats , outputBlobs , err := d .runCompaction (jobID , c )
27432743
27442744 info .Annotations = append (info .Annotations , c .annotations ... )
2745- info .Duration = d .timeNow ().Sub (startTime )
2745+ info .Duration = d .opts . private . timeNow ().Sub (startTime )
27462746 if err == nil {
27472747 validateVersionEdit (ve , d .opts .Comparer .ValidateKey , d .opts .Comparer .FormatKey , d .opts .Logger )
27482748 _ , err = d .mu .versions .UpdateVersionLocked (func () (versionUpdate , error ) {
@@ -2799,7 +2799,7 @@ func (d *DB) compact1(jobID JobID, c *tableCompaction) (err error) {
27992799 d .mu .versions .incrementCompactions (c .kind , c .extraLevels , c .metrics .bytesWritten .Load (), err )
28002800 d .mu .versions .incrementCompactionBytes (- c .metrics .bytesWritten .Load ())
28012801
2802- info .TotalDuration = d .timeNow ().Sub (c .metrics .beganAt )
2802+ info .TotalDuration = d .opts . private . timeNow ().Sub (c .metrics .beganAt )
28032803 d .opts .EventListener .CompactionEnd (info )
28042804
28052805 // Update the read state before deleting obsolete files because the
0 commit comments