美文网首页
MySQL(Queries per second avg)计算方

MySQL(Queries per second avg)计算方

作者: 爱钓鱼的码农 | 来源:发表于2021-07-06 16:24 被阅读0次

    Queries per second avg

    自从MySQL启动起来的QPS的平均值

    Threads: 350  Questions: 112619252828  Slow queries: 1156228  Opens: 138939  Flush tables: 1  Open tables: 2048  Queries per second avg: 23283.127
    
     if (!(uptime= (ulong) (thd->start_time.tv_sec - server_start_time)))
          queries_per_second1000= 0;
        else
          queries_per_second1000= thd->query_id * 1000LL / uptime;
    
        length= my_snprintf(buff, buff_len - 1,
                            "Uptime: %lu  Threads: %d  Questions: %lu  "
                            "Slow queries: %llu  Opens: %llu  Flush tables: %lu  "
                            "Open tables: %u  Queries per second avg: %u.%03u",
                            uptime,
                            (int) thd_manager->get_thd_count(), (ulong) thd->query_id,
                            current_global_status_var.long_query_count,
                            current_global_status_var.opened_tables,
                            refresh_version,
                            table_cache_manager.cached_tables(),
                            (uint) (queries_per_second1000 / 1000),
                            (uint) (queries_per_second1000 % 1000));
    

    相关文章

      网友评论

          本文标题:MySQL(Queries per second avg)计算方

          本文链接:https://www.haomeiwen.com/subject/vbmgultx.html