babylon.metrics.models
SQLAlchemy models for metrics persistence.
These models store the historical record of the simulation’s performance and state metrics in the Ledger (SQLite).
Classes
|
A counter metric that only increases. |
|
A single metric measurement stored in the database. |
|
Base class for metrics models. |
|
Time-series data point for dashboard visualization. |
- class babylon.metrics.models.MetricsBase(**kwargs)[source]
Bases:
DeclarativeBaseBase class for metrics models. Separate from main app to avoid circular imports.
- Parameters:
kwargs (Any)
- __init__(**kwargs)
A simple constructor that allows initialization from kwargs.
Sets attributes on the constructed instance using the names and values in
kwargs.Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.
- metadata: ClassVar[MetaData] = MetaData()
Refers to the
_schema.MetaDatacollection that will be used for new_schema.Tableobjects.See also
orm_declarative_metadata
- registry: ClassVar[_RegistryType] = <sqlalchemy.orm.decl_api.registry object>
Refers to the
_orm.registryin use where new_orm.Mapperobjects will be associated.
- class babylon.metrics.models.Metric(**kwargs)[source]
Bases:
MetricsBaseA single metric measurement stored in the database.
This is the materialized form of MetricEvent, persisted to SQLite for historical analysis and dashboard rendering.
- __init__(**kwargs)
A simple constructor that allows initialization from kwargs.
Sets attributes on the constructed instance using the names and values in
kwargs.Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.
- class babylon.metrics.models.Counter(**kwargs)[source]
Bases:
MetricsBaseA counter metric that only increases.
Used for tracking cumulative counts like total events processed, total embeddings generated, etc.
- __init__(**kwargs)
A simple constructor that allows initialization from kwargs.
Sets attributes on the constructed instance using the names and values in
kwargs.Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.
- class babylon.metrics.models.TimeSeries(**kwargs)[source]
Bases:
MetricsBaseTime-series data point for dashboard visualization.
Optimized for time-range queries and charting. This is where the simulation’s history is recorded for player dashboards.
- __init__(**kwargs)
A simple constructor that allows initialization from kwargs.
Sets attributes on the constructed instance using the names and values in
kwargs.Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.