X-Git-Url: http://git.vrable.net/?a=blobdiff_plain;f=bluesky%2Fstore.c;h=2043806828a9c241c513ff4952c34dbcf8e8e6d6;hb=348aaaad42163d6829112c9b18026c16b09e1914;hp=ae6bdb67ea99eaa561e679e29725d44fca9217dc;hpb=615c5a3a7d914dcb31c447404756dd41073b2a9c;p=bluesky.git diff --git a/bluesky/store.c b/bluesky/store.c index ae6bdb6..2043806 100644 --- a/bluesky/store.c +++ b/bluesky/store.c @@ -24,6 +24,8 @@ struct _BlueSkyStore { GMutex *lock; GCond *cond_idle; int pending; /* Count of operations not yet complete. */ + + struct bluesky_stats *stats_get, *stats_put; }; GHashTable *store_implementations; @@ -71,6 +73,10 @@ BlueSkyStore *bluesky_store_new(const gchar *type) store->lock = g_mutex_new(); store->cond_idle = g_cond_new(); store->pending = 0; + store->stats_get = bluesky_stats_new(g_strdup_printf("Store[%s]: GETS", + type)); + store->stats_put = bluesky_stats_new(g_strdup_printf("Store[%s]: PUTS", + type)); g_free(scheme); return store; } @@ -224,6 +230,12 @@ void bluesky_store_async_mark_complete(BlueSkyStoreAsync *async) "[%p] complete: elapsed = %"PRIi64" ns, latency = %"PRIi64" ns", async, elapsed, latency); } + + if (async->op == STORE_OP_GET) { + bluesky_stats_add(async->store->stats_get, 1); + } else if (async->op == STORE_OP_PUT) { + bluesky_stats_add(async->store->stats_put, 1); + } } void bluesky_store_async_submit(BlueSkyStoreAsync *async)