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

Function fetch_admin_memory_profiler_functions

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

Source from the content-addressed store, hash-verified

3889}
3890
3891pub async fn fetch_admin_memory_profiler_functions(
3892 top: Option<usize>,
3893) -> Result<MemoryFunctionReport, String> {
3894 #[cfg(feature = "mock")]
3895 {
3896 Ok(MemoryFunctionReport {
3897 generated_at_ms: Date::now() as i64,
3898 top: top.unwrap_or(20),
3899 total_live_bytes_estimate: 0,
3900 process_rss_bytes: 0,
3901 entries: vec![],
3902 })
3903 }
3904
3905 #[cfg(not(feature = "mock"))]
3906 {
3907 let mut url = format!("{}/admin/runtime/memory/functions", admin_base());
3908 if let Some(top) = top {
3909 url.push_str(&format!("?top={top}"));
3910 }
3911 let response = api_get(&url)
3912 .send()
3913 .await
3914 .map_err(|e| format!("Network error: {:?}", e))?;
3915 if !response.ok() {
3916 return Err(format!("HTTP error: {}", response.status()));
3917 }
3918 response
3919 .json()
3920 .await
3921 .map_err(|e| format!("Parse error: {:?}", e))
3922 }
3923}
3924
3925pub async fn fetch_admin_memory_profiler_modules(
3926 top: Option<usize>,

Callers 1

admin_pageFunction · 0.85

Calls 2

api_getFunction · 0.85
okMethod · 0.80

Tested by

no test coverage detected