Cloud functions to handle Firebase Performance Monitoring events from Firebase Alerts.
Classes
PerformanceEventclass firebase_functions.alerts.performance_fn.PerformanceEvent(specversion: str, id: str, source: str, type: str, time: datetime, data: T, subject: str | None, alert_type: str, app_id: str) |
---|
Bases: A custom CloudEvent for billing Firebase Alerts.
|
ThresholdAlertPayloadclass firebase_functions.alerts.performance_fn.ThresholdAlertPayload(event_name: str, event_type: str, metric_type: str, num_samples: int, threshold_value: float, threshold_unit: str, violation_value: float | int, violation_unit: str, investigate_uri: str, condition_percentile: float | int | None = None, app_version: str | None = None) |
---|
Bases: The internal payload object for a performance threshold alert. Payload is wrapped inside a FirebaseAlertData object.
|
Functions
on_threshold_alert_publishedfirebase_functions.alerts.performance_fn.on_threshold_alert_published(**kwargs) Callable[[Callable[[PerformanceEvent[ThresholdAlertPayload]], None]], Callable[[PerformanceEvent[ThresholdAlertPayload]], None]] |
---|
Event handler which runs every time a threshold alert is received. Example: import firebase_functions.alerts.performance_fn as performance_fn @performance_fn.on_threshold_alert_published() def example(alert: performance_fn.PerformanceThresholdAlertEvent) -> None: print(alert)
|
Constants
OnThresholdAlertPublishedCallablefirebase_functions.alerts.performance_fn.OnThresholdAlertPublishedCallable |
---|
The type of the callable for 'on_threshold_alert_published' functions. alias of |
PerformanceThresholdAlertEventfirebase_functions.alerts.performance_fn.PerformanceThresholdAlertEvent |
---|
The type of the event for 'on_threshold_alert_published' functions. alias of |