Skip to content

Instantly share code, notes, and snippets.

@den-kozlov
Created February 10, 2021 07:43
Show Gist options
  • Save den-kozlov/7015570dd1c4b979b6f0dfb607e11088 to your computer and use it in GitHub Desktop.
Save den-kozlov/7015570dd1c4b979b6f0dfb607e11088 to your computer and use it in GitHub Desktop.
local function MAP(t) return setmetatable(t,require'json'.map_mt) end local t = require'fun'.iter(box.slab.stats()):map(function(s) return MAP{kind=s.item_size, cnt=s.slab_count, items=s.item_count, use=math.floor(s.mem_used/(s.slab_size * s.slab_count)*1000)/10, size=s.slab_size} end):totable() table.sort(t,function(a,b) return a.kind < b.kind end) return t
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment