GithubHelp home page GithubHelp logo

node-clinic-doctor-examples's Introduction

node-clinic-doctor-examples

Server examples for clinic

git clone [email protected]:nearform/node-clinic-doctor-examples.git
cd node-clinic-doctor-examples
npm install
npm install -g clinic
npm install -g autocannon

Examples

Event Loop

clinic doctor --autocannon [ / ] -- node slow-event-loop

GC

clinic doctor --autocannon [ -c 2500 / ] -- node slow-gc

I/O

clinic doctor --autocannon [ / ] -- node slow-io

Sync I/O

clinic doctor --autocannon [ / ] -- node sync-io

License

Apache 2.0

node-clinic-doctor-examples's People

Contributors

alansl avatar andreasmadsen avatar bridgear avatar conoro avatar davenportemma avatar jasnell avatar mafintosh avatar mcollina avatar trivikr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

node-clinic-doctor-examples's Issues

Bad data issue

Hi!
For this node.js file:

const {performance} = require('perf_hooks');
const {eventLoopUtilization} = require('node:perf_hooks').performance;
setImmediate(() => {
    const start = performance.now();
    const elu = eventLoopUtilization();
    let sum = 0;
    for (let i = 0; i < 1000000; i++) {
        sum += i;
    }
    const end = performance.now();
    console.log(`ELU utilization: ${eventLoopUtilization(elu).utilization}`);
    console.log(`Elapsed time: ${(end - start).toFixed(2)} milliseconds`);
}); 

I get the message Bad Data:
Doctor has found data analysis issue:
Something went wrong with the data analysis
Try running the benchmark for a longer time
If the issue persists, open an issue at https://github.com/clinicjs/node-clinic-doctor
What exactly should be the fix?

Include in the readme examples where Doctor finds no problem

This is a documentation issue only.

If/when we find some good examples of real node packages that Doctor finds no fault with, it might be list an example or two the readme so that:

  • Users can see what the data on a real-world "good" profile might look like
  • Clinic developers can easily create realistic "no recommendation" profile when testing *

For example:

npm install [email protected]
clinic-doctor -- node path/to/some-perfect-package someArgument

Existing examples with no wrk or other activity on :3000 tend to come up as io issues because Doctor is suspicious of the lack of CPU activity.

slow-gc gives I/O alert highlighting CPU graph, even before heap limit change

Running Doctor on slow-gc gives a I/O alert and flags the CPU graph (expected a Garbage Collection alert flagging the Memory graph).

Strange thing is, it's not just Doctor after 3.9.0, Do not issue the GC category if the heap is smaller than 128MB. (#213).

Using clinic doctor --autocannon [/] -- node slow-gc on the following:

Doctor v3.8.1 (last release before the above):

Create an example of a callback called recursively

Based on a discussion with Mathias, we want to see how Bubbleprof handles common patterns where a callback is being called recursively, to see how we should best treat these in terms of sums, averages and quantiles.

So some application including something like (pseudocode)

fn a (n, callback)
  if (n > 0) setTimeout(a, n--, callback)
  else callback()

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.