nvflare.app_common.widgets.metric_relay module

class MetricRelay(pipe_id: str, read_interval=0.1, heartbeat_interval=5.0, pipe_channel_name='metric', event_type: str = 'analytix_log_stats', fed_event: bool = True)[source]

Bases: Widget, AttributesExportable

Init the Widget.

export(export_mode: str) Tuple[str, dict][source]

Exports attributes.

Parameters:

export_mode (str) – export to peer (ExportMode.PEER) or to self (ExportMode.SELF).

Returns:

A tuple of (export section name, arguments to be exported)

handle_event(event_type: str, fl_ctx: FLContext)[source]

Handles events.

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

  • fl_ctx (FLContext) – FLContext information.