Commit 86031b78 authored by Ell's avatar Ell

gegl-stats: add gegl_reset_stats()

... which resets the cumulative properties of GeglStats (in
particular, cache-total-max, cache-hits, and cache-misses).
parent 25c39ce6
......@@ -679,6 +679,14 @@ gegl_tile_handler_cache_get_misses (void)
return cache_misses;
}
void
gegl_tile_handler_cache_reset_stats (void)
{
cache_total_max = cache_total;
cache_hits = 0;
cache_misses = 0;
}
static guint
gegl_tile_handler_cache_hashfunc (gconstpointer key)
......
......@@ -67,4 +67,6 @@ gsize gegl_tile_handler_cache_get_total_uncloned (void);
gint gegl_tile_handler_cache_get_hits (void);
gint gegl_tile_handler_cache_get_misses (void);
void gegl_tile_handler_cache_reset_stats (void);
#endif
......@@ -426,6 +426,11 @@ GeglStats *gegl_stats (void)
return stats;
}
void gegl_reset_stats (void)
{
gegl_stats_reset (gegl_stats ());
}
static void swap_clean (void)
{
const gchar *swap_dir = gegl_swap_dir ();
......
......@@ -104,6 +104,14 @@ GeglConfig *gegl_config (void);
*/
GeglStats *gegl_stats (void);
/**
* gegl_reset_stats:
*
* Resets the cumulative data gathered by the #GeglStats object returned
* by #gegl_stats().
*/
void gegl_reset_stats (void);
gboolean gegl_is_main_thread (void);
G_END_DECLS
......
......@@ -184,3 +184,9 @@ gegl_stats_get_property (GObject *object,
break;
}
}
void
gegl_stats_reset (GeglStats *stats)
{
gegl_tile_handler_cache_reset_stats ();
}
......@@ -41,6 +41,8 @@ struct _GeglStatsClass
GObjectClass parent_class;
};
void gegl_stats_reset (GeglStats *stats);
G_END_DECLS
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment