Commit 4834d822 authored by Jan Lindström's avatar Jan Lindström

MDEV-8932: innodb buffer pool hit rate is less than zero

In buffer pool read hit rate calculation can lead rate that is
less than zero.
parent a9b5a8d5
......@@ -5299,11 +5299,19 @@ buf_print_io_instance(
pool_info->pages_written_rate);
if (pool_info->n_page_get_delta) {
double hit_rate = ((1000 * pool_info->page_read_delta)
/ pool_info->n_page_get_delta);
if (hit_rate > 1000) {
hit_rate = 1000;
}
hit_rate = 1000 - hit_rate;
fprintf(file,
"Buffer pool hit rate %lu / 1000,"
" young-making rate %lu / 1000 not %lu / 1000\n",
(ulong) (1000 - (1000 * pool_info->page_read_delta
/ pool_info->n_page_get_delta)),
(ulong) hit_rate,
(ulong) (1000 * pool_info->young_making_delta
/ pool_info->n_page_get_delta),
(ulong) (1000 * pool_info->not_young_making_delta
......
......@@ -5524,11 +5524,19 @@ buf_print_io_instance(
pool_info->pages_written_rate);
if (pool_info->n_page_get_delta) {
double hit_rate = ((1000 * pool_info->page_read_delta)
/ pool_info->n_page_get_delta);
if (hit_rate > 1000) {
hit_rate = 1000;
}
hit_rate = 1000 - hit_rate;
fprintf(file,
"Buffer pool hit rate %lu / 1000,"
" young-making rate %lu / 1000 not %lu / 1000\n",
(ulong) (1000 - (1000 * pool_info->page_read_delta
/ pool_info->n_page_get_delta)),
(ulong) hit_rate,
(ulong) (1000 * pool_info->young_making_delta
/ pool_info->n_page_get_delta),
(ulong) (1000 * pool_info->not_young_making_delta
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment