[rygel] media-export: Add timing output for harvesting task



commit 554ad8ae962f1e00d31acb8d9a9ffa383958cc5e
Author: Jens Georg <mail jensge org>
Date:   Sat Jul 4 12:49:05 2015 +0200

    media-export: Add timing output for harvesting task
    
    Signed-off-by: Jens Georg <mail jensge org>

 .../rygel-media-export-harvesting-task.vala        |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/src/plugins/media-export/rygel-media-export-harvesting-task.vala 
b/src/plugins/media-export/rygel-media-export-harvesting-task.vala
index 15b932b..b968f47 100644
--- a/src/plugins/media-export/rygel-media-export-harvesting-task.vala
+++ b/src/plugins/media-export/rygel-media-export-harvesting-task.vala
@@ -37,6 +37,7 @@ internal class FileQueueEntry {
 public class Rygel.MediaExport.HarvestingTask : Rygel.StateMachine,
                                                 GLib.Object {
     public File origin;
+    private Timer timer;
     private MetadataExtractor extractor;
     private MediaCache cache;
     private GLib.Queue<MediaContainer> containers;
@@ -69,6 +70,7 @@ public class Rygel.MediaExport.HarvestingTask : Rygel.StateMachine,
         this.files = new LinkedList<FileQueueEntry> ();
         this.containers = new GLib.Queue<MediaContainer> ();
         this.monitor = monitor;
+        this.timer = new Timer ();
     }
 
     ~HarvestingTask () {
@@ -99,6 +101,7 @@ public class Rygel.MediaExport.HarvestingTask : Rygel.StateMachine,
      * only one event is sent when all the children are done.
      */
     public async void run () {
+        this.timer.reset ();
         try {
             this.extractor.run.begin ();
 
@@ -285,6 +288,9 @@ public class Rygel.MediaExport.HarvestingTask : Rygel.StateMachine,
         } else {
             // nothing to do
             this.completed ();
+            debug ("Harvesting of %s done in %f",
+                    origin.get_uri (),
+                    timer.elapsed ());
         }
 
         return false;


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