Skip to content
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

Merged
merged 4 commits into from
Mar 20, 2017

Conversation

sihuihan88
Copy link
Contributor

No description provided.

Sihui Han added 3 commits March 15, 2017 23:31
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)
Copy link
Contributor

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
Copy link
Contributor

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):
Copy link
Contributor

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)
Copy link
Contributor

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?

Copy link
Contributor

@lguohan lguohan left a 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>
@lguohan
Copy link
Contributor

lguohan commented Mar 18, 2017

can you make sure the existing portstat -c, portstat works

@jleveque jleveque merged commit 4da9efe into sonic-net:master Mar 20, 2017
@jleveque
Copy link
Contributor

@sihuihan88: I merged this PR. Please update the sonic-utilities submodule pointer in sonic-buildimage to reference this.

@sihuihan88 sihuihan88 deleted the portstat branch March 20, 2017 22:20
vdahiya12 pushed a commit to vdahiya12/sonic-utilities that referenced this pull request Jul 23, 2021
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>
mihirpat1 pushed a commit to mihirpat1/sonic-utilities that referenced this pull request Sep 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants