Skip to content

Commit 1568948

Browse files
committed
add more traces to potentially longer-running operations
1 parent 9e7c3e1 commit 1568948

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

gix-index/src/file/write.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ impl File {
2222
mut out: impl std::io::Write,
2323
options: write::Options,
2424
) -> std::io::Result<(Version, gix_hash::ObjectId)> {
25+
let _span = gix_features::trace::detail!("gix_index::File::write_to()", skip_hash = options.skip_hash);
2526
let (version, hash) = if options.skip_hash {
2627
let out: &mut dyn std::io::Write = &mut out;
2728
let version = self.state.write_to(out, options)?;
@@ -40,6 +41,7 @@ impl File {
4041
///
4142
/// Note that the hash produced will be stored which is why we need to be mutable.
4243
pub fn write(&mut self, options: write::Options) -> Result<(), Error> {
44+
let _span = gix_features::trace::detail!("gix_index::File::write()", path = ?self.path);
4345
let mut lock = std::io::BufWriter::with_capacity(
4446
64 * 1024,
4547
gix_lock::File::acquire_to_update_resource(&self.path, gix_lock::acquire::Fail::Immediately, None)?,

0 commit comments

Comments
 (0)