@property
def duration(self):
    'Calculate duration if available (lazy).'
    if (not self._duration_calculated):
        self._duration_calculated = True
        line_str = self.line_str
        if (line_str and line_str.endswith('ms') and ('Scheduled new oplog query' not in line_str)):
            try:
                space_pos = line_str.rfind(' ')
                if (space_pos == (- 1)):
                    return
                self._duration = int(line_str[(line_str.rfind(' ') + 1):(- 2)].replace(',', ''))
            except ValueError:
                self._duration = None
        elif ('flushing' in self.line_str):
            matchobj = re.search('flushing mmaps took (\\d+)ms', self.line_str)
            if matchobj:
                self._duration = int(matchobj.group(1))
    return self._duration
Calculate duration if available (lazy).
@property
def duration(self):
    
    if (not self._duration_calculated):
        self._duration_calculated = True
        line_str = self.line_str
        if (line_str and line_str.endswith('ms') and ('Scheduled new oplog query' not in line_str)):
            try:
                space_pos = line_str.rfind(' ')
                if (space_pos == (- 1)):
                    return
                self._duration = int(line_str[(line_str.rfind(' ') + 1):(- 2)].replace(',', ))
            except ValueError:
                self._duration = None
        elif ('flushing' in self.line_str):
            matchobj = re.search('flushing mmaps took (\\d+)ms', self.line_str)
            if matchobj:
                self._duration = int(matchobj.group(1))
    return self._duration