def parse_metric_section(config_obj, section, metric_classes, metrics, aggregate_metric_classes, outdir_default, resource_path):
(hostname, infile, aggr_hosts, aggr_metrics, label, ts_start, ts_end, precision, aggr_metrics, other_options,<EOL>rule_strings, important_sub_metrics, anomaly_detection_metrics) = parse_basic_metric_options(config_obj, section)<EOL>metric_type = section.split('<STR_LIT:->')[<NUM_LIT:0>]<EOL>if metric_type in aggregate_metric_classes:<EOL><INDENT>new_metric = initialize_aggregate_metric(section, aggr_hosts, aggr_metrics, metrics, outdir_default, resource_path, label, ts_start, ts_end, rule_strings,<EOL>important_sub_metrics, anomaly_detection_metrics, other_options)<EOL><DEDENT>else:<EOL><INDENT>new_metric = initialize_metric(section, infile, hostname, aggr_metrics, outdir_default, resource_path, label, ts_start, ts_end, rule_strings,<EOL>important_sub_metrics, anomaly_detection_metrics, other_options)<EOL><DEDENT>if config_obj.has_option(section, '<STR_LIT:ignore>') and config_obj.getint(section, '<STR_LIT:ignore>') == <NUM_LIT:1>:<EOL><INDENT>new_metric.ignore = True<EOL><DEDENT>if config_obj.has_option(section, '<STR_LIT>'):<EOL><INDENT>new_metric.calc_metrics = config_obj.get(section, '<STR_LIT>')<EOL><DEDENT>new_metric.precision = precision<EOL>return new_metric<EOL>
Parse a metric section and create a Metric object
:param config_obj: ConfigParser object
:param section: Section name
:param metric_classes: List of valid metric types
:param metrics: List of all regular metric objects (used by aggregate metric)
:param aggregate_metric_classes: List of all valid aggregate metric types
:param outdir_default: Default output directory
:param resource_path: Default resource directory
:return: An initialized Metric object