(self, request, tenant_id)
return json.dumps({'metrics': multiplot_metrics})
datapoints for all metrics requested
        Right now, only checks of type remote.ping work
datapoints for all metrics requested
        Right now, only checks of type remote.ping work
datapoints for all metrics requested Right now only checks of type remote . ping work
def multiplot(self, request, tenant_id):
        """
        datapoints for all metrics requested
        Right now, only checks of type remote.ping work
        """
        entities = self._entity_cache_for_tenant(tenant_id).entities
        maas_store = self._entity_cache_for_tenant(tenant_id).maas_store
        content = request.content.read()
        multiplot_request = json.loads(content.decode("utf-8"))

        requested_check_ids = set([metric['check_id']
                                   for metric in multiplot_request['metrics']])
        checks_by_id = {check.id: check
                        for entity in entities.values()
                        for check in entity.checks.values()
                        if check.id in requested_check_ids}

        for requested_metric in multiplot_request['metrics']:
            if requested_metric['check_id'] not in checks_by_id:
                status = 400
                request.setResponseCode(status)
                self._audit('rollups', request, tenant_id, status, content)
                return json.dumps({
                    'type': 'requiredNotFoundError',
                    'code': status,
                    'message': 'Required object does not exist',
                    'details': 'Object "Check" with key "{0},{1}" does not exist'.format(
                        requested_metric['entity_id'], requested_metric['check_id']),
                    'txnId': '.fake.mimic.transaction.id.c-1111111.ts-123444444.v-12344frf'})

        multiplot_metrics = [_compute_multiplot(maas_store,
                                                metric['entity_id'],
                                                checks_by_id[
                                                    metric['check_id']],
                                                metric['metric'],
                                                int(request.args[b'from'][0]),
                                                int(request.args[b'to'][0]),
                                                int(request.args[b'points'][0]))
                             for metric in multiplot_request['metrics']]
        status = 200
        request.setResponseCode(200)
        self._audit('rollups', request, tenant_id, status, content)
        return json.dumps({'metrics': multiplot_metrics})
def multiplot ( self , request , tenant_id ) : entities = self . _entity_cache_for_tenant ( tenant_id ) . entities maas_store = self . _entity_cache_for_tenant ( tenant_id ) . maas_store content = request . content . read ( ) multiplot_request = json . loads ( content . decode ( "utf-8" ) ) requested_check_ids = set ( [ metric [ 'check_id' ] for metric in multiplot_request [ 'metrics' ] ] ) checks_by_id = { check . id : check for entity in entities . values ( ) for check in entity . checks . values ( ) if check . id in requested_check_ids } for requested_metric in multiplot_request [ 'metrics' ] : if requested_metric [ 'check_id' ] not in checks_by_id : status = 400 request . setResponseCode ( status ) self . _audit ( 'rollups' , request , tenant_id , status , content ) return json . dumps ( { 'type' : 'requiredNotFoundError' , 'code' : status , 'message' : 'Required object does not exist' , 'details' : 'Object "Check" with key "{0},{1}" does not exist' . format ( requested_metric [ 'entity_id' ] , requested_metric [ 'check_id' ] ) , 'txnId' : '.fake.mimic.transaction.id.c-1111111.ts-123444444.v-12344frf' } ) multiplot_metrics = [ _compute_multiplot ( maas_store , metric [ 'entity_id' ] , checks_by_id [ metric [ 'check_id' ] ] , metric [ 'metric' ] , int ( request . args [ b'from' ] [ 0 ] ) , int ( request . args [ b'to' ] [ 0 ] ) , int ( request . args [ b'points' ] [ 0 ] ) ) for metric in multiplot_request [ 'metrics' ] ] status = 200 request . setResponseCode ( 200 ) self . _audit ( 'rollups' , request , tenant_id , status , content ) return json . dumps ( { 'metrics' : multiplot_metrics } )