Add general statistics-gathering infrastructure.
[bluesky.git] / bluesky / bluesky.h
index 714ec55..ff2bf23 100644 (file)
@@ -41,6 +41,16 @@ extern BlueSkyOptions bluesky_options;
  * limit */
 extern int bluesky_max_threads;
 
+/* A general-purpose counter for gathering run-time statistics. */
+struct bluesky_stats {
+    const char *name;
+    int64_t count;
+    int64_t sum;
+};
+struct bluesky_stats *bluesky_stats_new(const char *name);
+void bluesky_stats_add(struct bluesky_stats *stats, int64_t value);
+void bluesky_stats_dump_all();
+
 /* BlueSky status and error codes.  Various frontends should translate these to
  * the appropriate error code for whatever protocol they implement. */
 typedef enum {