[gnome-builder] makecache: add performance counters to makecache
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] makecache: add performance counters to makecache
- Date: Fri, 8 May 2015 02:03:12 +0000 (UTC)
commit aa8e80c3ee7f664752cfd73640a7455052f490d9
Author: Christian Hergert <christian hergert me>
Date: Thu May 7 18:59:30 2015 -0700
makecache: add performance counters to makecache
Includes counters for cache hits and misses for accessing:
file<->targets
targets<->cflags
libide/autotools/ide-makecache.c | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/libide/autotools/ide-makecache.c b/libide/autotools/ide-makecache.c
index eff150f..6e57dad 100644
--- a/libide/autotools/ide-makecache.c
+++ b/libide/autotools/ide-makecache.c
@@ -23,6 +23,8 @@
#include "config.h"
#endif
+#include "egg-counter.h"
+
#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
@@ -43,6 +45,11 @@
#define FAKE_CC "__LIBIDE_FAKE_CC__"
#define FAKE_CXX "__LIBIDE_FAKE_CXX__"
+EGG_DEFINE_COUNTER (TargetHit, "Makecache", "Target Cache Hits", "Number of target cache hits")
+EGG_DEFINE_COUNTER (TargetMiss, "Makecache", "Target Cache Misses", "Number of target cache misses")
+EGG_DEFINE_COUNTER (FlagHit, "Makecache", "Flag Cache Hits", "Number of flag cache hits")
+EGG_DEFINE_COUNTER (FlagMiss, "Makecache", "Flag Cache Misses", "Number of flag cache misses")
+
struct _IdeMakecache
{
IdeObject parent_instance;
@@ -1303,6 +1310,7 @@ ide_makecache_get_file_targets_async (IdeMakecache *self,
if (neg_hit)
{
+ EGG_COUNTER_INC (TargetHit);
g_task_return_new_error (task,
G_IO_ERROR,
G_IO_ERROR_NOT_FOUND,
@@ -1314,10 +1322,13 @@ ide_makecache_get_file_targets_async (IdeMakecache *self,
if (ret)
{
+ EGG_COUNTER_INC (TargetHit);
g_task_return_pointer (task, g_ptr_array_ref (ret), (GDestroyNotify)g_ptr_array_unref);
IDE_EXIT;
}
+ EGG_COUNTER_INC (TargetMiss);
+
ide_thread_pool_push_task (IDE_THREAD_POOL_COMPILER,
task,
ide_makecache_get_file_targets_worker);
@@ -1389,10 +1400,13 @@ ide_makecache__get_targets_cb (GObject *object,
if (argv)
{
+ EGG_COUNTER_INC (FlagHit);
g_task_return_pointer (task, argv, (GDestroyNotify)g_strfreev);
IDE_EXIT;
}
+ EGG_COUNTER_INC (FlagMiss);
+
lookup = g_new0 (FileFlagsLookup, 1);
lookup->targets = g_ptr_array_ref (targets);
lookup->relative_path = g_strdup (relative_path);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]