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

        Note: Deprecated in Aerospike 5.1
https://www.aerospike.com/docs/reference/info/#throughput
https : // www . aerospike . com / docs / reference / info / #throughput
def collect_throughput(self, namespaces):
        """
        https://www.aerospike.com/docs/reference/info/#throughput

        Note: Deprecated in Aerospike 5.1
        """
        data = self.get_info('throughput:')

        while data:
            line = data.pop(0)

            # skip errors
            while line.startswith('error-'):
                if not data:
                    return
                line = data.pop(0)

            # $ asinfo -v 'throughput:'
            # {ns}-read:23:56:38-GMT,ops/sec;23:56:48,0.0;{ns}-write:23:56:38-GMT,ops/sec;23:56:48,0.0; \
            # error-no-data-yet-or-back-too-small;error-no-data-yet-or-back-too-small
            #
            # data = [ "{ns}-read..","23:56:40,0.0", "{ns}-write...","23:56:48,0.0" ... ]

            match = re.match('^{(.+)}-([^:]+):', line)
            if match is None:
                continue

            ns = match.groups()[0]
            if ns not in namespaces:
                continue

            key = match.groups()[1]
            if not data:
                # unexpected EOF
                return

            namespace_tags = ['namespace:{}'.format(ns)]
            namespace_tags.extend(self._tags)
            val = data.pop(0).split(',')[1]
            self.send(NAMESPACE_TPS_METRIC_TYPE, key, val, namespace_tags)
def collect_throughput ( self , namespaces ) : data = self . get_info ( 'throughput:' ) while data : line = data . pop ( 0 ) # skip errors while line . startswith ( 'error-' ) : if not data : return line = data . pop ( 0 ) # $ asinfo -v 'throughput:' # {ns}-read:23:56:38-GMT,ops/sec;23:56:48,0.0;{ns}-write:23:56:38-GMT,ops/sec;23:56:48,0.0; \ # error-no-data-yet-or-back-too-small;error-no-data-yet-or-back-too-small # # data = [ "{ns}-read..","23:56:40,0.0", "{ns}-write...","23:56:48,0.0" ... ] match = re . match ( '^{(.+)}-([^:]+):' , line ) if match is None : continue ns = match . groups ( ) [ 0 ] if ns not in namespaces : continue key = match . groups ( ) [ 1 ] if not data : # unexpected EOF return namespace_tags = [ 'namespace:{}' . format ( ns ) ] namespace_tags . extend ( self . _tags ) val = data . pop ( 0 ) . split ( ',' ) [ 1 ] self . send ( NAMESPACE_TPS_METRIC_TYPE , key , val , namespace_tags )