Skip to content

Commit

Permalink
reset op start time
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Vaillancourt <[email protected]>
  • Loading branch information
timvaillancourt committed Dec 10, 2024
1 parent 2f1e599 commit 7ae2b14
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions go/vt/topo/stats_conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ func (st *StatsConn) ListDir(ctx context.Context, dirPath string, full bool) ([]
}
defer st.readSem.Release(1)
topoStatsConnReadWaitTimings.Record(statsKey, startTime)
startTime = time.Now() // reset
defer topoStatsConnTimings.Record(statsKey, startTime)
res, err := st.conn.ListDir(ctx, dirPath, full)
if err != nil {
Expand Down Expand Up @@ -125,6 +126,7 @@ func (st *StatsConn) Get(ctx context.Context, filePath string) ([]byte, Version,
}
defer st.readSem.Release(1)
topoStatsConnReadWaitTimings.Record(statsKey, startTime)
startTime = time.Now() // reset
defer topoStatsConnTimings.Record(statsKey, startTime)
bytes, version, err := st.conn.Get(ctx, filePath)
if err != nil {
Expand All @@ -143,6 +145,7 @@ func (st *StatsConn) GetVersion(ctx context.Context, filePath string, version in
}
defer st.readSem.Release(1)
topoStatsConnReadWaitTimings.Record(statsKey, startTime)
startTime = time.Now() // reset
defer topoStatsConnTimings.Record(statsKey, startTime)
bytes, err := st.conn.GetVersion(ctx, filePath, version)
if err != nil {
Expand All @@ -161,6 +164,7 @@ func (st *StatsConn) List(ctx context.Context, filePathPrefix string) ([]KVInfo,
}
defer st.readSem.Release(1)
topoStatsConnReadWaitTimings.Record(statsKey, startTime)
startTime = time.Now() // reset
defer topoStatsConnTimings.Record(statsKey, startTime)
bytes, err := st.conn.List(ctx, filePathPrefix)
if err != nil {
Expand Down

0 comments on commit 7ae2b14

Please sign in to comment.