npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

graphql-perf

v0.0.1

Published

Gather performance information from GraphQL resolve methods and prepare JSON in Trace Event Format for Chrome Devtools Timeline

Downloads

2

Readme

graphql-perf

Gather performance information from GraphQL resolve methods and prepare JSON in Trace Event Format for Chrome Devtools Timeline.

Current plans/aims/thoughts

  • VIEW: responsive timeline graphics in Google Chrome Devtools
    • just click a link in browser console or press a button in extension
    • you will measure only current request
    • no need to setup special server or buy a subscription, eg. Apollo Optics
    • if you need aggregated statistics use Apollo Optics 😉
  • SERVER: should work with any GraphQL Schema under nodejs
    • but if schema built with https://github.com/nodkz/graphql-compose-mongoose (and other graphql-compose libs) will have additional profiling info
    • should have api that allows other libs to provide extended perf metrics
    • will integrate it with express-graphql
    • but also may be integrated with apollo-server and others
  • CLIENT: should have link, button, extension that open Devtools Timeline
    • perf data will be in the json-response from graphql server under extensions.perf path in it.
    • will integrate it with https://github.com/nodkz/react-relay-network-layer
    • so needs help in passing this data to Devtools Timeline (some link or chrome extension) or some another way.
  • OTHER SERVERS:
    • maybe somebody writes for other languages similar perf export in Trace Event Format under extensions.perf path in graphql response.

I'll try to start it at the end of November/December. Too much work right now.

Did you have experience with Trace Event Format? Or maybe want help? Or start to develop such thing right now? Or maybe can recommend additional sources/articles? Feel free to open issue. Will be glad to any help and thoughts.

How it should work under the hood

This package should traverse by types and fields (of provided GraphQL Schema instance) wraps all resolvers and return new wrapped Schema in build phase (when nodejs starts your server). After that for every request, when server gets ?perf=1 param (or some other key in headers) it will pass wrapped schema to graphql-express, otherwise for regular users your initial schema for performance reasons. It will be safe to use it in production, without losing performance. Gathered trace information should be written to the GraphQL response extensions.perf key in the Trace Event Format.

Useful links

Cybersquatting

I'm reserved graphql-perf name in npmjs, cause think that only such module may have so brave name. 😉

PS. I with pleasure free this name, if somebody made the same module or even better, until I began to develop.