veloren/common/src/metrics.rs
Marcel Märtens c515fece28 Implement a VSystem trait that can be implemented by Systems.
It will autodo some things, like track start and time and export those in system metrics
Add a origin and implement it for all Systems in Veloren
2021-03-08 11:51:04 +01:00

25 lines
597 B
Rust

use crate::vsystem::CpuTimeline;
use std::{
collections::HashMap,
sync::{atomic::AtomicU64, Mutex},
};
#[derive(Default)]
pub struct SysMetrics {
pub stats: Mutex<HashMap<String, CpuTimeline>>,
pub agent_ns: AtomicU64,
pub mount_ns: AtomicU64,
pub controller_ns: AtomicU64,
pub character_behavior_ns: AtomicU64,
pub stats_ns: AtomicU64,
pub phys_ns: AtomicU64,
pub projectile_ns: AtomicU64,
pub melee_ns: AtomicU64,
}
#[derive(Default)]
pub struct PhysicsMetrics {
pub entity_entity_collision_checks: u64,
pub entity_entity_collisions: u64,
}