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
gops does not validate time duration parameter #154
Comments
@el10savio thanks for the report. I think it'd make sense to fix this. Want to open a PR? |
Thanks @tklauser. Sure, I can pick it up :) |
tklauser
added a commit
that referenced
this issue
Jul 7, 2022
The change in #154 lead to the CPU usage being reported for a 0s duration: cpu usage (0s): NaN% Fix this by only reporting CPU usage per period if the user specified a positive duration.
tklauser
added a commit
that referenced
this issue
Jul 7, 2022
The change in #154 lead to the CPU usage being reported for a 0s duration: cpu usage (0s): NaN% Fix this by only reporting CPU usage per period if the user specified a positive duration.
tklauser
added a commit
that referenced
this issue
Jul 8, 2022
The change in #154 lead to the CPU usage being reported for a 0s duration: cpu usage (0s): NaN% Fix this by only reporting CPU usage per period if the user specified a positive duration.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It looks like gops does not validate the input time duration parameter & defaults to 0 for invalid inputs. When testing out the hello world example adding values such as
0,-1,1.2,..
defaults to 0 and does not return an error as shown below.This is a very minor issue but would be helpful to fix to validate the user's input. It looks like this line here is not validating the returned values from
period, err = time.ParseDuration(os.Args[2])
The text was updated successfully, but these errors were encountered: