(self, namespaces)
The `latencies` command is introduced in Aerospike 5.1+ and replaces latency and throughput

        https://www.aerospike.com/docs/reference/info/#latencies
The `latencies` command is introduced in Aerospike 5.1+ and replaces latency and throughput
The latencies command is introduced in Aerospike 5 . 1 + and replaces latency and throughput
def collect_latencies(self, namespaces):
        """
        The `latencies` command is introduced in Aerospike 5.1+ and replaces latency and throughput

        https://www.aerospike.com/docs/reference/info/#latencies
        """
        data = self.get_info('latencies:')

        while data:
            line = data.pop(0)

            if not data:
                break

            ns, metric_name = self.get_metric_name(line)
            if metric_name is None:
                return

            namespace_tags = ['namespace:{}'.format(ns)] if ns else []
            namespace_tags.extend(self._tags)

            values = re.search(r':\w+,(\d*\.?\d*),([,\d+.\d+]*)', line)
            if values:
                ops_per_sec_val = values.groups()[0]
                # For backwards compatibility, the ops/sec value is `latencies` is already calculated
                ops_per_sec_name = metric_name + "_" + "ops_sec"
                self.send(NAMESPACE_LATENCY_METRIC_TYPE, ops_per_sec_name, float(ops_per_sec_val), namespace_tags)

                bucket_vals = values.groups()[1]
                if bucket_vals:
                    latencies = bucket_vals.split(',')
                    if latencies and len(latencies) == 17:
                        for i in range(len(latencies)):
                            bucket = 2 ** i
                            tags = namespace_tags + ['bucket:{}'.format(bucket)]
                            latency_name = metric_name
                            self.send(NAMESPACE_LATENCY_METRIC_TYPE, latency_name, latencies[i], tags)

                            # Also submit old latency names like `aerospike.namespace.latency.read_over_64ms`
                            if bucket in [1, 8, 64]:
                                latency_name = metric_name + '_over_{}ms'.format(str(bucket))
                                self.send(NAMESPACE_LATENCY_METRIC_TYPE, latency_name, latencies[i], tags)
                    else:
                        self.log.debug("Got unexpected latency buckets: %s", latencies)
def collect_latencies ( self , namespaces ) : data = self . get_info ( 'latencies:' ) while data : line = data . pop ( 0 ) if not data : break ns , metric_name = self . get_metric_name ( line ) if metric_name is None : return namespace_tags = [ 'namespace:{}' . format ( ns ) ] if ns else [ ] namespace_tags . extend ( self . _tags ) values = re . search ( r':\w+,(\d*\.?\d*),([,\d+.\d+]*)' , line ) if values : ops_per_sec_val = values . groups ( ) [ 0 ] # For backwards compatibility, the ops/sec value is `latencies` is already calculated ops_per_sec_name = metric_name + "_" + "ops_sec" self . send ( NAMESPACE_LATENCY_METRIC_TYPE , ops_per_sec_name , float ( ops_per_sec_val ) , namespace_tags ) bucket_vals = values . groups ( ) [ 1 ] if bucket_vals : latencies = bucket_vals . split ( ',' ) if latencies and len ( latencies ) == 17 : for i in range ( len ( latencies ) ) : bucket = 2 ** i tags = namespace_tags + [ 'bucket:{}' . format ( bucket ) ] latency_name = metric_name self . send ( NAMESPACE_LATENCY_METRIC_TYPE , latency_name , latencies [ i ] , tags ) # Also submit old latency names like `aerospike.namespace.latency.read_over_64ms` if bucket in [ 1 , 8 , 64 ] : latency_name = metric_name + '_over_{}ms' . format ( str ( bucket ) ) self . send ( NAMESPACE_LATENCY_METRIC_TYPE , latency_name , latencies [ i ] , tags ) else : self . log . debug ( "Got unexpected latency buckets: %s" , latencies )