(self, namespaces)
https://www.aerospike.com/docs/reference/info/#latency

        Note: Deprecated in Aerospike 5.2
https://www.aerospike.com/docs/reference/info/#latency
https : // www . aerospike . com / docs / reference / info / #latency
def collect_latency(self, namespaces):
        """
        https://www.aerospike.com/docs/reference/info/#latency

        Note: Deprecated in Aerospike 5.2
        """
        data = self.get_info('latency:')

        ns = None

        ns_latencies = defaultdict(dict)

        while data:
            line = data.pop(0)
            metric_names = []

            if line.startswith("error-"):
                continue

            if not data:
                break

            timestamp = re.match(r'(\d+:\d+:\d+)', line)
            if timestamp:
                metric_values = line.split(",")[1:]
                ns_latencies[ns].setdefault("metric_values", []).extend(metric_values)
                continue

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

            # need search because this isn't at the beginning
            ops_per_sec = re.search(r'(\w+\/\w+)', line)
            if ops_per_sec:
                ops_per_sec_name = ops_per_sec.groups()[0].replace("/", "_")
                metric_names.append(metric_name + "_" + ops_per_sec_name)

            # findall will grab everything instead of first match
            latencies = re.findall(r'>(\d+ms)', line)
            if latencies:
                for latency in latencies:
                    latency = metric_name + '_over_' + latency
                    metric_names.append(latency)

            ns_latencies[ns].setdefault("metric_names", []).extend(metric_names)

        for ns, v in iteritems(ns_latencies):
            metric_names = v.get("metric_names", [])
            metric_values = v.get("metric_values", [])
            namespace_tags = ['namespace:{}'.format(ns)] if ns else []
            namespace_tags.extend(self._tags)
            if len(metric_names) == len(metric_values):
                for i in range(len(metric_names)):
                    self.send(NAMESPACE_LATENCY_METRIC_TYPE, metric_names[i], metric_values[i], namespace_tags)
def collect_latency ( self , namespaces ) : data = self . get_info ( 'latency:' ) ns = None ns_latencies = defaultdict ( dict ) while data : line = data . pop ( 0 ) metric_names = [ ] if line . startswith ( "error-" ) : continue if not data : break timestamp = re . match ( r'(\d+:\d+:\d+)' , line ) if timestamp : metric_values = line . split ( "," ) [ 1 : ] ns_latencies [ ns ] . setdefault ( "metric_values" , [ ] ) . extend ( metric_values ) continue ns , metric_name = self . get_metric_name ( line ) if metric_name is None : return # need search because this isn't at the beginning ops_per_sec = re . search ( r'(\w+\/\w+)' , line ) if ops_per_sec : ops_per_sec_name = ops_per_sec . groups ( ) [ 0 ] . replace ( "/" , "_" ) metric_names . append ( metric_name + "_" + ops_per_sec_name ) # findall will grab everything instead of first match latencies = re . findall ( r'>(\d+ms)' , line ) if latencies : for latency in latencies : latency = metric_name + '_over_' + latency metric_names . append ( latency ) ns_latencies [ ns ] . setdefault ( "metric_names" , [ ] ) . extend ( metric_names ) for ns , v in iteritems ( ns_latencies ) : metric_names = v . get ( "metric_names" , [ ] ) metric_values = v . get ( "metric_values" , [ ] ) namespace_tags = [ 'namespace:{}' . format ( ns ) ] if ns else [ ] namespace_tags . extend ( self . _tags ) if len ( metric_names ) == len ( metric_values ) : for i in range ( len ( metric_names ) ) : self . send ( NAMESPACE_LATENCY_METRIC_TYPE , metric_names [ i ] , metric_values [ i ] , namespace_tags )