Add tracy entity count plot, span tweaks

This commit is contained in:
Imbris 2021-03-13 02:59:58 -05:00
parent 8d0b776f18
commit 2511b8959c
4 changed files with 11 additions and 3 deletions

View File

@ -1,5 +1,4 @@
use crate::vol::ReadVol;
use common_base::span;
use vek::*;
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>) {
span!(_guard, "cast", "Ray::cast");
// TODO: Fully test this!
const PLANCK: f32 = 0.001;

View File

@ -7,7 +7,7 @@ edition = "2018"
[features]
worldgen = ["server/worldgen"]
default = ["worldgen"]
tracy = ["common/tracy", "tracing-tracy"]
tracy = ["common/tracy", "tracing-tracy", "server/tracy"]
plugins = ["server/plugins"]
[dependencies]

View File

@ -6,6 +6,7 @@ edition = "2018"
[features]
worldgen = []
tracy = ["common/tracy"]
simd = ["vek/platform_intrinsics"]
plugins = ["common-sys/plugins"]

View File

@ -702,6 +702,15 @@ impl Server {
.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.
Ok(frontend_events)