mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Add tracy entity count plot, span tweaks
This commit is contained in:
parent
8d0b776f18
commit
2511b8959c
@ -1,5 +1,4 @@
|
|||||||
use crate::vol::ReadVol;
|
use crate::vol::ReadVol;
|
||||||
use common_base::span;
|
|
||||||
use vek::*;
|
use vek::*;
|
||||||
|
|
||||||
pub trait RayForEach<V> = FnMut(&V, Vec3<i32>);
|
pub trait RayForEach<V> = FnMut(&V, Vec3<i32>);
|
||||||
@ -62,7 +61,6 @@ impl<'a, V: ReadVol, F: FnMut(&V::Vox) -> bool, G: RayForEach<V::Vox>> Ray<'a, V
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn cast(mut self) -> (f32, Result<Option<&'a V::Vox>, V::Error>) {
|
pub fn cast(mut self) -> (f32, Result<Option<&'a V::Vox>, V::Error>) {
|
||||||
span!(_guard, "cast", "Ray::cast");
|
|
||||||
// TODO: Fully test this!
|
// TODO: Fully test this!
|
||||||
|
|
||||||
const PLANCK: f32 = 0.001;
|
const PLANCK: f32 = 0.001;
|
||||||
|
@ -7,7 +7,7 @@ edition = "2018"
|
|||||||
[features]
|
[features]
|
||||||
worldgen = ["server/worldgen"]
|
worldgen = ["server/worldgen"]
|
||||||
default = ["worldgen"]
|
default = ["worldgen"]
|
||||||
tracy = ["common/tracy", "tracing-tracy"]
|
tracy = ["common/tracy", "tracing-tracy", "server/tracy"]
|
||||||
plugins = ["server/plugins"]
|
plugins = ["server/plugins"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
@ -6,6 +6,7 @@ edition = "2018"
|
|||||||
|
|
||||||
[features]
|
[features]
|
||||||
worldgen = []
|
worldgen = []
|
||||||
|
tracy = ["common/tracy"]
|
||||||
simd = ["vek/platform_intrinsics"]
|
simd = ["vek/platform_intrinsics"]
|
||||||
plugins = ["common-sys/plugins"]
|
plugins = ["common-sys/plugins"]
|
||||||
|
|
||||||
|
@ -702,6 +702,15 @@ impl Server {
|
|||||||
.set((end_of_server_tick - before_persistence_updates).as_nanos() as i64);
|
.set((end_of_server_tick - before_persistence_updates).as_nanos() as i64);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "tracy")]
|
||||||
|
{
|
||||||
|
use common_base::tracy_client::Plot;
|
||||||
|
use common_base::tracy_client::create_plot;
|
||||||
|
let entity_count = self.state.ecs().entities().join().count();
|
||||||
|
static ENTITY_COUNT: Plot = create_plot!("entity count");
|
||||||
|
ENTITY_COUNT.point(entity_count as f64);
|
||||||
|
}
|
||||||
|
|
||||||
// 9) Finish the tick, pass control back to the frontend.
|
// 9) Finish the tick, pass control back to the frontend.
|
||||||
|
|
||||||
Ok(frontend_events)
|
Ok(frontend_events)
|
||||||
|
Loading…
Reference in New Issue
Block a user