增加future性能监控的可读性。

This commit is contained in:
zhengchao
2018-11-27 21:11:59 +08:00
parent ae6f0cda87
commit c1f9f9813f
3 changed files with 14 additions and 8 deletions

View File

@@ -1224,7 +1224,7 @@ void cache_pend(const struct tfe_http_session * session, unsigned int thread_id,
}
void cache_read(const struct tfe_http_session * session, unsigned int thread_id, struct pangu_http_ctx * ctx)
{
ctx->f_cache_query=future_create("cache_get", cache_read_on_succ, cache_read_on_fail, ctx);
ctx->f_cache_query=future_create("cache_read", cache_read_on_succ, cache_read_on_fail, ctx);
int ret=web_cache_async_read(g_pangu_rt->cache, thread_id, session->req, &(ctx->cmid), ctx->f_cache_query);
if(ret==0)
{

View File

@@ -1164,7 +1164,7 @@ int web_cache_async_read(struct cache_handle* handle, unsigned int thread_id,
promise_set_ctx(p, query_ctx, cache_query_ctx_free_cb);
ATOMIC_INC(&(handle->stat_val[STAT_CACHE_READING]));
query_ctx->f_tango_cache_fetch=future_create("_cache_get", cache_query_obj_on_succ, cache_query_obj_on_fail, p);
query_ctx->f_tango_cache_fetch=future_create("_cache_read", cache_query_obj_on_succ, cache_query_obj_on_fail, p);
int ret=tango_cache_fetch_object(handle->clients[thread_id], query_ctx->f_tango_cache_fetch, &meta);
if(ret<0)
{
@@ -1311,7 +1311,7 @@ struct cache_update_context* web_cache_write_start(struct cache_handle* handle,
_cache_put_ctx->url=tfe_strdup(session->req->req_spec.url);
_cache_put_ctx->start=time(NULL);
_cache_put_ctx->ref_handle=handle;
_cache_put_ctx->f=future_create("cache_put", wrap_cache_write_on_succ, wrap_cache_write_on_fail, _cache_put_ctx);
_cache_put_ctx->f=future_create("_cache_wrt", wrap_cache_write_on_succ, wrap_cache_write_on_fail, _cache_put_ctx);
write_ctx=tango_cache_update_start(handle->clients[thread_id], _cache_put_ctx->f, &meta);
if(write_ctx==NULL)//exceed maximum cache memory size.
{