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

Merge branch 'fix-gh-213-v2'

parents 6f69fb5f 7bd5b978
No related merge requests found
...@@ -97,6 +97,24 @@ lbox_slab_info(struct lua_State *L) ...@@ -97,6 +97,24 @@ lbox_slab_info(struct lua_State *L)
lua_pushstring(L, "arena_size"); lua_pushstring(L, "arena_size");
luaL_pushnumber64(L, totals.total); luaL_pushnumber64(L, totals.total);
lua_settable(L, -3); lua_settable(L, -3);
char value[32];
double items_used_ratio = 100
* ((double)totals.used)
/ ((double)talloc.cache->arena->prealloc + 0.0001);
snprintf(value, sizeof(value), "%0.1lf%%", items_used_ratio);
lua_pushstring(L, "items_used_ratio");
lua_pushstring(L, value);
lua_settable(L, -3);
double arena_used_ratio = 100
* ((double)talloc.cache->arena->used)
/ ((double)talloc.cache->arena->prealloc + 0.0001);
snprintf(value, sizeof(value), "%0.1lf%%", arena_used_ratio);
lua_pushstring(L, "arena_used_ratio");
lua_pushstring(L, value);
lua_settable(L, -3);
return 1; return 1;
} }
......
...@@ -148,9 +148,11 @@ end; ...@@ -148,9 +148,11 @@ end;
... ...
t; t;
--- ---
- - slabs - - arena_used_ratio
- arena_size - items_used_ratio
- arena_used - arena_used
- arena_size
- slabs
... ...
---------------- ----------------
-- # box.error -- # box.error
......
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