Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 157755 Details for
Bug 119963
RFE: MySQL Activity Report - mysqlard
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
mysqlard.rc
mysqlard.rc (text/plain), 5.05 KB, created by
Sergiy Borodych
on 2008-06-20 14:55:19 UTC
(
hide
)
Description:
mysqlard.rc
Filename:
MIME Type:
Creator:
Sergiy Borodych
Created:
2008-06-20 14:55:19 UTC
Size:
5.05 KB
patch
obsolete
>#!/sbin/runscript ># Copyright 1999-2008 Gentoo Foundation ># Distributed under the terms of the GNU General Public License v2 ># $Header$ > ># based on > ># $Id: mysqlard.server.sh 40 2006-01-20 20:26:11Z dewitge $ ># mysqlard Start script for the MySQL Activity Report Daemon ># Copyright 2004 Gert Dewit <gert.dewit@sos.be> > > >opts="${opts} initrrd" > >depend() { > need mysql >} > > ># Source the config script >if [[ "$datadir" == "" ]] ; then > #echo Loading defaultsettings > . /etc/mysqlard.cnf >fi > >######################################################################## ># Options, change them in /etc/mysqlard.cnf or you can override ># them here, but that's not recommended. Read the comments in ># /etc/mysqlard.cnf if you want to know what you're changing. > >step=${step:="60"} >minsamples=${minsamples:="720"} >datadir=${datadir:="/var/lib/mysqlard"} >pidfile=${pidfile:="/var/run/mysqlard.pid"} >RRDTOOL=${RRDTOOL:="/usr/bin/rrdtool"} >MYSQLARD=${MYSQLARD:="/usr/sbin/mysqlard"} >MYSQLUSER=${MYSQLUSER:="mysqlar"} >MYSQLHOST=${MYSQLHOST:=""} >######################################################################## > ># don't change anything below this line, but heck, I can't stop you ;-) >confile=${confile:="${datadir}/connections.rrd"} >tabfile=${tabfile:="${datadir}/table_cache.rrd"} >keyfile=${keyfile:="${datadir}/key_cache.rrd"} >queryfile=${queryfile:="${datadir}/queries.rrd"} >slavefile=${slavefile:="${datadir}/slave.rrd"} > >slaveopt= >if [[ "$slave" != "" ]]; then > slaveopt=-L >fi > >if [[ "$MYSQLHOST" != "" ]] ; then > MYSQLHOST=--host=$MYSQLHOST >fi > ># functions >avgsamps () { > avg=$(($1 / $2)) > if [ ${avg} -lt 1 ] > then > avg=1 > fi > echo ${avg} >} >archives () { > arch=$(($1 / $2)) > if [[ $(($2 * ${arch} * $3)) -lt $4 ]] > then > arch=$((${arch} + 1)) > fi > echo ${arch} >} > >initrrd () { > # calculated values > heartbeat=$((${step} * 2)) > hoursamps=$((3600 / ${step})) > houravgs=$(avgsamps ${hoursamps} ${minsamples}) > hourarchives=$(archives ${hoursamps} ${houravgs} ${step} 3600) > daysamps=$((86400 / ${step})) > dayavgs=$(avgsamps ${daysamps} ${minsamples}) > dayarchives=$(archives ${daysamps} ${dayavgs} ${step} 86400) > weeksamps=$((604800 / ${step})) > weekavgs=$(avgsamps ${weeksamps} ${minsamples}) > weekarchives=$(archives ${weeksamps} ${weekavgs} ${step} 604800) > monthsamps=$((2678400 / ${step})) > monthavgs=$(avgsamps ${monthsamps} ${minsamples}) > montharchives=$(archives ${monthsamps} ${monthavgs} ${step} 2678400) > yearsamps=$((31622400 / ${step})) > yearavgs=$(avgsamps ${yearsamps} ${minsamples}) > yeararchives=$(archives ${yearsamps} ${yearavgs} ${step} 31622400) > # calculated RRA's > hourrra="RRA:AVERAGE:0.5:${houravgs}:${hourarchives}" > dayrra="RRA:AVERAGE:0.5:${dayavgs}:${dayarchives}" > weekrra="RRA:AVERAGE:0.5:${weekavgs}:${weekarchives}" > monthrra="RRA:AVERAGE:0.5:${monthavgs}:${montharchives}" > yearrra="RRA:AVERAGE:0.5:${yearavgs}:${yeararchives}" > allrras="${hourrra} ${dayrra} ${weekrra} ${monthrra} ${yearrra}" > > if [ ! -f ${confile} ] > then > ${RRDTOOL} create ${confile} --step ${step} \ > DS:threads_connected:GAUGE:${heartbeat}:0:U \ > DS:max_connections:GAUGE:${heartbeat}:0:U \ > ${allrras} > fi > if [ ! -f ${tabfile} ] > then > ${RRDTOOL} create ${tabfile} --step ${step} \ > DS:open_tables:GAUGE:${heartbeat}:0:U \ > DS:table_cache:GAUGE:${heartbeat}:0:U \ > DS:created_tmp_tables:COUNTER:${heartbeat}:0:U \ > DS:created_tmp_disk_t:COUNTER:${heartbeat}:0:U \ > ${allrras} > fi > if [ ! -f ${keyfile} ] > then > ${RRDTOOL} create ${keyfile} --step ${step} \ > DS:key_reads:COUNTER:${heartbeat}:0:U \ > DS:key_read_requests:COUNTER:${heartbeat}:0:U \ > DS:key_buffer_size:GAUGE:${heartbeat}:0:U \ > DS:key_blocks_used:GAUGE:${heartbeat}:0:U \ > DS:select_full_join:COUNTER:${heartbeat}:0:U \ > DS:select_range_check:COUNTER:${heartbeat}:0:U \ > DS:handler_read_key:COUNTER:${heartbeat}:0:U \ > DS:handler_read_rnd:COUNTER:${heartbeat}:0:U \ > DS:slow_queries:COUNTER:${heartbeat}:0:U \ > ${allrras} > fi > if [ ! -f ${queryfile} ] > then > ${RRDTOOL} create ${queryfile} --step ${step} \ > DS:questions:COUNTER:${heartbeat}:0:U \ > DS:com_select:COUNTER:${heartbeat}:0:U \ > DS:com_insert:COUNTER:${heartbeat}:0:U \ > DS:com_update:COUNTER:${heartbeat}:0:U \ > DS:com_delete:COUNTER:${heartbeat}:0:U \ > ${allrras} > fi > if [ ! -f ${slavefile} ] > then > ${RRDTOOL} create ${slavefile} --step ${step} \ > DS:read_master_log_pos:COUNTER:${heartbeat}:0:U \ > DS:exec_master_log_pos:COUNTER:${heartbeat}:0:U \ > ${allrras} > fi >} > >start() { > ebegin "Starting mysqlard" > initrrd > start-stop-daemon --start --quiet --exec ${MYSQLARD} --pidfile ${pidfile} \ > -- --step=${step} --datadir=${datadir} --user=${MYSQLUSER} $MYSQLHOST --pidfile=${pidfile} ${slaveopt} > eend $? "Failed to start mysqlard" >} > >stop() { > ebegin "Stopping mysqlard" > start-stop-daemon --stop --exec ${MYSQLARD} --pidfile ${pidfile} > eend $? "Failed to stop mysqlard" >} >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 119963
:
157745
|
157747
|
157749
|
157751
| 157755