()
| 3957 | } |
| 3958 | |
| 3959 | pub async fn admin_reset_memory_profiler() -> Result<(), String> { |
| 3960 | #[cfg(feature = "mock")] |
| 3961 | { |
| 3962 | Ok(()) |
| 3963 | } |
| 3964 | |
| 3965 | #[cfg(not(feature = "mock"))] |
| 3966 | { |
| 3967 | let url = format!("{}/admin/runtime/memory/reset", admin_base()); |
| 3968 | let response = api_post(&url) |
| 3969 | .send() |
| 3970 | .await |
| 3971 | .map_err(|e| format!("Network error: {:?}", e))?; |
| 3972 | if !response.ok() { |
| 3973 | return Err(format!("HTTP error: {}", response.status())); |
| 3974 | } |
| 3975 | Ok(()) |
| 3976 | } |
| 3977 | } |
| 3978 | |
| 3979 | pub async fn admin_update_memory_profiler_config( |
| 3980 | config: &MemoryProfilerConfigUpdate, |
no test coverage detected