Metrics#
- class ccat_data_transfer.metrics.HousekeepingMetrics[source]#
Bases:
object- send_transfer_metrics(operation: str, source_path: str, destination_path: str, file_size: int, duration: float, success: bool, error_message: str | None = None, additional_tags: Dict[str, str] | None = None, additional_fields: Dict[str, Any] | None = None) bool[source]#
Send transfer-related metrics to InfluxDB.
- Parameters:
operation (str) – Type of operation (e.g., ‘bbcp_transfer’, ‘unpack’, ‘checksum’)
source_path (str) – Source path of the transfer
destination_path (str) – Destination path of the transfer
file_size (int) – Size of the file(s) in bytes
duration (float) – Duration of the operation in seconds
success (bool) – Whether the operation was successful
error_message (Optional[str]) – Error message if operation failed
additional_tags (Optional[Dict[str, str]]) – Additional tags to include
additional_fields (Optional[Dict[str, Any]]) – Additional fields to include
- Returns:
True if successful, False otherwise
- Return type:
bool
- send_function_metrics(operation: str, duration: float, success: bool, error_message: str | None = None, additional_tags: Dict[str, str] | None = None, additional_fields: Dict[str, Any] | None = None) bool[source]#
Send function execution metrics to InfluxDB.
- Parameters:
operation (str) – Type of operation/function being monitored
duration (float) – Duration of the operation in seconds
success (bool) – Whether the operation was successful
error_message (Optional[str]) – Error message if operation failed
additional_tags (Optional[Dict[str, str]]) – Additional tags to include
additional_fields (Optional[Dict[str, Any]]) – Additional fields to include
- Returns:
True if successful, False otherwise
- Return type:
bool
Overview#
Performance metrics and monitoring for the data transfer system.
Key Components#
Metrics collection
Performance monitoring
Metrics reporting and visualization