lib/commit: Add devino_cache_hits to txn stats
I found this useful while hacking on rpm-ostree but I think it might be useful enough to upstream. This stat is really helpful for validating that a pipeline is hitting the devino cache sweet spot. Closes: #1772 Approved by: cgwalters
This commit is contained in:
1 parent
1dcebe8846
commit
8eac5be030
4 files changed
+12
-2
No files matched your search
@@ -3338,6 +3338,9 @@ write_content_to_mtree_internal (OstreeRepo *self,
|
||||
if (!glnx_shutil_rm_rf_at (dfd_iter->fd, name, cancellable, error))
|
||||
return FALSE;
|
||||
}
|
||||
g_mutex_lock (&self->txn_lock);
|
||||
self->txn.stats.devino_cache_hits++;
|
||||
g_mutex_unlock (&self->txn_lock);
|
||||
return TRUE; /* Early return */
|
||||
}
|
||||
}
|
||||
@@ -3469,6 +3472,10 @@ write_content_to_mtree_internal (OstreeRepo *self,
|
||||
if (!ostree_mutable_tree_replace_file (mtree, name, loose_checksum,
|
||||
error))
|
||||
return FALSE;
|
||||
|
||||
g_mutex_lock (&self->txn_lock);
|
||||
self->txn.stats.devino_cache_hits++;
|
||||
g_mutex_unlock (&self->txn_lock);
|
||||
}
|
||||
/* Next fast path - we can "adopt" the file */
|
||||
else if (can_adopt)
|
||||
|
||||
Reference in new issue
Block a user