Skip to content
Snippets Groups Projects
Commit 7bd5b978 authored by Konstantin Osipov's avatar Konstantin Osipov
Browse files

gh-213 (items used in %): review fixes

parent 467e338a
No related branches found
No related tags found
No related merge requests found
...@@ -99,19 +99,19 @@ lbox_slab_info(struct lua_State *L) ...@@ -99,19 +99,19 @@ lbox_slab_info(struct lua_State *L)
lua_settable(L, -3); lua_settable(L, -3);
char value[32]; char value[32];
double items_used_perc = 100 double items_used_ratio = 100
* ((double)totals.used) * ((double)totals.used)
/ ((double)talloc.cache->arena->prealloc + 0.0001); / ((double)talloc.cache->arena->prealloc + 0.0001);
snprintf(value, sizeof(value), "%0.1lf%%", items_used_perc); snprintf(value, sizeof(value), "%0.1lf%%", items_used_ratio);
lua_pushstring(L, "items_used_%"); lua_pushstring(L, "items_used_ratio");
lua_pushstring(L, value); lua_pushstring(L, value);
lua_settable(L, -3); lua_settable(L, -3);
double arena_used_perc = 100 double arena_used_ratio = 100
* ((double)talloc.cache->arena->used) * ((double)talloc.cache->arena->used)
/ ((double)talloc.cache->arena->prealloc + 0.0001); / ((double)talloc.cache->arena->prealloc + 0.0001);
snprintf(value, sizeof(value), "%0.1lf%%", arena_used_perc); snprintf(value, sizeof(value), "%0.1lf%%", arena_used_ratio);
lua_pushstring(L, "arena_used_%"); lua_pushstring(L, "arena_used_ratio");
lua_pushstring(L, value); lua_pushstring(L, value);
lua_settable(L, -3); lua_settable(L, -3);
......
...@@ -147,9 +147,9 @@ end; ...@@ -147,9 +147,9 @@ end;
... ...
t; t;
--- ---
- - arena_used_% - - arena_used_ratio
- items_used_ratio
- arena_used - arena_used
- items_used_%
- arena_size - arena_size
- slabs - slabs
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment