feat: add opt-in hotpath profiling (#5488)

* feat: add opt-in hotpath profiling

Co-Authored-By: heihutu <heihutu@gmail.com>

* test: fix vault kms client construction

Co-Authored-By: heihutu <heihutu@gmail.com>

---------

Co-authored-by: heihutu <heihutu@gmail.com>
This commit is contained in:
houseme
2026-07-31 01:49:19 +08:00
committed by GitHub
parent 1d3ba1eb8b
commit 7051a5ce41
18 changed files with 113 additions and 52 deletions
+3 -3
View File
@@ -19,7 +19,7 @@ impl FileMeta {
!matches!(Self::check_xl2_v1(buf), Err(_e))
}
#[cfg_attr(feature = "hotpath", hotpath::measure(impl_type = "FileMeta"))]
#[hotpath::measure(impl_type = "FileMeta")]
pub fn load(buf: &[u8]) -> Result<FileMeta> {
let mut xl = FileMeta::default();
xl.unmarshal_msg(buf)?;
@@ -112,7 +112,7 @@ impl FileMeta {
Ok((bin_len, remaining))
}
#[cfg_attr(feature = "hotpath", hotpath::measure(impl_type = "FileMeta"))]
#[hotpath::measure(impl_type = "FileMeta")]
pub fn unmarshal_msg(&mut self, buf: &[u8]) -> Result<u64> {
let i = buf.len() as u64;
@@ -326,7 +326,7 @@ impl FileMeta {
}
}
#[cfg_attr(feature = "hotpath", hotpath::measure(impl_type = "FileMeta"))]
#[hotpath::measure(impl_type = "FileMeta")]
pub fn marshal_msg(&self) -> Result<Vec<u8>> {
let mut wr = Vec::new();