Collect simple stats about engine usage (#5823)

Signed-off-by: Nick Cameron <nrc@ncameron.org>
This commit is contained in:
Nick Cameron
2025-03-18 16:19:24 +13:00
committed by GitHub
parent 0688ce7fe9
commit 988a068d6d
8 changed files with 67 additions and 7 deletions

View File

@ -4,7 +4,7 @@ use anyhow::Result;
use indexmap::IndexMap;
use kcl_lib::{
exec::{ArtifactCommand, DefaultPlanes, IdGenerator},
ExecutionKind, KclError,
EngineStats, ExecutionKind, KclError,
};
use kittycad_modeling_cmds::{
self as kcmc,
@ -26,6 +26,7 @@ pub struct EngineConnection {
execution_kind: Arc<RwLock<ExecutionKind>>,
/// The default planes for the scene.
default_planes: Arc<RwLock<Option<DefaultPlanes>>>,
stats: EngineStats,
}
impl EngineConnection {
@ -38,6 +39,7 @@ impl EngineConnection {
core_test: result,
execution_kind: Default::default(),
default_planes: Default::default(),
stats: Default::default(),
})
}
@ -369,6 +371,10 @@ impl kcl_lib::EngineManager for EngineConnection {
Arc::new(RwLock::new(IndexMap::new()))
}
fn stats(&self) -> &EngineStats {
&self.stats
}
fn artifact_commands(&self) -> Arc<RwLock<Vec<ArtifactCommand>>> {
Arc::new(RwLock::new(Vec::new()))
}