question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Make sure metric handlers are fired first

See original GitHub issue

Hi,

I noticed that since event handlers are invoked at the order of their insertion, there’s a potential bug- if a metric handler is inserted after a TensorBoard handler, the metric value will not be ready at the time of writing.

While this has only minor effects (one epoch shift in the results), I think it can be easily solved by one of two approaches:

  1. separating handlers list to two: one for metrics, and the other handler types.
  2. More generic and scalable- allowing users to decide the order of execution by adding priority argument to add_event_handler (default would be that metric handlers are inserted with higher priority) and then sort the list when run() is invoked.

Let me know if you like any of the ideas, and I’d be happy to draft a PR

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:1
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
justusschockcommented, Jan 24, 2020

I think this is a general question. We should decide, whether we want priorities/sorting of handlers or not (but definitely not support both versions).

If we implement it, it should always be used, but this may also introduce unwanted behaviour if some handlers are for example added by an internal function with a different priority, this may also confuse the user, since he might expect some other behaviour.

I think, I slightly prefer the way including priorities, but this has to be carefully implemented. On the implementation side, I would prefer to have the priority option not in the function adding the handler but as an attribute of the handler (comparable to the logging level in python’s internal logging module).

0reactions
justusschockcommented, Feb 2, 2020

Yes it requires a new handler class but also some code that allows all current handler implementations to continue working by providing good defaults and wrapping possibilities

Read more comments on GitHub >

github_iconTop Results From Across the Web

The Order of Multiple Event Listeners - Stack Overflow
The order in which event handlers are fired was not guaranteed by the DOM events stuff originally (but keep reading). From the DOM2...
Read more >
Apollo Server plugin event reference - Apollo GraphQL Docs
This helps you make sure all of your server's dependencies are available before attempting to begin serving requests. This event is fired at...
Read more >
Event listeners not working? 3 key areas to troubleshoot
Are your event listeners not working as you'd expect? Here are 3 key areas to troubleshoot to help you get everything triggering as...
Read more >
Towards a better responsiveness metric - web.dev
We want to make sure our metric captures the full amount of time a user has to wait for a response when tapping,...
Read more >
21 Employee Performance Metrics - AIHR
As a side-note: when you have selected your relevant metrics, make sure to include them in a tactical HR dashboard or in your...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found