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

tank.bench-common

v5.1.5

Published

The tool to run tank.bench profiles

Downloads

107

Readme

Tank.bench-common

npm version

Subprojects:

Tank.bench-profile npm version

Tank.bench-profile-compiler npm version

What is it?

Tank.bench-common is a part of MixBytes.Tank -
the ultimate tool for testing blockchain performance.

The main application of this tool is to run Tank.bench-profiles in multithreaded mode.

Compatibility table

Warning! Tank.bench-common <5.1.0 is deprecated!

|Tank.bench-common|Tank.bench-profile|Tank.bench-profile-compiler| |--|--|--| |5.1.x|1.0.x|2.3.x|

Requirements

To use this package you need at least node v12.5 because
of using worker-threads feature to run the benchmark
using multiple CPUs.

How to use?

This project is designed to run Tank.bench-profiles.
Follow the link to know more about profiles.

Tank.bench-common can run precompiled profiles (mostly used for production) or non-compiled using ts-node (handy for the profile development).

Compiled profiles can be used to run benchmark on clusters deployed by MixBytes.Tank.

Example of usage

Note that this tool can be used in docker

First, you need to install Tank.bench-common using npm install command.

npm install -S tank.bench-common

Once installed, you should create 2 configuration files - bench.config.json and module.config.json.
The first one specifies the behaviour of Tank.bench-common, and the second is used to configure
the profile passed it. You can read about them below.

After installation you will be able to use npx tank-bench command to run profiles.

Running compiled profile

After you created configuration files, you can use the npx tank-bench
command to run your compiled Tank.bench-profile.

npx tank-bench profile.js

Running non-compiled profile

If you want to run non-compiled profile, specify path to the folder containing it:

npx tank-bench path-to-profile-folder

It can be handy for profile development.

Running in docker

To run the bench in docker, use need to build the docker image

docker build -t tank.bench-common:latest .

And then run, passing common config file, module config file and the profile.

docker run -it --rm -v /your-path/tank.bench-common/config/:/config tank.bench-common:latest /config/profile.js -mc /config/module.config.json -cc /config/bench.config.json

Command line arguments

You should specify the profile to run using command line arguments. The profile should be the first argument or
follow the -p flag. For example,

npx tank-bench -p profile.js

Also you can provide arguments to the program overriding default paths of configuration. The are --commonconfig and --moduleconfig (and their short versions, -cc and -mc) if you do not want to use the bench.config.json or module.config.json files.

npx tank-bench -p profile.js -mc mymodule.json

In this case the config for the profile will be gotten from the mymodule.json file.

Also using the command line arguments you can override any arguments listed in configuration schema of profile
or any argument of commonConfig.

npx tank-bench profile.js -common.tps 100

In this case the tps value will be overridden with the value of 100.

Common code configuration

Here is the list of available configuration parameters of Tank.bench-common:

  • logLevel - the level of log (deprecated). Can be 0,1,2,3. 0 - don't log anything, 3 - provide debug log.
  • stopOn - this section specifies the conditions when to stop benchmark.
    • error - works only in blockchain step! Can be "no", "stop" or "print".
      If "no", all errors will be ignored. If stop, benchmark will be stopped with error.
      If "print", the error will be logged and benchmark will go on.
    • processedTransactions - Stop if reach specified amount of processed transactions. Not very
      accurate, can process some more transactions than specified. If you don't want to use
      stop on specified amount, provide -1 as value.
  • prometheusTelemetry - this section specifies configuration of built-in prometheus telemetry.
    • enable - if the telemetry is enabled. All other fields in this section are optional if this is set to false.
    • url - the url of prometheus push-gateway where telemetry should be pushed.
    • user - the login of push-gateway user. Optional.
    • password - the password of push-gateway user. Optional.
    • respCodeBuckets - the buckets for transactions responseCodes histogram.
    • trxsDurationBuckets - the buckets for transaction durations histogram.
  • telemetryStepInterval - the TelemetryStep onKeyPoint method will be calles every N milliseconds.
  • tps - specify the desired transactions per second value.
  • threadsAmount - specify the amount of worker_threads to use during benchmark.
  • maxActivePromises - specify the maximum amount of promises to use in one worker_thread during benchmark.

All fields are required, if otherwise not written.

Troubleshooting

  • Cannot find module 'worker_threads'

    To fix this problem you should switch to using at least node v12.5