def _extract_counters(self):
    'Extract counters like nscanned and nreturned from the logevent.'
    counters = ['nscanned', 'nscannedObjects', 'ntoreturn', 'nreturned', 'ninserted', 'nupdated', 'ndeleted', 'r', 'w', 'numYields', 'planSummary', 'writeConflicts', 'keyUpdates']
    counter_equiv = {'docsExamined': 'nscannedObjects', 'keysExamined': 'nscanned', 'nDeleted': 'ndeleted', 'nInserted': 'ninserted', 'nMatched': 'nreturned', 'nModified': 'nupdated'}
    counters.extend(counter_equiv.keys())
    split_tokens = self.split_tokens
    if self.operation:
        for (t, token) in enumerate(split_tokens[(self.datetime_nextpos + 2):]):
            for counter in counters:
                if token.startswith(('%s:' % counter)):
                    try:
                        counter = counter_equiv.get(counter, counter)
                        vars(self)[('_' + counter)] = int(token.split(':')[(- 1)].replace(',', ''))
                    except ValueError:
                        if ((counter == 'numYields') and token.startswith('numYields')):
                            try:
                                self._numYields = int(split_tokens[(((t + 1) + self.datetime_nextpos) + 2)].replace(',', ''))
                            except ValueError:
                                pass
                        if ((counter == 'planSummary') and token.startswith('planSummary')):
                            try:
                                self._planSummary = split_tokens[(((t + 1) + self.datetime_nextpos) + 2)]
                            except ValueError:
                                pass
                    break
Extract counters like nscanned and nreturned from the logevent.
def _extract_counters(self):
    
    counters = ['nscanned', 'nscannedObjects', 'ntoreturn', 'nreturned', 'ninserted', 'nupdated', 'ndeleted', 'r', 'w', 'numYields', 'planSummary', 'writeConflicts', 'keyUpdates']
    counter_equiv = {'docsExamined': 'nscannedObjects', 'keysExamined': 'nscanned', 'nDeleted': 'ndeleted', 'nInserted': 'ninserted', 'nMatched': 'nreturned', 'nModified': 'nupdated'}
    counters.extend(counter_equiv.keys())
    split_tokens = self.split_tokens
    if self.operation:
        for (t, token) in enumerate(split_tokens[(self.datetime_nextpos + 2):]):
            for counter in counters:
                if token.startswith(('%s:' % counter)):
                    try:
                        counter = counter_equiv.get(counter, counter)
                        vars(self)[('_' + counter)] = int(token.split(':')[(- 1)].replace(',', ))
                    except ValueError:
                        if ((counter == 'numYields') and token.startswith('numYields')):
                            try:
                                self._numYields = int(split_tokens[(((t + 1) + self.datetime_nextpos) + 2)].replace(',', ))
                            except ValueError:
                                pass
                        if ((counter == 'planSummary') and token.startswith('planSummary')):
                            try:
                                self._planSummary = split_tokens[(((t + 1) + self.datetime_nextpos) + 2)]
                            except ValueError:
                                pass
                    break