[Feature] Add total entries to database info

show total database entries in debug>Database Info

Change-Id: Ic22b6a032ae0ee23e0f38c0da6a9cf1433ba29e2
This commit is contained in:
William Wilgus 2023-01-15 22:41:52 -05:00 committed by William Wilgus
parent d39fcf5c89
commit d521020d21
3 changed files with 4 additions and 0 deletions

View file

@ -1865,6 +1865,8 @@ static int database_callback(int btn, struct gui_synclist *lists)
stat->ramcache ? "Yes" : "No"); stat->ramcache ? "Yes" : "No");
simplelist_addline("RAM: %d/%d B", simplelist_addline("RAM: %d/%d B",
stat->ramcache_used, stat->ramcache_allocated); stat->ramcache_used, stat->ramcache_allocated);
simplelist_addline("Total entries: %d",
stat->total_entries);
simplelist_addline("Progress: %d%% (%d entries)", simplelist_addline("Progress: %d%% (%d entries)",
stat->progress, stat->processed_entries); stat->progress, stat->processed_entries);
simplelist_addline("Curfile: %s", simplelist_addline("Curfile: %s",

View file

@ -5084,6 +5084,7 @@ static int get_progress(void)
struct tagcache_stat* tagcache_get_stat(void) struct tagcache_stat* tagcache_get_stat(void)
{ {
tc_stat.total_entries = current_tcmh.tch.entry_count;
tc_stat.progress = get_progress(); tc_stat.progress = get_progress();
tc_stat.processed_entries = processed_dir_count; tc_stat.processed_entries = processed_dir_count;

View file

@ -85,6 +85,7 @@ struct tagcache_stat {
int ramcache_used; /* How much ram has been really used */ int ramcache_used; /* How much ram has been really used */
int progress; /* Current progress of disk scan */ int progress; /* Current progress of disk scan */
int processed_entries; /* Scanned disk entries so far */ int processed_entries; /* Scanned disk entries so far */
int total_entries; /* Total entries in tagcache */
int queue_length; /* Command queue length */ int queue_length; /* Command queue length */
volatile const char volatile const char
*curentry; /* Path of the current entry being scanned. */ *curentry; /* Path of the current entry being scanned. */