Asinfo -v "latencies:" command scope

Is output from asinfo -v “latencies:” command at cluster level or current node level ?

Thanks Alwin

The latencies info command returns node local information.

As @kporter said, asinfo latencies: returns local node information.

As a big picture, latency data is collected at each node for the transactions it is processing. If you have a 256 node cluster, it would be arduous to make each node exchange and keep data for all 256 nodes. So, data/metrics are essentially local to the node, can’t recall off-hand if any that are global - perhaps observed_nodes in the roster: command.

Now, custom applications (i.e. using client Info class) or tools such as asadm or asinfo can query these metrics.

The slide shows two ways to run asinfo. So - asinfo will get data for a node but depends where it is run from. If you run it directly on a standalone machine then it can connect to only one node of the cluster (-h -p args) and get only that node’s data.

$ asinfo -v "latencies:" -h 172.31.73.11 -p 3000
batch-index:;{test}-read:;{test}-write:msec,0.0,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00;{test}-udf:;{test}-batch-sub-read:;{test}-batch-sub-write:;{test}-batch-sub-udf:;{test}-pi-query:;{test}-si-query:

However, if you run it inside the asadm tool’s prompt, you will get data for each node of the cluster.

Below, I have a 3 node cluster where I inserted a few records:

$ asadm
Seed:        [('127.0.0.1', 3000, None)]
Config_file: /home/training/.aerospike/astools.conf, /etc/aerospike/astools.conf
Aerospike Interactive Shell, version 2.22.0

Found 3 nodes
Online:  172.31.70.35:3000, 172.31.73.11:3000, 172.31.75.23:3000

Admin>

Go in admin mode by using enable command.

Admin>enable
Admin+> asinfo -v "latencies:"
ip-172-31-3-62.ec2.internal:3000 (172.31.70.35) returned:
batch-index:;{test}-read:;{test}-write:msec,0.0,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00;{test}-udf:;{test}-batch-sub-read:;{test}-batch-sub-write:;{test}-batch-sub-udf:;{test}-pi-query:;{test}-si-query:

ip-172-31-73-11.ec2.internal:3000 (172.31.73.11) returned:
batch-index:;{test}-read:;{test}-write:;{test}-udf:;{test}-batch-sub-read:;{test}-batch-sub-write:;{test}-batch-sub-udf:;{test}-pi-query:;{test}-si-query:

ip-172-31-75-23.ec2.internal:3000 (172.31.75.23) returned:
batch-index:;{test}-read:;{test}-write:msec,0.0,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00;{test}-udf:;{test}-batch-sub-read:;{test}-batch-sub-write:;{test}-batch-sub-udf:;{test}-pi-query:;{test}-si-query:

And final variation, if you had a 20 node cluster and really only wanted metrics from a few nodes, for e.g. only 2 out of the 3 nodes here, you can use the with modifier as below:

Admin+> asinfo -v "latencies:" with 172.31.73.11:3000, 172.31.75.23:3000
ip-172-31-73-11.ec2.internal:3000 (172.31.73.11) returned:
batch-index:;{test}-read:;{test}-write:msec,0.0,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00;{test}-udf:;{test}-batch-sub-read:;{test}-batch-sub-write:;{test}-batch-sub-udf:;{test}-pi-query:;{test}-si-query:

ip-172-31-75-23.ec2.internal:3000 (172.31.75.23) returned:
batch-index:;{test}-read:;{test}-write:msec,0.0,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00;{test}-udf:;{test}-batch-sub-read:;{test}-batch-sub-write:;{test}-batch-sub-udf:;{test}-pi-query:;{test}-si-query:

Admin+>