Skip to content
Snippets Groups Projects
Commit 7a0996c5 authored by Roman Tsisyk's avatar Roman Tsisyk
Browse files

Increase precision in box.slab.info()

Use two decimal digits in fractional part of quota_used_ratio and
arena_used_ratio.

Closes #2082
parent d4531aa2
No related branches found
No related tags found
No related merge requests found
......@@ -140,7 +140,7 @@ lbox_slab_info(struct lua_State *L)
ratio = 100 * ((double) totals.used
/ ((double) totals.total + 0.0001));
snprintf(ratio_buf, sizeof(ratio_buf), "%0.1lf%%", ratio);
snprintf(ratio_buf, sizeof(ratio_buf), "%0.2lf%%", ratio);
/*
* Fragmentation factor for tuples. Don't account indexes,
......@@ -187,7 +187,7 @@ lbox_slab_info(struct lua_State *L)
*/
ratio = 100 * ((double) quota_used(memtx_quota) /
((double) quota_total(memtx_quota) + 0.0001));
snprintf(ratio_buf, sizeof(ratio_buf), "%0.1lf%%", ratio);
snprintf(ratio_buf, sizeof(ratio_buf), "%0.2lf%%", ratio);
lua_pushstring(L, "arena_used_ratio");
lua_pushstring(L, ratio_buf);
......
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