-
Notifications
You must be signed in to change notification settings - Fork 0
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
API re-design #52
API re-design #52
Conversation
Add total time and events count. Add gc flags when supported.
Start the work on redesign doc metrics to carry state. Attach cpu metric on doc instance. Change the `data` event to `sample`. Don't pass arguments to the event. BREAKING CHANGE: the cpu metric is not exposed anymore to the event handler, but it is attached to the Doc instance. The event name is changed from `data` to `sample`.
Attach metric to Doc instance to expose its API to the user, as done with the cpu. BREAKING CHANGE: the eventLoopDelay metric is not exposed anymore to the event handler, but it is attached to the Doc instance.
Expose the metric directly from the Doc instance. BREAKING CHANGE: the metric is not exposed to the event handler anymore, but it is attached directly to the Doc instance.
Attach memory and activeHandles to Doc instance. Add config options to manually start metrics collection and ref the underlying timer.
Export types without using a namespace. BREAKING CHANGE: types are not accessible using `Doc.` notation. `DocInstance` has been renamed to `Doc` and declared as a class.
@acheronfail I changed many things in the types definitions, not sure if I messed them up. I removed the namespace and exported both a default factory function and the |
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.
The new changes look great! Very excited.
Just a few comments here and there on the types, but mostly good. 🙂
@acheronfail I should have addressed your suggestions. Thank you. Could you take another look? |
Expose a `compute` method to allow the user to compute other values from the event loop delay histogram.
Rename the Doc class to Sampler. BREAKING CHANGE: the exported class is named Sampler and not Doc anymore
Align tests with the last refactor.
All looks good to me mate 👍 Very excited about these changes. 🚀 |
Align symbols names of the Sampler. Change descriptions to follow Node.js standard. See https://github.com/nodejs/node/blob/master/doc/guides/using-symbols.md
acdbee1
to
decca27
Compare
Write the readme from the ground up to reflect the API changes.
To add some new features, deal with the stateful nature of the eventLoopDelay Histogram and give the user more ways to extract data from the collected metrics, I decided to re-design the whole API of the module.
TODO:
data
tosample