def METHOD_NAME(self, context):
    host_file = context.get_artifact_path('mongoperf-output')
    results = defaultdict(list)
    threads = None
    with open(host_file) as fh:
        for line in fh:
            if 'new thread,' in line:
                threads = int(line.split()[-1])
            elif 'ops/sec' in line:
                results[threads].append(int(line.split()[0]))
    if not results:
        raise WorkloadError('No mongoperf results found in the output.')
    for threads, values in results.items():
        rs = pd.Series(values)
        context.add_metric('ops_per_sec', rs.mean(),
                           classifiers={'threads': threads})
        context.add_metric('ops_per_sec_std', rs.std(), lower_is_better=True,
                           classifiers={'threads': threads})