Skip to content

Commit

Permalink
better stat name
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>
  • Loading branch information
timvaillancourt committed Dec 10, 2024
1 parent a5051cf commit eb4a624
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions go/vt/topo/stats_conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ var (
"TopologyConnOperations timings",
[]string{"Operation", "Cell"})

topoStatsConnWaitTimings = stats.NewMultiTimings(
"TopologyConnWaits",
"TopologyConnWait timings",
[]string{"Operation", "Cell"})

topoStatsConnErrors = stats.NewCountersWithMultiLabels(
"TopologyConnErrors",
"TopologyConnErrors errors per operation",
[]string{"Operation", "Cell"})

topoStatsReadWaitTimings = stats.NewMultiTimings(
"TopologyReadWaits",
"TopologyReadWait timings",
[]string{"Operation", "Cell"})
)

const readOnlyErrorStrFormat = "cannot perform %s on %s as the topology server connection is read-only"
Expand Down Expand Up @@ -74,7 +74,7 @@ func (st *StatsConn) ListDir(ctx context.Context, dirPath string, full bool) ([]
return nil, err
}
defer st.readSem.Release(1)
topoStatsConnWaitTimings.Record(statsKey, startTime)
topoStatsReadWaitTimings.Record(statsKey, startTime)
defer topoStatsConnTimings.Record(statsKey, startTime)
res, err := st.conn.ListDir(ctx, dirPath, full)
if err != nil {
Expand Down Expand Up @@ -124,7 +124,7 @@ func (st *StatsConn) Get(ctx context.Context, filePath string) ([]byte, Version,
return nil, nil, err
}
defer st.readSem.Release(1)
topoStatsConnWaitTimings.Record(statsKey, startTime)
topoStatsReadWaitTimings.Record(statsKey, startTime)
defer topoStatsConnTimings.Record(statsKey, startTime)
bytes, version, err := st.conn.Get(ctx, filePath)
if err != nil {
Expand All @@ -142,7 +142,7 @@ func (st *StatsConn) List(ctx context.Context, filePathPrefix string) ([]KVInfo,
return nil, err
}
defer st.readSem.Release(1)
topoStatsConnWaitTimings.Record(statsKey, startTime)
topoStatsReadWaitTimings.Record(statsKey, startTime)
defer topoStatsConnTimings.Record(statsKey, startTime)
bytes, err := st.conn.List(ctx, filePathPrefix)
if err != nil {
Expand Down

0 comments on commit eb4a624

Please sign in to comment.