MCPcopy Create free account
hub / github.com/acking-you/static_flow / fetch_admin_memory_profiler_stacks

Function fetch_admin_memory_profiler_stacks

crates/frontend/src/api.rs:3857–3889  ·  view source on GitHub ↗
(
    top: Option<usize>,
)

Source from the content-addressed store, hash-verified

3855}
3856
3857pub async fn fetch_admin_memory_profiler_stacks(
3858 top: Option<usize>,
3859) -> Result<MemoryStackReport, String> {
3860 #[cfg(feature = "mock")]
3861 {
3862 Ok(MemoryStackReport {
3863 generated_at_ms: Date::now() as i64,
3864 top: top.unwrap_or(20),
3865 total_live_bytes_estimate: 0,
3866 process_rss_bytes: 0,
3867 entries: vec![],
3868 })
3869 }
3870
3871 #[cfg(not(feature = "mock"))]
3872 {
3873 let mut url = format!("{}/admin/runtime/memory/stacks", admin_base());
3874 if let Some(top) = top {
3875 url.push_str(&format!("?top={top}"));
3876 }
3877 let response = api_get(&url)
3878 .send()
3879 .await
3880 .map_err(|e| format!("Network error: {:?}", e))?;
3881 if !response.ok() {
3882 return Err(format!("HTTP error: {}", response.status()));
3883 }
3884 response
3885 .json()
3886 .await
3887 .map_err(|e| format!("Parse error: {:?}", e))
3888 }
3889}
3890
3891pub async fn fetch_admin_memory_profiler_functions(
3892 top: Option<usize>,

Callers 1

admin_pageFunction · 0.85

Calls 2

api_getFunction · 0.85
okMethod · 0.80

Tested by

no test coverage detected