-
Notifications
You must be signed in to change notification settings - Fork 684
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Portstat]: Add -p option to support portstat timer #16
Conversation
Signed-off-by: Sihui Han <sihan@microsoft.com>
Signed-off-by: Sihui Han <sihan@microsoft.com>
Signed-off-by: Sihui Han <sihan@microsoft.com>
scripts/portstat
Outdated
""") | ||
parser.add_argument('-c', '--clear', action='store_true', help='Copy & clear stats') | ||
parser.add_argument('-d', '--delete', action='store_true', help='Delete saved stats, either the uid or the specified tag') | ||
parser.add_argument('-D', '--delete-all', action='store_true', help='Delete all saved stats') | ||
parser.add_argument('-j', '--json', action='store_true', help='Display in JSON format') | ||
parser.add_argument('-r', '--raw', action='store_true', help='Raw stats (unmodified output of netstat)') | ||
parser.add_argument('-t', '--tag', type=str, help='Save stats with name TAG', default=None) | ||
parser.add_argument('-p', '--period', type=int, help='Get the portstat within Period seconds', default=0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make the help message clearer. Something like, "Display stats over a specified period (in seconds)."
scripts/portstat
Outdated
else: | ||
cnstat_print(cnstat_dict, use_json) | ||
else: | ||
#wait for sometime and output the result |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"# Wait for the specified duration then gather new stats and output the difference"
scripts/portstat
Outdated
@@ -204,6 +205,76 @@ def parse_bcmcmd_ps(bcmcmd_output): | |||
bcmcmd_lines = bcmcmd_output.split("\n") | |||
|
|||
|
|||
def get_cnstat(cnstat_dir): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it does not look the cnstat_dir is really used in this function, can you remove this argument?
scripts/portstat
Outdated
os.makedirs(cnstat_dir) | ||
except IOError as e: | ||
print e.errno, e | ||
sys.exit(1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here you only create a folder, but you do not use it anyway in the function. what's the purpose here? should we move it to some where else?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as comments
Signed-off-by: Sihui Han <sihan@microsoft.com>
can you make sure the existing portstat -c, portstat works |
@sihuihan88: I merged this PR. Please update the sonic-utilities submodule pointer in sonic-buildimage to reference this. |
Otherwise ledd ignores signals other than SIGKILL making impossible to use __del__() destructors in LedClass implementations and delays pmon docker container shutdown up to 10s. Signed-off-by: Sergey Popovich <sergey.popovich@ordnance.co>
This reverts commit 3b1f0ef.
No description provided.