sui_analytics_indexer/handlers/mod.rs
1// Copyright (c) Mysten Labs, Inc.
2// SPDX-License-Identifier: Apache-2.0
3
4//! Handlers for the analytics indexer.
5//!
6//! This module contains:
7//! - `handler`: The default analytics handler for writing to object stores
8//! - `tables`: Table-specific processors for each analytics pipeline
9
10use crate::metrics::Metrics;
11
12pub mod handler;
13pub mod tables;
14
15pub use handler::AnalyticsHandler;
16pub use handler::Batch;
17pub use handler::CheckpointRows;
18pub use handler::Row;
19
20/// Record file size metrics for a pipeline.
21pub fn record_file_metrics(metrics: &Metrics, pipeline_name: &str, size: usize) {
22 metrics
23 .file_size_bytes
24 .with_label_values(&[pipeline_name])
25 .observe(size as f64);
26}