(self, report)
Adds a report to the report aggregation
Adds a report to the report aggregation
Adds a report to the report aggregation
def add_query_occurrence(self, report):
        """Adds a report to the report aggregation"""

        initial_millis = int(report['parsed']['stats']['millis'])
        mask = report['queryMask']

        existing_report = self._get_existing_report(mask, report)

        if existing_report is not None:
            self._merge_report(existing_report, report)
        else:
            time = None
            if 'ts' in report['parsed']:
                time = report['parsed']['ts']
            self._reports.append(OrderedDict([
                ('namespace', report['namespace']),
                ('lastSeenDate', time),
                ('queryMask', mask),
                ('supported', report['queryAnalysis']['supported']),
                ('indexStatus', report['indexStatus']),
                ('recommendation', report['recommendation']),
                ('stats', OrderedDict([('count', 1),
                                       ('totalTimeMillis', initial_millis),
                                       ('avgTimeMillis', initial_millis)]))]))
def add_query_occurrence ( self , report ) : initial_millis = int ( report [ 'parsed' ] [ 'stats' ] [ 'millis' ] ) mask = report [ 'queryMask' ] existing_report = self . _get_existing_report ( mask , report ) if existing_report is not None : self . _merge_report ( existing_report , report ) else : time = None if 'ts' in report [ 'parsed' ] : time = report [ 'parsed' ] [ 'ts' ] self . _reports . append ( OrderedDict ( [ ( 'namespace' , report [ 'namespace' ] ) , ( 'lastSeenDate' , time ) , ( 'queryMask' , mask ) , ( 'supported' , report [ 'queryAnalysis' ] [ 'supported' ] ) , ( 'indexStatus' , report [ 'indexStatus' ] ) , ( 'recommendation' , report [ 'recommendation' ] ) , ( 'stats' , OrderedDict ( [ ( 'count' , 1 ) , ( 'totalTimeMillis' , initial_millis ) , ( 'avgTimeMillis' , initial_millis ) ] ) ) ] ) )