@trace-it/cli

CLI tool related to trace-it

Usage no npm install needed!

<script type="module">
  import traceItCli from 'https://cdn.skypack.dev/@trace-it/cli';
</script>

README

trace-it-cli

:clock1: CLI Tool for Trace-it :mag_right:

Release npm (scoped) NPM npm

This package provides some cli tools for the performance measuring tool trace-it.

INTALLATION

The cool thing with npx (and this tool) is: You do not have to install it! You can simply run it by calling npx @trace-it/cli <command> and npx will do the rest. If you want to install it (to use a specific version or similar) you can also install it:

# locally
npm install @trace-it/cli --save-dev

# or
# global
npm install @trace-it/cli --global

USAGE

You can print the whole USAGE instractions by calling npx @trace-it/cli --help. In general you can append --help after each command.

This cli tool provides two base commands: analyze and clear:

:chart_with_upwards_trend: Analyze

To call the analyzation features do the following:

npx @trace-it/cli analyze --help
USAGE: npx @trace-it/cli analyze <OPTIONS>

MANDATORY OPTIONS:
    --driver            The storage driver ('lowdb' or 'mongodb').
    --dbName            The database name (or filePath for lowdb).
    --dbUrl             The database url (not used for lowdb).
    --dbUser            The database user (not used for lowdb).
    --dbPassword        The database password (not used for lowdb).

    --precision         The precision of the measured values ('ns', 'ms' or 's').
                        Default: 'ms'.

    --output            Output format ('stdout' or 'html').           # HTML is coming soon.
    --outputFile        Output file name (used for html).

The stdout output does only print some basic information:

$ npx @trace-it/cli analyze --driver lowdb --dbName ./perf.json  --output stdout
semanticId           count    # children    max         min         avg         p50         p75         95          p99
root                 1        2             270.85ms    270.85ms    270.85ms    270.85ms    270.85ms    270.85ms    270.85ms
|- child1            10       0             17.14ms     14.82ms     15.59ms     15.42ms     15.76ms     16.75ms     17.06ms
|- child2            5        1             24.24ms     17.91ms     20.38ms     19.42ms     21.21ms     23.63ms     24.12ms
|  |- child2child    5        0             4.36ms      2.25ms      3.10ms      3.06ms      3.14ms      4.12ms      4.31ms

The html output will print more information like the separate transaction runs, the related transaction data, the hierarchy of the runs and similar.

:x: Clear

This feature will clear all measurement that are available in the storage.

npx @trace-it/cli clear --help
USAGE: trace-it clear <OPTIONS>

MANDATORY OPTIONS:
    --driver            The storage driver ('lowdb' or 'mongodb').
    --dbName            The database name (or filePath for lowdb).
    --dbUrl             The database url (not used for lowdb).
    --dbUser            The database user (not used for lowdb).
    --dbPassword        The database password (not used for lowdb).

Changelog

See changes for each version in the release notes.

License

MIT - Matthias Hecht