def METHOD_NAME(metric_name, proc_type, stats):
    stats = list(filter(lambda x: isinstance(x, (float, int)), stats))
    stats = stats if len(stats) else [0]
    if proc_type == ProcessType.WORKER:
        proc_name = 'workers'
    elif proc_type == ProcessType.FRONTEND:
        proc_name = 'frontend'
        result[proc_name + '_' + metric_name] = stats[0]
        return
    else:
        proc_name = 'all'
    for op_name in operators:
        result['{}_{}_{}'.format(op_name, proc_name, metric_name)] = operators[op_name](stats)