-
Notifications
You must be signed in to change notification settings - Fork 17
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
Chore/implement global max trace items #89
Chore/implement global max trace items #89
Conversation
Looking good, thanks for the fix! I have nothing really to add, looking forward to the PR 👍 |
I think this is ready. I'd like to spend time on the event collectors, but that's better done in separate PRs. I see there is a new failing check for styleci, but I get a 404 when I try to view the details for it. What needs to be done for that to pass? |
My spider sense tells me that if you push anything to this branch this check won't be triggered any more. I think @arkaitzgarro disabled it for now. |
Yes, I disabled it. I wanted to know if the Laravel preset was linting variable cases, but it didn't. Looks like an interesting service though, will take a look in the future. |
1c62d5d
to
4e2befe
Compare
That's a good opportunity fix a typo in the README and clean up the commits. All is good now. |
@arkaitzgarro This should be ready now if it looks good to you. |
4e2befe
to
c69ea15
Compare
I rebased on to master and fixed a unit test impacted by my changes. |
7d789e8
to
07d01c8
Compare
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.
Changes are looking good, some tests need to be updated though. We added missing tests for collectors, but in this PR the EventDataCollector
class constructor expects 5 parameters instead of 3. Could you update the broken tests? We can merge it right after.
How about I rebase this branch onto master again and see how it looks? I think that might be better than merging master into the branch. I have a little bit of time now to look at it. |
This led to some work on testing the EventCollector abstract class and adding an EventClock to enable controlling time.
This required adding a private EventCollector::pushMeasure() method for addMeasure and stopMeasure to use when the limit has not been exceeded.
c3bd82f
to
8397db2
Compare
My apologies. I saw the some of the other branches being merged and began making the fixes for the new Collector tests on this branch. That caused the conflicts you experienced. I rebased on to the latest master, cleaned up the tests and force pushed. All the Collector tests are working now. |
Closes #85
This took a little more work than I expected, but I think it covers the expected use cases. I'm still looking at EventCollector tests and want to make note about some behaviors in the docs. I wanted to get this out as a draft, though.
I replaced the
CustomCollectorTest
withEventDataCollectorTest
. The original test did not seem to be actually testing a "custom" collector, just using it as a way to test the abstractEventDataCollector
. I believe this approach is more explicit and obvious.The use of the
microtime()
function makes testing difficult, so I added anEventClock
class which is injected where needed and will provide the time.The one caveat to how the item limit works relates to when events are added. If a collector were to collect events during the request, but only call
addMeasure()
at the end of the request, the events may not be collected even if they occurred earlier in the transaction. (This is how the original philkra Laravel package handled DB queries for example.) I don't know that anyone will ever run into this, but I want to figure out how to explain it in the docs just in case.