MCPcopy
hub / github.com/feast-dev/feast / monitor_run

Function monitor_run

sdk/python/feast/cli/monitor.py:73–127  ·  view source on GitHub ↗

Compute feature quality metrics. Without --start-date/--end-date/--granularity, runs in auto mode: detects date ranges from source data and computes all granularities. Use --source-type log to compute metrics from feature serving logs (requires feature services with logging configu

(
    ctx: click.Context,
    project: Optional[str],
    feature_view: Optional[str],
    feature_name: tuple,
    start_date: Optional[str],
    end_date: Optional[str],
    granularity: Optional[str],
    set_baseline: bool,
    feature_service: Optional[str],
    source_type: str,
)

Source from the content-addressed store, hash-verified

71)
72@click.pass_context
73def monitor_run(
74 ctx: click.Context,
75 project: Optional[str],
76 feature_view: Optional[str],
77 feature_name: tuple,
78 start_date: Optional[str],
79 end_date: Optional[str],
80 granularity: Optional[str],
81 set_baseline: bool,
82 feature_service: Optional[str],
83 source_type: str,
84):
85 """Compute feature quality metrics.
86
87 Without --start-date/--end-date/--granularity, runs in auto mode:
88 detects date ranges from source data and computes all granularities.
89
90 Use --source-type log to compute metrics from feature serving logs
91 (requires feature services with logging configured).
92 """
93 store = create_feature_store(ctx)
94
95 if project is None:
96 project = store.project
97
98 from feast.monitoring.monitoring_service import MonitoringService
99
100 svc = MonitoringService(store)
101
102 auto_mode = start_date is None and end_date is None and granularity is None
103 feat_names: Optional[List[str]] = list(feature_name) if feature_name else None
104
105 if source_type in ("batch", "all"):
106 _run_batch_monitoring(
107 svc,
108 project,
109 feature_view,
110 feat_names,
111 start_date,
112 end_date,
113 granularity,
114 set_baseline,
115 auto_mode,
116 )
117
118 if source_type in ("log", "all"):
119 _run_log_monitoring(
120 svc,
121 project,
122 feature_service,
123 start_date,
124 end_date,
125 granularity,
126 auto_mode,
127 )
128
129
130def _run_batch_monitoring(

Callers

nothing calls this directly

Calls 4

create_feature_storeFunction · 0.90
MonitoringServiceClass · 0.90
_run_batch_monitoringFunction · 0.85
_run_log_monitoringFunction · 0.85

Tested by

no test coverage detected