(self, target, new)
Merges a new report into the target report
Merges a new report into the target report
Merges a new report into the target report
def _merge_report(self, target, new):
        """Merges a new report into the target report"""
        time = None
        if 'ts' in new['parsed']:
            time = new['parsed']['ts']

        if (target.get('lastSeenDate', None) and
                time and
                    target['lastSeenDate'] < time):
            target['lastSeenDate'] = time

        query_millis = int(new['parsed']['stats']['millis'])
        target['stats']['totalTimeMillis'] += query_millis
        target['stats']['count'] += 1
        target['stats']['avgTimeMillis'] = target['stats']['totalTimeMillis'] / target['stats']['count']
def _merge_report ( self , target , new ) : time = None if 'ts' in new [ 'parsed' ] : time = new [ 'parsed' ] [ 'ts' ] if ( target . get ( 'lastSeenDate' , None ) and time and target [ 'lastSeenDate' ] < time ) : target [ 'lastSeenDate' ] = time query_millis = int ( new [ 'parsed' ] [ 'stats' ] [ 'millis' ] ) target [ 'stats' ] [ 'totalTimeMillis' ] += query_millis target [ 'stats' ] [ 'count' ] += 1 target [ 'stats' ] [ 'avgTimeMillis' ] = target [ 'stats' ] [ 'totalTimeMillis' ] / target [ 'stats' ] [ 'count' ]