This commit is contained in:
TotallyNot 2025-11-03 16:36:45 +01:00
parent e7d6b74aab
commit 35413b563c
Signed by: pyrite
GPG key ID: 7F1BA9170CD35D15
33 changed files with 10238 additions and 1891 deletions

32
models/src/dto/metrics.rs Normal file
View file

@ -0,0 +1,32 @@
#[cfg_attr(feature = "json", derive(serde::Serialize))]
#[cfg_attr(feature = "json", serde(tag = "type", rename_all = "snake_case"))]
#[derive(Debug, Clone)]
pub enum EntityInfo {
Player {
name: String,
id: usize,
is_attacker: bool,
},
Weapon {
name: String,
owner: usize,
id: usize,
},
Global,
}
#[cfg_attr(feature = "json", derive(serde::Serialize))]
#[derive(Debug)]
pub struct Counter {
pub value: u64,
pub entity: EntityInfo,
pub label: &'static str,
}
#[cfg_attr(feature = "json", derive(serde::Serialize))]
#[derive(Debug)]
pub struct Histogram {
pub values: Vec<u32>,
pub entity: EntityInfo,
pub label: &'static str,
}