Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions scripts/portstat
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ Examples:
if os.path.isfile(cnstat_fqn_file):
try:
cnstat_cached_dict = json.load(open(cnstat_fqn_file, 'r'))
if not detail:
if not use_json and not detail:
print("Last cached time was " + str(cnstat_cached_dict.get('time')))
portstat.cnstat_diff_print(cnstat_dict, cnstat_cached_dict, ratestat_dict,
intf_list, use_json, print_all, errors_only,
Expand All @@ -169,7 +169,8 @@ Examples:
else:
#wait for the specified time and then gather the new stats and output the difference.
time.sleep(wait_time_in_seconds)
print("The rates are calculated within %s seconds period" % wait_time_in_seconds)
if not use_json:
print("The rates are calculated within %s seconds period" % wait_time_in_seconds)
cnstat_new_dict, ratestat_new_dict = portstat.get_cnstat_dict()
portstat.cnstat_diff_print(cnstat_new_dict, cnstat_dict, ratestat_new_dict,
intf_list, use_json, print_all, errors_only,
Expand Down
Loading