Add profiling spans for Server::new and World::generate

This commit is contained in:
Imbris 2023-04-16 16:59:33 -04:00
parent 4b6c5f57e3
commit ed4643e80b
2 changed files with 4 additions and 0 deletions

View File

@ -90,6 +90,7 @@ use common_net::{
};
use common_state::{BlockDiff, BuildAreas, State};
use common_systems::add_local_systems;
use common_base::prof_span;
use metrics::{EcsSystemMetrics, PhysicsMetrics, TickMetrics};
use network::{ListenAddr, Network, Pid};
use persistence::{
@ -221,6 +222,7 @@ impl Server {
data_dir: &std::path::Path,
runtime: Arc<Runtime>,
) -> Result<Self, Error> {
prof_span!("Server::new");
info!("Server data dir is: {}", data_dir.display());
if settings.auth_server_address.is_none() {
info!("Authentication is disabled");

View File

@ -55,6 +55,7 @@ use common::{
},
vol::{ReadVol, RectVolSize, WriteVol},
};
use common_base::prof_span;
use common_net::msg::{world_msg, WorldMapMsg};
use enum_map::EnumMap;
use rand::{prelude::*, Rng};
@ -110,6 +111,7 @@ impl World {
opts: sim::WorldOpts,
threadpool: &rayon::ThreadPool,
) -> (Self, IndexOwned) {
prof_span!("World::generate");
// NOTE: Generating index first in order to quickly fail if the color manifest
// is broken.
threadpool.install(|| {