nvflare.metrics.job_metrics_collector module

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

Bases: MetricsCollector

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

  • streaming_to_server – boolean to specify if metrics should be streamed to server

get_pair_events()[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.

get_single_events()[source]
handle_event(event: str, fl_ctx: FLContext)[source]

Handles events.

Parameters:
  • event_type (str) – event type fired by workflow.

  • fl_ctx (FLContext) – FLContext information.

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