2022-10-25 06:41:59 +03:00
|
|
|
//! SeaORM Entity. Generated by sea-orm-codegen 0.10.0
|
2022-10-10 07:15:07 +03:00
|
|
|
|
|
|
|
use sea_orm::entity::prelude::*;
|
|
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
|
2022-10-11 08:13:00 +03:00
|
|
|
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Serialize, Deserialize)]
|
2022-10-10 07:15:07 +03:00
|
|
|
#[sea_orm(table_name = "rpc_accounting")]
|
|
|
|
pub struct Model {
|
|
|
|
#[sea_orm(primary_key)]
|
|
|
|
pub id: u64,
|
2022-10-27 03:12:42 +03:00
|
|
|
pub rpc_key_id: u64,
|
2022-10-10 07:15:07 +03:00
|
|
|
pub chain_id: u64,
|
|
|
|
pub method: String,
|
2022-10-10 08:35:25 +03:00
|
|
|
pub error_response: bool,
|
2022-10-11 08:13:00 +03:00
|
|
|
pub period_datetime: DateTimeUtc,
|
2022-10-25 06:41:59 +03:00
|
|
|
// TODO: migration to make these u32
|
|
|
|
pub frontend_requests: u64,
|
|
|
|
pub backend_requests: u64,
|
|
|
|
pub backend_retries: u64,
|
|
|
|
pub no_servers: u64,
|
|
|
|
pub cache_misses: u64,
|
|
|
|
pub cache_hits: u64,
|
|
|
|
// TODO: end migration to make these u32
|
2022-10-11 08:13:00 +03:00
|
|
|
pub sum_request_bytes: u64,
|
|
|
|
pub min_request_bytes: u64,
|
|
|
|
pub mean_request_bytes: f64,
|
|
|
|
pub p50_request_bytes: u64,
|
|
|
|
pub p90_request_bytes: u64,
|
|
|
|
pub p99_request_bytes: u64,
|
|
|
|
pub max_request_bytes: u64,
|
|
|
|
pub sum_response_millis: u64,
|
|
|
|
pub min_response_millis: u64,
|
|
|
|
pub mean_response_millis: f64,
|
|
|
|
pub p50_response_millis: u64,
|
|
|
|
pub p90_response_millis: u64,
|
|
|
|
pub p99_response_millis: u64,
|
|
|
|
pub max_response_millis: u64,
|
|
|
|
pub sum_response_bytes: u64,
|
|
|
|
pub min_response_bytes: u64,
|
|
|
|
pub mean_response_bytes: f64,
|
|
|
|
pub p50_response_bytes: u64,
|
|
|
|
pub p90_response_bytes: u64,
|
|
|
|
pub p99_response_bytes: u64,
|
|
|
|
pub max_response_bytes: u64,
|
2022-10-10 07:15:07 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
|
|
|
pub enum Relation {
|
|
|
|
#[sea_orm(
|
2022-10-27 03:12:42 +03:00
|
|
|
belongs_to = "super::rpc_keys::Entity",
|
|
|
|
from = "Column::RpcKeyId",
|
|
|
|
to = "super::rpc_keys::Column::Id",
|
2022-10-10 07:15:07 +03:00
|
|
|
on_update = "NoAction",
|
|
|
|
on_delete = "NoAction"
|
|
|
|
)]
|
2022-10-27 03:12:42 +03:00
|
|
|
RpcKeys,
|
2022-10-10 07:15:07 +03:00
|
|
|
}
|
|
|
|
|
2022-10-27 03:12:42 +03:00
|
|
|
impl Related<super::rpc_keys::Entity> for Entity {
|
2022-10-10 07:15:07 +03:00
|
|
|
fn to() -> RelationDef {
|
2022-10-27 03:12:42 +03:00
|
|
|
Relation::RpcKeys.def()
|
2022-10-10 07:15:07 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl ActiveModelBehavior for ActiveModel {}
|