Collect simple stats about engine usage (#5823)
Signed-off-by: Nick Cameron <nrc@ncameron.org>
This commit is contained in:
@ -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()))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user