Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to monitor database transaction?

I have written a webapplication for payroll system which can do (insert,update,delete) to mysql database.

I want to know

how many transaction happened in mysql database ?
how many transaction happened in mysql database during start_time and end_time ?

like image 326
Nandha Avatar asked Apr 06 '11 12:04

Nandha


1 Answers

MySQL has command counters. They can be seen with SHOW GLOBAL STATUS LIKE "COM\_%". Each execution of a command increments the counter associated with it. Transaction related counters are Com_begin, Com_commit and Com_rollback. Also Uptime is the number of seconds since server start. Reading and graphing these values or their delta yields the information you ask for.

There are also counters for Com_insert, Com_update, Com_delete and variations thereof. You might want to graph these as well.

like image 166
Isotopp Avatar answered Oct 01 '22 03:10

Isotopp