Add voting metrics and -h/--help to get usage for client.sh script
This commit is contained in:
parent
4c4b0f551e
commit
210b9d346f
|
@ -1,12 +1,12 @@
|
|||
#!/bin/bash -e
|
||||
#
|
||||
# usage: $0 [leader_url] [num_nodes] [--loop] [extra args]
|
||||
#
|
||||
# leader_url URL to the leader (defaults to ..)
|
||||
# num_nodes Minimum number of nodes to look for while converging
|
||||
# --loop Add this flag to cause the program to loop infinitely
|
||||
# "extra args" Any additional arguments are pass along to solana-bench-tps
|
||||
#
|
||||
USAGE=" usage: $0 [leader_url] [num_nodes] [--loop] [extra args]
|
||||
|
||||
leader_url URL to the leader (defaults to ..)
|
||||
num_nodes Minimum number of nodes to look for while converging
|
||||
--loop Add this flag to cause the program to loop infinitely
|
||||
\"extra args\" Any additional arguments are pass along to solana-bench-tps
|
||||
"
|
||||
|
||||
here=$(dirname "$0")
|
||||
# shellcheck source=multinode-demo/common.sh
|
||||
|
@ -14,6 +14,10 @@ source "$here"/common.sh
|
|||
|
||||
leader=$1
|
||||
if [[ -n $leader ]]; then
|
||||
if [[ $leader == "-h" || $leader == "--help" ]]; then
|
||||
echo "$USAGE"
|
||||
exit 0
|
||||
fi
|
||||
shift
|
||||
else
|
||||
if [[ -d "$SNAP" ]]; then
|
||||
|
|
|
@ -76,6 +76,16 @@ fn get_last_id_to_vote_on(
|
|||
super_majority_index,
|
||||
);
|
||||
|
||||
metrics::submit(
|
||||
influxdb::Point::new("vote_stage-peer_count")
|
||||
.add_field("total_peers", influxdb::Value::Integer(ids.len() as i64))
|
||||
.add_field(
|
||||
"valid_peers",
|
||||
influxdb::Value::Integer(valid_ids.len() as i64),
|
||||
)
|
||||
.to_owned(),
|
||||
);
|
||||
|
||||
if valid_ids.len() > super_majority_index {
|
||||
*last_vote = now;
|
||||
|
||||
|
|
Loading…
Reference in New Issue