[gnome-builder] counters: add counters for Buffer and Fixit



commit e708d38c8972ffe5a7ca8de47baee6917e300539
Author: Christian Hergert <christian hergert me>
Date:   Wed May 13 17:40:10 2015 -0700

    counters: add counters for Buffer and Fixit

 libide/ide-buffer.c |    8 ++++++++
 libide/ide-fixit.c  |    4 ++++
 2 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/libide/ide-buffer.c b/libide/ide-buffer.c
index a65328a..1870930 100644
--- a/libide/ide-buffer.c
+++ b/libide/ide-buffer.c
@@ -20,6 +20,8 @@
 
 #include <glib/gi18n.h>
 
+#include "egg-counter.h"
+
 #include "ide-battery-monitor.h"
 #include "ide-buffer.h"
 #include "ide-buffer-change-monitor.h"
@@ -84,6 +86,8 @@ typedef struct
 
 G_DEFINE_TYPE_WITH_PRIVATE (IdeBuffer, ide_buffer, GTK_SOURCE_TYPE_BUFFER)
 
+EGG_DEFINE_COUNTER (instances, "IdeBuffer", "Instances", "Number of IdeBuffer instances.")
+
 enum {
   PROP_0,
   PROP_BUSY,
@@ -868,6 +872,8 @@ ide_buffer_finalize (GObject *object)
 
   G_OBJECT_CLASS (ide_buffer_parent_class)->finalize (object);
 
+  EGG_COUNTER_DEC (instances);
+
   IDE_EXIT;
 }
 
@@ -1098,6 +1104,8 @@ ide_buffer_init (IdeBuffer *self)
 
   priv->diagnostics_line_cache = g_hash_table_new (g_direct_hash, g_direct_equal);
 
+  EGG_COUNTER_INC (instances);
+
   IDE_EXIT;
 }
 
diff --git a/libide/ide-fixit.c b/libide/ide-fixit.c
index b06b108..1caba27 100644
--- a/libide/ide-fixit.c
+++ b/libide/ide-fixit.c
@@ -16,6 +16,8 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#include "egg-counter.h"
+
 #include "ide-fixit.h"
 #include "ide-source-range.h"
 
@@ -28,6 +30,8 @@ struct _IdeFixit
   const gchar    *text;
 };
 
+EGG_DEFINE_COUNTER (instances, "IdeFixit", "Instances", "Number of fixit instances")
+
 IdeFixit *
 _ide_fixit_new (IdeSourceRange *source_range,
                 const gchar    *replacement_text)


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