feat(rust): expose profiler control routes in Rust frontend (#46306)
Co-authored-by: Bugen Zhao <i@bugenzhao.com> Signed-off-by: Bugen Zhao <i@bugenzhao.com>
This commit is contained in:
co-authored by
Bugen Zhao
parent
b0b8a286dd
commit
08a8a4af3f
@@ -738,6 +738,18 @@ impl EngineCoreClient {
|
||||
self.call_utility_consensus("is_scheduler_paused", ()).await
|
||||
}
|
||||
|
||||
/// Start profiling the engine.
|
||||
pub async fn start_profile(&self, profile_prefix: Option<&str>) -> Result<()> {
|
||||
self.call_utility::<(), _>("profile", (true, profile_prefix)).await?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Stop profiling the engine.
|
||||
pub async fn stop_profile(&self, profile_prefix: Option<&str>) -> Result<()> {
|
||||
self.call_utility::<(), _>("profile", (false, profile_prefix)).await?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Shut down local client tasks and close transport state.
|
||||
pub async fn shutdown(self) -> Result<()> {
|
||||
let Self {
|
||||
|
||||
Reference in New Issue
Block a user