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

Function fetch_admin_memory_profiler_modules

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

Source from the content-addressed store, hash-verified

3923}
3924
3925pub async fn fetch_admin_memory_profiler_modules(
3926 top: Option<usize>,
3927) -> Result<MemoryModuleReport, String> {
3928 #[cfg(feature = "mock")]
3929 {
3930 Ok(MemoryModuleReport {
3931 generated_at_ms: Date::now() as i64,
3932 top: top.unwrap_or(20),
3933 total_live_bytes_estimate: 0,
3934 process_rss_bytes: 0,
3935 entries: vec![],
3936 })
3937 }
3938
3939 #[cfg(not(feature = "mock"))]
3940 {
3941 let mut url = format!("{}/admin/runtime/memory/modules", admin_base());
3942 if let Some(top) = top {
3943 url.push_str(&format!("?top={top}"));
3944 }
3945 let response = api_get(&url)
3946 .send()
3947 .await
3948 .map_err(|e| format!("Network error: {:?}", e))?;
3949 if !response.ok() {
3950 return Err(format!("HTTP error: {}", response.status()));
3951 }
3952 response
3953 .json()
3954 .await
3955 .map_err(|e| format!("Parse error: {:?}", e))
3956 }
3957}
3958
3959pub async fn admin_reset_memory_profiler() -> Result<(), String> {
3960 #[cfg(feature = "mock")]

Callers 1

admin_pageFunction · 0.85

Calls 2

api_getFunction · 0.85
okMethod · 0.80

Tested by

no test coverage detected