nvflare.metrics.metrics_collector module

class MetricsCollector(tags: dict, streaming_to_server: bool = False)[source]

Bases: FLComponent, ABC

Parameters:

tags – comma separated static tags. used to specify server, client, production, test etc.

collect_event_metrics(event: str, tags, fl_ctx: FLContext)[source]
abstract get_pair_events() Dict[source]
get_pair_start_events()[source]

Returns events that explicitly start duration measurements.

Subclasses that define multiple pair events for one duration metric should list the start event here. If this returns None or no start event is defined for a metric, the collector preserves legacy toggle behavior for that metric.

abstract get_single_events() List[str][source]
publish_metrics(metrics: dict, metric_name: str, tags: dict, fl_ctx: FLContext)[source]