-
Notifications
You must be signed in to change notification settings - Fork 35
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
Adding command requests_per_hour #34
Conversation
ca13b48
to
ba3eb5f
Compare
Refactored the time calculation function to be more dynamic
ba3eb5f
to
d95967f
Compare
minutes=tm.minute % aggregate, | ||
seconds=tm.second, | ||
microseconds=tm.microsecond, | ||
) |
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.
@valleedelisle would you mind explaining the logic of this adding and removing? 🤔 I get the seconds and microseconds removal, as to zero them, but the aggregate
puzzles me a little bit.
I was playing with the request_per_minute.log
file and I see that what counts as a request that belongs to a minute goes from the half a minute before to the half a minute after, i.e.
Requests logged starting from 12:12:30
until 12:13:29
will all belong to 12:13:0
minute. Is what you expected to do?
At least, we could mention that it is not bound to the exact minute/hour to avoid users getting confused?
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.
@gforcada I based this part from this stackoverflow question. You're right when you say that :30
to :29
are going to be in the same minute. I didn't realize it would change the actual behavior maybe it would be better to keep the same behavior. The reason why I picked this is because we can pass any number of minutes to round up/down to.
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.
No actually it is fine, usually when I found solutions via stackoverflow I put a comment on top with the link to it, so one does not need lengthy explanations 👍
@valleedelisle thanks for the pull request! 💯 I would like to get a comment on the logic of it, but otherwise it looks good! 👍 |
@valleedelisle sorry I made a new release of haproxy_log_analysis with a complete rewrite of the commands and the main logic. Sadly this means that this pull request can no longer be merged as it is 😞 On the up side, the commands now are more easier to write and perform much better 👍 I can try to recreate your additions here on a new pull request adapted to the new code base. Would it be ok with you? 🤔 |
@gforcada Nice! I'll look into this, thanks for maintaining this project. Honestly, I was able to achieve what I had to do and extract the stats I needed so I kind of lost interest into this for now. Feel free to take what I did and adapt it however you think it fits best. Thanks again for the great job! |
Done at #36 |
Refactored the time calculation function to be more dynamic