forked from CryptoLions/scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
check-tps.sh
43 lines (31 loc) · 838 Bytes
/
check-tps.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
################################################################################
#
# Scrip Created by http://CryptoLions.io
# For EOS Junlge testnet
#
# TPS Counter
#
# https://github.com/CryptoLions/
#
################################################################################
CLEOS="./cleos.sh"
FROM=$1
TO=$2
#FROM=228300
#TO=244000
LAST_TX_COUNT=0
MAX_TPS=0
echo -ne "\nTesting TPS: \n\n"
for i in $(seq $FROM $TO); do
block=$($CLEOS get block $i)
COUNT_TX=$(jq '.transactions | length' <<< $block)
TPS=$(($COUNT_TX+$LAST_TX_COUNT))
if [[ $TPS -ge $MAX_TPS ]]; then
MAX_TPS=$TPS
fi
echo -ne "Block: $i | TX COUNT: $COUNT_TX | CURRENT TPS: $TPS | MAX_TPS: $MAX_TPS \r"
#echo $block;
LAST_TX_COUNT=$COUNT_TX
done
echo -ne "\n"