Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Measuring MySQL resources consumption on Linux

by kyle (Abbot)
on Dec 13, 2007 at 22:27 UTC ( #656931=note: print w/ replies, xml ) Need Help??


in reply to Measuring MySQL resources consumption on Linux

# # calculate the average, avoiding any division by zero traps # my $avg_cpu_load = $total_cpu_load ? $total_cpu_load / $active_pid_num + : 0 ;

I'd think if you want to avoid division by zero, you'd need to check the denominator for zero-ness rather than the numerator. That is:

my $avg_cpu_load = $active_pid_num ? $total_cpu_load / $active_pid_num + : 0;

Or am I misunderstanding something here?


Comment on Re: Measuring MySQL resources consumption on Linux
Select or Download Code
Re^2: Measuring MySQL resources consumption on Linux
by Anonymous Monk on Aug 22, 2008 at 15:45 UTC
    if there is a tee in my.cnf, demo mysql tee = mysql.log mysql -u read -pread -N -e 'show variables like "pid_file"' get: Logging to file 'mysql.log' pid_file /path/to/var/mysql.pid mysqlresources buddy read the first line set pid_file="to" reply to: xiaozhiwen@gmail.com
Reaped: travesti
by NodeReaper (Curate) on Nov 25, 2009 at 19:09 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://656931]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (12)
As of 2015-07-03 07:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (48 votes), past polls