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

feat: add devtools metrics #2551

Merged
merged 25 commits into from
May 28, 2024
Merged

feat: add devtools metrics #2551

merged 25 commits into from
May 28, 2024

Conversation

achingbrain
Copy link
Member

@achingbrain achingbrain commented May 17, 2024

Adds a metrics implementation that is scrapable by a browser DevTools plugin.

Change checklist

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation if necessary (this includes comments as well)
  • I have added tests that prove my fix is effective or that my feature works

@achingbrain achingbrain requested a review from a team as a code owner May 17, 2024 16:34
@achingbrain achingbrain force-pushed the feat/add-devtools-metrics branch 9 times, most recently from b9c1be8 to ad33b41 Compare May 18, 2024 07:40
Adds a metrics implementation that broadcasts metrics to a browser
DevTools plugin.
Copy link
Member

@maschad maschad left a comment

Choose a reason for hiding this comment

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

Awesome 🚀

Copy link
Member

@SgtPooki SgtPooki left a comment

Choose a reason for hiding this comment

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

this is so great. We should have a demo site/video linked in README so we can show how this works.

@2color
Copy link
Contributor

2color commented May 21, 2024

Sweet!

When trying this out using the following libp2p config, I get the following error:

TypeError: Cannot read properties of undefined (reading 'update')
    at TrackedMap.updateComponentMetric (tracked-map.ts:38:17)
    at new TrackedMap (tracked-map.ts:17:10)
    at trackedMap (tracked-map.ts:59:11)
    at new DefaultTransportManager (transport-manager.ts:33:22)
    at new Libp2pNode (libp2p.ts:118:49)
    at createLibp2pNode (libp2p.ts:418:10)
    at async createLibp2p (index.ts:167:16)
    at async App (index.js:50:18)

Do you know what might be the reason?

@achingbrain
Copy link
Member Author

Do you know what might be the reason?

I think you may be using the placeholder version published to npm. You'll need to replace the src and dist folders in /node_modules/libp2p/devtools-metrics with versions built from this PR branch for it to work.

@achingbrain achingbrain merged commit 7464dc0 into main May 28, 2024
24 checks passed
@achingbrain achingbrain deleted the feat/add-devtools-metrics branch May 28, 2024 07:50
@achingbrain achingbrain mentioned this pull request May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants