Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/jpmorganchase/quorum-profiling/tps-monitor

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/jpmorganchase/quorum-profiling/tps-monitor

  • v0.0.0-20210810120119-914b8716b1bb
  • Source
  • Go
  • Socket score

Version published
Created
Source

TPS Monitor

This is a tool to monitor transactions per second, total transactions and total blocks in Quorum. The tool can be used to calculate TPS in one of the following two ways given below:

  1. Calculate TPS on new blocks inserted to chain - it continuously calculates TPS on new blocks inserted to the chain.
  2. Calculate TPS for a given range of blocks - it calculates TPS for a given range of blocks in the past.

In both modes it exposes the TPS data (aggregated per second) via http endpoint.

!!!Note

tpsmonitor has the capability to push the metrics data to a influxdb. It also has the capability to expose a prometheus end point from where the data can be pulled. Please refer to Usage for further details on this

Prerequisites

Refer to scenario 3 here for all prerequisites.

Building the source

Building tpsmonitor requires Go (version 1.13 or later). You can install it using your favourite package manager. Once the dependencies are installed, run

make from dir quorum-profiling/tps-monitor

Running tpsmonitor

Usage

Run tpsmonitor --help to see usage.

CLI ArgumentDescription
--consensusName of consensus ("raft" of "ibft")
--debugDebug mode. Prints more verbose messages
--portPort for tps monitor (default: 7575). It enables httpendpoint to download tps data in csv format
--httpendpointGeth's RPC http endpoint
--reportFull path of csv report file which captures TPS data (default: "tps-report.csv")
--fromFrom block no. It is used to calculate TPS for a given block range
--toTo block no. It is used to calculate TPS for a given block range
--awsmetricsIt enables pushing TPS metrics to aws metrics
--awsregionAWS region where tpsmonitor is running
--awsnetworkAWS network name of quorum. It is used to form the metric name key
--awsinstAWS instance name. It is used to form the metric name key
--prometheusportIt enables prometheus metrics.
--influxdbenable Influxdb
--influxdb.endpointInfluxdb endpoint (default: "http://localhost:8086")
--influxdb.tokenInfluxdb token or username:password (default: ":")
--influxdb.orgInfluxdb org name. default is empty
--influxdb.bucketInfluxdb bucket or database name (default: "telegraf")
--influxdb.measurementInfluxdb measurement name (default: "quorum_tps")
--influxdb.tagsInfluxdb tags (comma separated list of key=value pairs) (default: "system=quorum,comp=tps")
--helpShow help

AWS - Cloudwatch metrics can be viewed under AWS cloudwatch > custom namespaces with namespace <network_name>-<instance_name>. The metric details are as follows:

  • System=TpsMonitor
Metric nameDescription
TPStransactions per second
TxnCounttotal transactions count
BlockCounttotal block count

Example:

tpsmonitor --httpendpoint http://52.77.226.85:23000/ --consensus raft --report tps-m.csv --port 7575 --prometheusport 2112 --awsmetrics --awsregion ap-southeast-1 --awsnetwork test-nw --awsinst 121.12.13.114 

Calculate TPS on new blocks

Displays TPS calculated in the console for new blocks as they are inserted to the chain. Calculates TPS, total no of blocks and total no of transactions every second and saves these results to the report file. If prometheus port is provided these metrics can be accessed from http://<host>:<prometheus port>/metrics. The metrics names are as follows:

  1. Quorum_TransactionProcessing_TPS
  2. Quorum_TransactionProcessing_total_blocks
  3. Quorum_TransactionProcessing_total_transactions

Example: tpsmonitor --httpendpoint http://52.77.226.85:23000/ --consensus raft --report tps-m.csv --port 7575 --prometheusport 2112

Sample report:

head -20 tps-m.csv
localTime,refTime,TPS,TxnCount,BlockCount
06 May 2020 06:03:01,00:00:00:01,2134,128047,241
06 May 2020 06:03:02,00:00:00:02,2023,242871,479
06 May 2020 06:03:03,00:00:00:03,1958,352613,713
06 May 2020 06:03:04,00:00:00:04,1906,457647,937
06 May 2020 06:03:05,00:00:00:05,1880,564064,1163

Calculate TPS for a given range of blocks

Displays TPS calculated in the console for given range of historical blocks as they are read from the chain. Calculates TPS, total no of blocks and total no of transactions for every minute(for the given block range) and saves these results to the report file.

Example: tpsmonitor --httpendpoint http://52.77.226.85:23000/ --consensus raft --from 1 --to 10000 --report tps-m.csv --port 8888

HTTP endpoint for TPS data

TPS data (in CSV format) can be downloaded from the http endpoint. http://<host>:<port>/tpsdata

sample output:

http://localhost:8888/tpsdata
localTime,refTime,TPS,TxnCount,BlockCount
06 May 2020 06:03:01,00:00:00:01,2134,128047,241
06 May 2020 06:03:02,00:00:00:02,2023,242871,479
06 May 2020 06:03:03,00:00:00:03,1958,352613,713
06 May 2020 06:03:04,00:00:00:04,1906,457647,937
06 May 2020 06:03:05,00:00:00:05,1880,564064,1163

FAQs

Package last updated on 10 Aug 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc