MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / write_stats_file

Function write_stats_file

crates/cache/src/worker.rs:757–770  ·  view source on GitHub ↗
(path: &Path, stats: &ModuleCacheStatistics)

Source from the content-addressed store, hash-verified

755}
756
757fn write_stats_file(path: &Path, stats: &ModuleCacheStatistics) -> bool {
758 toml::to_string_pretty(&stats)
759 .map_err(|err| {
760 warn!(
761 "Failed to serialize stats file, path: {}, err: {}",
762 path.display(),
763 err
764 )
765 })
766 .and_then(|serialized| {
767 fs_write_atomic(path, "stats", serialized.as_bytes()).map_err(|_| ())
768 })
769 .is_ok()
770}
771
772/// Tries to acquire a lock for specific task.
773///

Callers 2

handle_on_cache_getMethod · 0.85

Calls 3

fs_write_atomicFunction · 0.85
is_okMethod · 0.80
as_bytesMethod · 0.80

Tested by

no test coverage detected