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

myclitools

v1.0.0

Published

MemMonitor is a node library based on Puppeteer which provides means to control Google chrome/chromium over DevTools protocols. The current implementation logs in to the MS Teams app and performs profiling as per the developer instructions in Config.jso

Downloads

4

Readme

MemMonitor

MemMonitor is a node library based on Puppeteer which provides means to control Google chrome/chromium over DevTools protocols. The current implementation logs in to the MS Teams app and performs profiling as per the developer instructions in Config.json file.

Input

MemMonitor accepts input in the form of config.json file. Example config.json

{
"scenarioEvents" : ["Files","OneDrive"] , "leakEvents" : ["Files", "Calendar"], "leakIterations" : 5, "analysisType" : "devDriven", "URL" : "https://teams.microsoft.com", "username" : "-", "password" : "-", "coreClasses" : ["SimpleFileEntity","FilesListController"] }

  • scenarioEvents : Sequence of events that will be executed as part of this test. In the above example, ["Files", "OneDrive"] imply that puppeteer will click on "Files" followed by "oneDrive" automatically. Undefined/null - imply that user will manually perform these events on the webpage.
  • leakEvents : These events will be performed in a repetitive manner (leakIterations number of times) to detect memory leaks present if any.
  • analysisType : This can take two values devDriven/testDriven; and these values imply following
    • devDriven : imply that hooks are inserted in the source code and accordingly snapshots will be captured. hooks in the form of //console.timeStamp("componentWillMount")
    • testDriven :
      imply that timeStamp hooks are inserted in the test case (integration is not yet done)
  • URL : URL of the webpage that needs to be tested
  • username, password : login details of the above URL
  • coreClasses : These classes will be monitored.

How to run?

$ cd memMonitor
$ npm install 
$ npm run remove //cleans up the previous profiles
$ npm run start

Output

Opens a Google chrome browser with multiple tabs as per following details : #First Tab:

Opens the Teams app, and performs all the events as per config.json automatically.

#Second Tab: alt text

Opens results.html with analysis data (See the sample output.png): 
-   Test details : brief summary of the test details in config.json
-   Memory analysis table : State 1 corresponds to the Teams homepage, additional states are created for each event in the scenarioEvents(config.json). For each state, a heap snapshot is computed. These snapshots are present in ./memoryProfiles folder with suffix snapshot_{stateid}.json. This table also shows the JSHeapTotalSize, JSHeapUsedSize and DOM nodes pertaining to that state. 
-  {click here to get trace file} : trace.json file which stores the end-to-end performance profile when running scenarioEvents(config.json). One can upload this file to performance tab and analyse the corresponding profile. 
- Memory leak analysis table : tool executes leakEvents(config.json) repeatedly for iterations(#leakIterations) and computes metrics pertaining to JSHeapTotalSize and JSHeapUsedSize. DOM nodes are also computed.
- core classes analysis table : shows the heap difference between two states (selected from memory analysis table) for the core classes that developer mentioned in config.json
- Heap Snapshot comparison : shows the heap difference between two states (selected from memory analysis table) for all the objects. One can select on the column header and sort the table accordingly.

Snapshot difference for different states can be computed on demand by selecting any two states from memory analysis table. ComputeDiff button will compute the diff and store in ./memoryProfiles folder with heapDiffSnapshot_{state1}_{state2}.json as file name.One can upload this file using "choose file", this will update the data present in core classes analysis and Heap snapshot comparison table accordingly.

Todos

  • Handle destroy of react component
  • Integrate with react bridge
  • Integrate with scenario tests