[tracker-miners/wip/carlosg/stats-logging] libtracker-miner: Make stat reports in debug output clearer




commit fe630e9d131665e15a39629a56a9f37b820c43d0
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sat Aug 6 17:13:06 2022 +0200

    libtracker-miner: Make stat reports in debug output clearer
    
    Confusingly, moved and deleted events don't change the stats at all,
    generalize the processing counting so it also caters for changes
    processed, besides files/folders being checked in the filesystem.

 src/libtracker-miner/tracker-miner-fs.c | 17 +++++++++++------
 src/miners/fs/tracker-main.c            |  4 +++-
 2 files changed, 14 insertions(+), 7 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-miner-fs.c b/src/libtracker-miner/tracker-miner-fs.c
index 164391b39..67f99223a 100644
--- a/src/libtracker-miner/tracker-miner-fs.c
+++ b/src/libtracker-miner/tracker-miner-fs.c
@@ -160,7 +160,7 @@ struct _TrackerMinerFSPrivate {
        guint total_files_ignored;
 
        /* How many we indexed and how many had errors indexing. */
-       guint total_files_processed;
+       guint changes_processed;
        guint total_files_notified_error;
 };
 
@@ -369,6 +369,7 @@ tracker_miner_fs_class_init (TrackerMinerFSClass *klass)
         * @directories_ignored: number of ignored directories
         * @files_found: number of files found
         * @files_ignored: number of ignored files
+        * @changes: number of changes processed
         *
         * The ::finished signal is emitted when @miner_fs has finished
         * all pending processing.
@@ -383,11 +384,12 @@ tracker_miner_fs_class_init (TrackerMinerFSClass *klass)
                              NULL, NULL,
                              NULL,
                              G_TYPE_NONE,
-                             5,
+                             6,
                              G_TYPE_DOUBLE,
                              G_TYPE_UINT,
                              G_TYPE_UINT,
                              G_TYPE_UINT,
+                             G_TYPE_UINT,
                              G_TYPE_UINT);
 
        /**
@@ -926,7 +928,7 @@ log_stats (TrackerMinerFS *fs)
                                fs->priv->total_files_found,
                                fs->priv->total_files_ignored);
                        g_info ("Changes processed : %d (%d errors)",
-                               fs->priv->total_files_processed,
+                               fs->priv->changes_processed,
                                fs->priv->total_files_notified_error);
                        g_info ("--------------------------------------------------\n");
                }
@@ -963,12 +965,15 @@ process_stop (TrackerMinerFS *fs)
                       fs->priv->total_directories_found,
                       fs->priv->total_directories_ignored,
                       fs->priv->total_files_found,
-                      fs->priv->total_files_ignored);
+                      fs->priv->total_files_ignored,
+                      fs->priv->changes_processed);
 
        fs->priv->total_directories_found = 0;
        fs->priv->total_directories_ignored = 0;
        fs->priv->total_files_found = 0;
        fs->priv->total_files_ignored = 0;
+       fs->priv->changes_processed = 0;
+       fs->priv->total_files_notified_error = 0;
 
        fs->priv->been_crawled = TRUE;
 }
@@ -1074,8 +1079,6 @@ item_add_or_update (TrackerMinerFS *fs,
                                                                          fs->priv->sparql_buffer);
        }
 
-       fs->priv->total_files_processed++;
-
        g_free (uri);
        g_object_unref (info);
 
@@ -1379,6 +1382,8 @@ miner_handle_next_item (TrackerMinerFS *fs)
                return FALSE;
        }
 
+       fs->priv->changes_processed++;
+
        /* Handle queues */
        switch (type) {
        case TRACKER_MINER_FS_EVENT_MOVED:
diff --git a/src/miners/fs/tracker-main.c b/src/miners/fs/tracker-main.c
index 52cb4ed7c..76a8c4942 100644
--- a/src/miners/fs/tracker-main.c
+++ b/src/miners/fs/tracker-main.c
@@ -492,10 +492,12 @@ miner_finished_cb (TrackerMinerFS *fs,
                    guint           total_directories_ignored,
                    guint           total_files_found,
                    guint           total_files_ignored,
+                   guint           changes,
                    gpointer        user_data)
 {
-       g_info ("Finished mining in seconds:%f, total directories:%d, total files:%d",
+       g_info ("Finished mining in %f seconds. Changes processed: %d, inspected directories:%d, inspected 
files:%d",
                seconds_elapsed,
+               changes,
                total_directories_found,
                total_files_found);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]