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

Add stats parsing for honggfuzz. #1180

Merged
merged 2 commits into from
Nov 11, 2019
Merged

Add stats parsing for honggfuzz. #1180

merged 2 commits into from
Nov 11, 2019

Conversation

oliverchang
Copy link
Collaborator

Part of #1128

@googlebot googlebot added the cla: yes CLA signed. label Nov 8, 2019
@oliverchang
Copy link
Collaborator Author

/gcbrun

Copy link
Collaborator

@inferno-chromium inferno-chromium left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

stats = {}

for part in parts:
key, value = part.split(':', 2)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we bail out if ':' not in part ? just to avoid exception, maybe log_error ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

try:
stats[key] = int(value)
except (ValueError, TypeError):
logs.log_error('Invalid stat value', value=value)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

end with period, add key=key in arguments too.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

break
stats = _get_stats(line)

if stats is None:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you need to initialize stats var too, otherwise can end up with var not defined.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

@oliverchang
Copy link
Collaborator Author

/gcbrun

@oliverchang oliverchang merged commit a8635ec into master Nov 11, 2019
@oliverchang oliverchang deleted the honggfuzz_stats branch November 15, 2019 02:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes CLA signed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants