MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / stats

Method stats

atomic-repository/src/redb_change_store/queries.rs:246–264  ·  view source on GitHub ↗

Get statistics about the store.

(&self)

Source from the content-addressed store, hash-verified

244
245 /// Get statistics about the store.
246 pub fn stats(&self) -> RedbStoreResult<StoreStats> {
247 let txn = self.db().begin_read()?;
248
249 let change_count = count_table_entries(&txn, tables::CHANGE_META)?;
250 let graph_section_count = count_table_entries(&txn, tables::CHANGE_GRAPH)?;
251 let semantic_section_count = count_table_entries(&txn, tables::CHANGE_SEMANTIC)?;
252 let content_chunk_count = count_table_entries(&txn, tables::CONTENT_CHUNKS)?;
253 let change_chunk_mappings = count_table_entries(&txn, tables::CHANGE_CHUNKS)?;
254 let unhashed_count = count_table_entries(&txn, tables::CHANGE_UNHASHED)?;
255
256 Ok(StoreStats {
257 change_count,
258 graph_section_count,
259 semantic_section_count,
260 content_chunk_count,
261 change_chunk_mappings,
262 unhashed_count,
263 })
264 }
265
266 /// Check if a content chunk exists in the store (by its content hash).
267 ///

Callers 6

test_open_creates_tablesFunction · 0.45
test_content_chunk_dedupFunction · 0.45
test_stats_emptyFunction · 0.45
test_stats_after_saveFunction · 0.45
test_multiple_changesFunction · 0.45

Calls 2

count_table_entriesFunction · 0.85
dbMethod · 0.80

Tested by 6

test_open_creates_tablesFunction · 0.36
test_content_chunk_dedupFunction · 0.36
test_stats_emptyFunction · 0.36
test_stats_after_saveFunction · 0.36
test_multiple_changesFunction · 0.36