Skip to content

Commit 4bfcb20

Browse files
rdemellowdaverigby
authored andcommitted
MB-47109: Fix cbstats from crashing due to 'ep_tasks:uptime_s'
Stat 'ep_tasks:uptime_s' was removed in commit de9b8c1. This causes cbstats to crash as it tried to access the stat in the data it received for 'tasks'. To fix this crash, remove the accessing of 'ep_tasks:uptime_s' and its printing as part of the tasks data. This will be compatible with mad-hatter/CC server versions. But will not print the up time. Change-Id: Ic98ae99d2b93903ad9bd8f2d04b7b0f3c227cd49 Reviewed-on: http://review.couchbase.org/c/kv_engine/+/156704 Tested-by: Richard de Mellow <[email protected]> Reviewed-by: Dave Rigby <[email protected]>
1 parent 23814eb commit 4bfcb20

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

engines/ep/management/cbstats

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,6 @@ def tasks_stats_formatter(stats, sort_by=None, reverse=False, *args):
162162
stats_formatter(stats)
163163
else:
164164
cur_time = int(stats.pop("ep_tasks:cur_time"))
165-
uptime = datetime.timedelta(
166-
seconds=int(stats.pop("ep_tasks:uptime_s")))
167165

168166
total_tasks = {"Reader":0,
169167
"Writer":0,
@@ -208,11 +206,10 @@ def tasks_stats_formatter(stats, sort_by=None, reverse=False, *args):
208206
total_tasks["Total"] = len(tasks)
209207

210208
headers = (
211-
"Tasks Writer Reader AuxIO NonIO Total"
212-
" Uptime: {uptime}\n"
209+
"Tasks Writer Reader AuxIO NonIO Total \n"
213210
"Running {Writer:<6} {Reader:<6} "
214211
"{AuxIO:<6} {NonIO:<6} {Total:<6}\n"
215-
.format(uptime=uptime, **running_tasks) +
212+
.format(**running_tasks) +
216213
"All {Writer:<6} {Reader:<6} "
217214
"{AuxIO:<6} {NonIO:<6} {Total:<6}\n"
218215
.format(**total_tasks)

0 commit comments

Comments
 (0)