[ostree] deltas: Gather statistics on total number rollsum'd and bsdiff'd



commit 3e3eb0133533cf44fa356518de068590f3973edf
Author: Colin Walters <walters verbum org>
Date:   Tue Mar 3 17:48:37 2015 -0500

    deltas: Gather statistics on total number rollsum'd and bsdiff'd
    
    Useful for debugging at least.  Though in the future it'd be nice to
    store this inside the delta metadata maybe?

 .../ostree-repo-static-delta-compilation.c         |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)
---
diff --git a/src/libostree/ostree-repo-static-delta-compilation.c 
b/src/libostree/ostree-repo-static-delta-compilation.c
index 78e79ef..ba1bd64 100644
--- a/src/libostree/ostree-repo-static-delta-compilation.c
+++ b/src/libostree/ostree-repo-static-delta-compilation.c
@@ -55,6 +55,9 @@ typedef struct {
   guint64 min_fallback_size_bytes;
   guint64 max_chunk_size_bytes;
   guint64 rollsum_size;
+  guint n_rollsum;
+  guint n_bsdiff;
+  guint n_fallback;
 } OstreeStaticDeltaBuilder;
 
 typedef enum {
@@ -1050,6 +1053,8 @@ generate_delta_lowlatency (OstreeRepo                       *repo,
                                 checksum, rollsum,
                                 cancellable, error))
         goto out;
+
+      builder->n_rollsum++;
     }
 
   /* Now do bsdiff'ed objects */
@@ -1064,6 +1069,8 @@ generate_delta_lowlatency (OstreeRepo                       *repo,
                                checksum, bsdiff,
                                cancellable, error))
         goto out;
+
+      builder->n_bsdiff++;
     }
 
   /* Scan for large objects, so we can fall back to plain HTTP-based
@@ -1098,6 +1105,7 @@ generate_delta_lowlatency (OstreeRepo                       *repo,
           g_ptr_array_add (builder->fallback_objects, 
                            ostree_object_name_serialize (checksum, OSTREE_OBJECT_TYPE_FILE));
           g_hash_table_iter_remove (&hashiter);
+          builder->n_fallback++;
         }
     }
 
@@ -1438,7 +1446,10 @@ ostree_repo_static_delta_generate (OstreeRepo                   *self,
                   total_uncompressed_size,
                   total_compressed_size,
                   builder.loose_compressed_size);
-      g_printerr ("rollsum=%" G_GUINT64_FORMAT "\n", builder.rollsum_size);
+      g_printerr ("rollsum=%u objects, %" G_GUINT64_FORMAT " bytes\n",
+                  builder.n_rollsum,
+                  builder.rollsum_size);
+      g_printerr ("bsdiff=%u objects\n", builder.n_bsdiff);
     }
 
   if (!ot_util_variant_save (descriptor_path, delta_descriptor, cancellable, error))


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