Skip to content
Snippets Groups Projects
Commit 467e338a authored by Alexandr's avatar Alexandr
Browse files

fix gh-213

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