Get the App
SLTechnology News&Howtos  ›  Database  › 

How to count QPS scripts in mysql database

Shulou Source: shulou.com Published: 2022-06-01 19:17:59 10月04日 Update

Let's talk about how to count QPS scripts in the mysql database. The secret of the text is that it is relevant to the topic. So, no gossip, let's go straight to the following, I believe you will benefit from reading this article on how to count QPS scripts in the mysql database.

#! / bin/bash

Mysqladmin-uroot-p'xxxx' extended-status-i1 | awk 'BEGIN {local_switch=0;print "QPS Commit Rollback TPS Threads_con Threads_run\ nMurray -"}

$2 ~ / Queries$/ {QQ stories 4MB LQ investors LQ shares 4;}

$2 ~ / Com_commit$/ {centering 4 Mustang 4 Muhammad 4;}

$2 ~ / Com_rollback$/ {rpm, 4MB, lr, lrc, lr, r, r, o, r, o,

$2 ~ / Threads_connected$/ {tc=$4;}

$2 ~ / Threads_running$/ {tr=$4

If (local_switch==0)

{local_switch=1;count=0}

Else {

If (count > 10)

{count=0;print "- -\ nQPS Commit Rollback TPS Threads_con Threads_run\ nMurray -" }

Else {

Count+=1

Printf "%-6d%-8d%-7d%-8d%-10d% d\ n"

}

}

}'

The result after execution is:

QPS Commit Rollback TPS Threads_con Threads_run

35 7 0 7 182 1

1 0 0 0 182 1

7 1 0 1 182 1

11 2 0 2 182 1

10 10 1 182 1

90 90 9 182 1

316 42 0 42 182 1

1 0 0 0 182 1

15 1 0 1 182 1

16 2 0 2 182 1

267 38 0 38 183 1

You can use this script to dynamically view the QPS of mysql and related information!

Is there anything you don't understand about how to count QPS scripts in the above mysql database? Or if you want to know more about it, you can continue to follow our industry information section.

Tags: Scripts data databases statistics the following topics content dynamics places mysteries situations text more sections articles results industry information accessible Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple Linux MySQL Docker Xiaomi