本文整理汇总了PHP中strip_domainname函数的典型用法代码示例。如果您正苦于以下问题:PHP strip_domainname函数的具体用法?PHP strip_domainname怎么用?PHP strip_domainname使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了strip_domainname函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: graph_haproxy_requests_report
function graph_haproxy_requests_report(&$rrdtool_graph)
{
global $context, $cpu_num_color, $cpu_user_color, $hostname, $load_one_color, $num_nodes_color, $proc_run_color, $mem_swapped_color, $range, $rrd_dir, $size, $strip_domainname;
if ($strip_domainname) {
$hostname = strip_domainname($hostname);
}
$rrdtool_graph['height'] += $size == 'medium' ? 28 : 0;
$title = 'HAProxy Requests';
if ($context != 'host') {
$rrdtool_graph['title'] = $title;
} else {
$rrdtool_graph['title'] = "{$hostname} {$title} last {$range}";
}
$rrdtool_graph['lower-limit'] = '0';
$rrdtool_graph['vertical-label'] = 'Requests';
$rrdtool_graph['extras'] = '--rigid';
if (file_exists("{$rrd_dir}/lb_total_current_sess.rrd")) {
$series = "DEF:'haproxy_current_sessions'='{$rrd_dir}/lb_total_current_sess.rrd':'sum':AVERAGE ";
$series .= "DEF:'haproxy_req_per_s'='{$rrd_dir}/lb_total_req_per_s.rrd':'sum':AVERAGE ";
$series .= "LINE2:'haproxy_req_per_s'#{$cpu_num_color}:'Requests/sec' ";
$series .= "LINE2:'haproxy_current_sessions'#{$proc_run_color}:'Sessions' ";
} else {
# If there are no Passenger metrics put something so that the report doesn't barf
$series = "DEF:'cpu_num'='{$rrd_dir}/cpu_num.rrd':'sum':AVERAGE ";
$series .= "LINE2:'cpu_num'#{$mem_swapped_color}:'HAProxy metrics not collected' ";
}
$rrdtool_graph['series'] = $series;
return $rrdtool_graph;
}
示例2: graph_varnish_report
function graph_varnish_report(&$rrdtool_graph)
{
global $conf, $context, $range, $rrd_dir, $size;
$title = 'Varnish Report';
if ($context != 'host') {
$rrdtool_graph['title'] = $title;
} else {
$rrdtool_graph['title'] = strip_domainname($GLOBALS['hostname']) . " {$title} last {$range}";
}
$rrdtool_graph['lower-limit'] = '0';
$rrdtool_graph['vertical-label'] = 'req_per_sec';
$rrdtool_graph['extras'] = '--rigid';
$rrdtool_graph['height'] += $size == 'medium' ? 28 : 0;
if ($conf['graphreport_stats']) {
$rrdtool_graph['height'] += $size == 'medium' ? 16 : 0;
$rmspace = '\\g';
} else {
$rmspace = '';
}
if ($context != "host") {
/* If we are not in a host context, then we need to calculate the average */
$rrdtool_graph['series'] = "DEF:'num_nodes'='{$rrd_dir}/varnish_200.rrd':'num':AVERAGE " . "DEF:'varnish_200'='{$rrd_dir}/varnish_200.rrd':'sum':AVERAGE " . "CDEF:'cvarnish_200'=varnish_200,num_nodes,/ " . "DEF:'varnish_300'='{$rrd_dir}/varnish_300.rrd':'sum':AVERAGE " . "CDEF:'cvarnish_300'=varnish_300,num_nodes,/ " . "DEF:'varnish_400'='{$rrd_dir}/varnish_400.rrd':'sum':AVERAGE " . "CDEF:'cvarnish_400'=varnish_400,num_nodes,/ " . "DEF:'varnish_500'='{$rrd_dir}/varnish_500.rrd':'sum':AVERAGE " . "CDEF:'cvarnish_500'=varnish_500,num_nodes,/ " . "DEF:'varnish_other'='{$rrd_dir}/varnish_other.rrd':'sum':AVERAGE " . "AREA:'varnish_200'#{$conf['cpu_user_color']}:'200' " . "STACK:'varnish_300'#{$conf['cpu_nice_color']}:'300' " . "STACK:'varnish_400'#{$conf['cpu_system_color']}:'400' " . "STACK:'varnish_500'#{$conf['cpu_wio_color']}:'500' " . "STACK:'varnish_other'#{$conf['cpu_idle_color']}:'other' " . "LINE2:'varnish_unique_users'#{$conf['mem_swapped_color']}:'Unique IPs' ";
} else {
$rrdtool_graph['series'] = "DEF:'varnish_200'='{$rrd_dir}/varnish_200.rrd':'sum':AVERAGE " . "DEF:'varnish_300'='{$rrd_dir}/varnish_300.rrd':'sum':AVERAGE " . "DEF:'varnish_400'='{$rrd_dir}/varnish_400.rrd':'sum':AVERAGE " . "DEF:'varnish_500'='{$rrd_dir}/varnish_500.rrd':'sum':AVERAGE " . "AREA:'varnish_200'#{$conf['cpu_user_color']}:'200' " . "STACK:'varnish_300'#{$conf['cpu_nice_color']}:'300' " . "STACK:'varnish_400'#{$conf['cpu_system_color']}:'400' " . "STACK:'varnish_500'#{$conf['cpu_wio_color']}:'500' ";
}
#################################################################################
# If there are no Apache metrics put something so that the report doesn't barf
# I am using the CPU number metric since that one should always be there.
#################################################################################
if (!file_exists("{$rrd_dir}/varnish_200.rrd")) {
$rrdtool_graph['series'] = "DEF:'cpu_num'='{$rrd_dir}/cpu_num.rrd':'sum':AVERAGE " . "LINE2:'cpu_num'#{$conf['mem_swapped_color']}:'Varnish metrics not collected' ";
}
return $rrdtool_graph;
}
示例3: graph_procstat_mem_report
function graph_procstat_mem_report(&$rrdtool_graph)
{
global $context, $hostname, $graph_var, $range, $rrd_dir, $size, $strip_domainname;
$rainbow = array('008000', '0000FF', 'FF0000', 'FFEA00', '9900CC', '00FF00', '00FFFF', 'FF00FF', '808000', '008080', '808080', '000000');
if ($strip_domainname) {
$hostname = strip_domainname($hostname);
}
$title = 'Process Memory Usage';
if ($context != 'host') {
$rrdtool_graph['title'] = $title;
} else {
$rrdtool_graph['title'] = "{$hostname} {$title} last {$range}";
}
$rrdtool_graph['lower-limit'] = '0';
$rrdtool_graph['vertical-label'] = 'Bytes';
$rrdtool_graph['extras'] = '--rigid --base 1024';
$rrdtool_graph['height'] += $size == 'medium' ? 28 : 0;
$series = '';
foreach (explode(',', $graph_var) as $k => $proc) {
$color = $rainbow[$k % count($rainbow)];
$series .= "DEF:'{$proc}'='{$rrd_dir}/procstat_{$proc}_mem.rrd':'sum':AVERAGE " . "CDEF:'{$proc}_bytes'={$proc},1024,* " . "LINE2:'{$proc}_bytes'#{$color}:'{$proc}' ";
}
$rrdtool_graph['series'] = $series;
return $rrdtool_graph;
}
示例4: graph_passenger_memory_stats_report
function graph_passenger_memory_stats_report(&$rrdtool_graph)
{
global $context, $cpu_num_color, $cpu_user_color, $hostname, $load_one_color, $num_nodes_color, $proc_run_color, $mem_swapped_color, $range, $rrd_dir, $size, $strip_domainname;
if ($strip_domainname) {
$hostname = strip_domainname($hostname);
}
$rrdtool_graph['height'] += $size == 'medium' ? 28 : 0;
$title = 'Passenger Memory Stats';
if ($context != 'host') {
$rrdtool_graph['title'] = $title;
} else {
$rrdtool_graph['title'] = "{$hostname} {$title} last {$range}";
}
$rrdtool_graph['lower-limit'] = '0';
$rrdtool_graph['vertical-label'] = 'MB';
$rrdtool_graph['extras'] = '--base 1024 --rigid';
if (file_exists("{$rrd_dir}/passenger_avg_memory.rrd")) {
$series = "DEF:'passenger_avg_memory'='{$rrd_dir}/passenger_avg_memory.rrd':'sum':AVERAGE " . "DEF:'passenger_total_memory'='{$rrd_dir}/passenger_total_memory.rrd':'sum':AVERAGE ";
$series .= "LINE2:'passenger_avg_memory'#{$proc_run_color}:'AVG Memory per Passenger' ";
$series .= "LINE2:'passenger_total_memory'#{$cpu_num_color}:'Total Memory' ";
} else {
# If there are no Passenger metrics put something so that the report doesn't barf
$series = "DEF:'cpu_num'='{$rrd_dir}/cpu_num.rrd':'sum':AVERAGE ";
$series .= "LINE2:'cpu_num'#{$mem_swapped_color}:'Passenger metrics not collected' ";
}
$rrdtool_graph['series'] = $series;
return $rrdtool_graph;
}
示例5: graph_sample_report
function graph_sample_report(&$rrdtool_graph)
{
/*
* this is just the cpu_report (from revision r920) as an example, but
* with extra comments
*/
// pull in a number of global variables, many set in conf.php (such as colors)
// but other from elsewhere, such as get_context.php
global $conf, $context, $range, $rrd_dir, $size;
if ($conf['strip_domainname']) {
$hostname = strip_domainname($GLOBALS['hostname']);
} else {
$hostname = $GLOBALS['hostname'];
}
//
// You *MUST* set at least the 'title', 'vertical-label', and 'series'
// variables otherwise, the graph *will not work*.
//
$title = 'Sample';
if ($context != 'host') {
// This will be turned into: "Clustername $TITLE last $timerange",
// so keep it short
$rrdtool_graph['title'] = $title;
} else {
$rrdtool_graph['title'] = "{$hostname} {$title} last {$range}";
}
$rrdtool_graph['vertical-label'] = 'Sample Percent';
// Fudge to account for number of lines in the chart legend
$rrdtool_graph['height'] += $size == 'medium' ? 28 : 0;
$rrdtool_graph['upper-limit'] = '100';
$rrdtool_graph['lower-limit'] = '0';
$rrdtool_graph['extras'] = '--rigid';
/*
* Here we actually build the chart series. This is moderately complicated
* to show off what you can do. For a simpler example, look at
* network_report.php
*/
if ($context != "host") {
/*
* If we are not in a host context, then we need to calculate
* the average
*/
$series = "'DEF:num_nodes={$rrd_dir}/cpu_user.rrd:num:AVERAGE' " . "'DEF:cpu_user={$rrd_dir}/cpu_user.rrd:sum:AVERAGE' " . "'CDEF:ccpu_user=cpu_user,num_nodes,/' " . "'DEF:cpu_nice={$rrd_dir}/cpu_nice.rrd:sum:AVERAGE' " . "'CDEF:ccpu_nice=cpu_nice,num_nodes,/' " . "'DEF:cpu_system={$rrd_dir}/cpu_system.rrd:sum:AVERAGE' " . "'CDEF:ccpu_system=cpu_system,num_nodes,/' " . "'DEF:cpu_idle={$rrd_dir}/cpu_idle.rrd:sum:AVERAGE' " . "'CDEF:ccpu_idle=cpu_idle,num_nodes,/' " . "'AREA:ccpu_user#{$conf['cpu_user_color']}:User CPU' " . "'STACK:ccpu_nice#{$conf['cpu_nice_color']}:Nice CPU' " . "'STACK:ccpu_system#{$conf['cpu_system_color']}:System CPU' ";
if (file_exists("{$rrd_dir}/cpu_wio.rrd")) {
$series .= "'DEF:cpu_wio={$rrd_dir}/cpu_wio.rrd:sum:AVERAGE' " . "'CDEF:ccpu_wio=cpu_wio,num_nodes,/' " . "'STACK:ccpu_wio#{$conf['cpu_wio_color']}:WAIT CPU' ";
}
$series .= "'STACK:ccpu_idle#{$conf['cpu_idle_color']}:Idle CPU' ";
} else {
// Context is not "host"
$series = "'DEF:cpu_user={$rrd_dir}/cpu_user.rrd:sum:AVERAGE' " . "'DEF:cpu_nice={$rrd_dir}/cpu_nice.rrd:sum:AVERAGE' " . "'DEF:cpu_system={$rrd_dir}/cpu_system.rrd:sum:AVERAGE' " . "'DEF:cpu_idle={$rrd_dir}/cpu_idle.rrd:sum:AVERAGE' " . "'AREA:cpu_user#{$conf['cpu_user_color']}:User CPU' " . "'STACK:cpu_nice#{$conf['cpu_nice_color']}:Nice CPU' " . "'STACK:cpu_system#{$conf['cpu_system_color']}:System CPU' ";
if (file_exists("{$rrd_dir}/cpu_wio.rrd")) {
$series .= "'DEF:cpu_wio={$rrd_dir}/cpu_wio.rrd:sum:AVERAGE' ";
$series .= "'STACK:cpu_wio#{$conf['cpu_wio_color']}:WAIT CPU' ";
}
$series .= "'STACK:cpu_idle#{$conf['cpu_idle_color']}:Idle CPU' ";
}
// We have everything now, so add it to the array, and go on our way.
$rrdtool_graph['series'] = $series;
return $rrdtool_graph;
}
示例6: graph_gpu_core_speed_report
function graph_gpu_core_speed_report(&$rrdtool_graph)
{
global $context, $hostname, $mem_cached_color, $mem_used_color, $mem_swapped_color, $cpu_num_color, $range, $rrd_dir, $size, $strip_domainname;
if (!file_exists("{$rrd_dir}/gpu_num.rrd")) {
return;
}
if (!file_exists("{$rrd_dir}/gpu0_core_speed.rrd")) {
return;
}
if ($strip_domainname) {
$hostname = strip_domainname($hostname);
}
$title = 'GPU Core Speed';
$rrdtool_graph['height'] += $size == 'medium' ? 28 : 0;
if ($context != 'host') {
$rrdtool_graph['title'] = $title;
} else {
$rrdtool_graph['title'] = "{$hostname} {$title} last {$range}";
}
$rrdtool_graph['lower-limit'] = '0';
$rrdtool_graph['vertical-label'] = 'MHz';
$rrdtool_graph['extras'] = '--rigid --base 1024';
$color = array($mem_cached_color, $mem_used_color, $mem_swapped_color, $cpu_num_color);
$gpu_count = exec("find {$rrd_dir}/gpu?_core_speed.rrd | wc -l");
$series = '';
foreach (range(0, $gpu_count - 1) as $i) {
$series .= "DEF:'gpu{$i}'='{$rrd_dir}/gpu{$i}_core_speed.rrd':'sum':AVERAGE ";
}
foreach (range(0, $gpu_count - 1) as $i) {
$series .= "LINE2:'gpu{$i}'#{$color[$i]}:'gpu{$i}' ";
}
$rrdtool_graph['series'] = $series;
return $rrdtool_graph;
}
示例7: graph_nginx_status_report
function graph_nginx_status_report(&$rrdtool_graph)
{
global $context, $cpu_num_color, $cpu_user_color, $hostname, $load_one_color, $num_nodes_color, $proc_run_color, $mem_swapped_color, $range, $rrd_dir, $size, $strip_domainname;
if ($strip_domainname) {
$hostname = strip_domainname($hostname);
}
$rrdtool_graph['height'] += $size == 'medium' ? 14 : 0;
$title = 'Nginx Connections';
if ($context != 'host') {
$rrdtool_graph['title'] = $title;
} else {
$rrdtool_graph['title'] = "{$hostname} {$title} last {$range}";
}
$rrdtool_graph['lower-limit'] = '0';
$rrdtool_graph['vertical-label'] = 'Connections';
$rrdtool_graph['extras'] = '--rigid';
if (file_exists("{$rrd_dir}/nginx_active_connections.rrd")) {
$series = "DEF:'nginx_active_connections'='{$rrd_dir}/nginx_active_connections.rrd':'sum':AVERAGE ";
$series .= "DEF:'nginx_reading'='{$rrd_dir}/nginx_reading.rrd':'sum':AVERAGE ";
$series .= "DEF:'nginx_writing'='{$rrd_dir}/nginx_writing.rrd':'sum':AVERAGE ";
$series .= "DEF:'nginx_waiting'='{$rrd_dir}/nginx_waiting.rrd':'sum':AVERAGE ";
$series .= "LINE2:'nginx_active_connections'#{$cpu_num_color}:'Active Connections' ";
$series .= "LINE2:'nginx_reading'#{$proc_run_color}:'Reading Connections' ";
$series .= "LINE2:'nginx_writing'#33FF11:'Writing Connections' ";
$series .= "LINE2:'nginx_waiting'#{$load_one_color}:'Waiting Connections' ";
} else {
# If there are no Nginx metrics put something so that the report doesn't barf
$series = "DEF:'cpu_num'='{$rrd_dir}/cpu_num.rrd':'sum':AVERAGE ";
$series .= "LINE2:'cpu_num'#{$mem_swapped_color}:'Nginx metrics not collected' ";
}
$rrdtool_graph['series'] = $series;
return $rrdtool_graph;
}
示例8: graph_network_report
function graph_network_report(&$rrdtool_graph)
{
global $context, $hostname, $mem_cached_color, $mem_used_color, $cpu_num_color, $range, $rrd_dir, $size, $strip_domainname, $graphreport_stats;
if ($strip_domainname) {
$hostname = strip_domainname($hostname);
}
$title = 'Network';
$rrdtool_graph['height'] += $size == 'medium' ? 28 : 0;
if ($graphreport_stats) {
$rrdtool_graph['height'] += $size == 'medium' ? 52 : 0;
$rmspace = '\\g';
} else {
$rmspace = '';
}
if ($context != 'host') {
$rrdtool_graph['title'] = $title;
} else {
$rrdtool_graph['title'] = "{$hostname} Network last {$range}";
}
$rrdtool_graph['lower-limit'] = '0';
$rrdtool_graph['vertical-label'] = 'Bytes/sec';
$rrdtool_graph['extras'] = '--base 1024';
$rrdtool_graph['extras'] .= $graphreport_stats == true ? ' --font LEGEND:7' : '';
if ($size == 'small') {
$eol1 = '\\l';
$space1 = ' ';
$space2 = ' ';
} else {
if ($size == 'medium' || $size == 'default') {
$eol1 = '';
$space1 = ' ';
$space2 = '';
} else {
if ($size == 'large') {
$eol1 = '';
$space1 = ' ';
$space2 = ' ';
}
}
}
$series = "DEF:'bytes_in'='{$rrd_dir}/bytes_in.rrd':'sum':AVERAGE " . "DEF:'bytes_out'='{$rrd_dir}/bytes_out.rrd':'sum':AVERAGE " . "LINE2:'bytes_in'#{$mem_cached_color}:'In{$rmspace}' ";
if ($graphreport_stats) {
$series .= "CDEF:bytesin_pos=bytes_in,0,INF,LIMIT " . "VDEF:bytesin_last=bytesin_pos,LAST " . "VDEF:bytesin_min=bytesin_pos,MINIMUM " . "VDEF:bytesin_avg=bytesin_pos,AVERAGE " . "VDEF:bytesin_max=bytesin_pos,MAXIMUM " . "GPRINT:'bytesin_last':' {$space1}Now\\:%6.1lf%s' " . "GPRINT:'bytesin_min':'{$space1}Min\\:%6.1lf%s{$eol1}' " . "GPRINT:'bytesin_avg':'{$space2}Avg\\:%6.1lf%s' " . "GPRINT:'bytesin_max':'{$space1}Max\\:%6.1lf%s\\l' ";
}
$series .= "LINE2:'bytes_out'#{$mem_used_color}:'Out{$rmspace}' ";
if ($graphreport_stats) {
$series .= "CDEF:bytesout_pos=bytes_out,0,INF,LIMIT " . "VDEF:bytesout_last=bytesout_pos,LAST " . "VDEF:bytesout_min=bytesout_pos,MINIMUM " . "VDEF:bytesout_avg=bytesout_pos,AVERAGE " . "VDEF:bytesout_max=bytesout_pos,MAXIMUM " . "GPRINT:'bytesout_last':'{$space1}Now\\:%6.1lf%s' " . "GPRINT:'bytesout_min':'{$space1}Min\\:%6.1lf%s{$eol1}' " . "GPRINT:'bytesout_avg':'{$space2}Avg\\:%6.1lf%s' " . "GPRINT:'bytesout_max':'{$space1}Max\\:%6.1lf%s\\l' ";
}
$rrdtool_graph['series'] = $series;
return $rrdtool_graph;
}
示例9: graph_apache_response_time_report
function graph_apache_response_time_report( &$rrdtool_graph ) {
global $context,
$cpu_num_color,
$cpu_user_color,
$hostname,
$load_one_color,
$num_nodes_color,
$proc_run_color,
$mem_swapped_color,
$range,
$rrd_dir,
$size,
$strip_domainname;
if ($strip_domainname) {
$hostname = strip_domainname($hostname);
}
$rrdtool_graph['height'] += ($size == 'medium') ? 28 : 0;
$title = 'Apache Resp Times';
if ($context != 'host') {
$rrdtool_graph['title'] = $title;
} else {
$rrdtool_graph['title'] = "$hostname $title last $range";
}
$rrdtool_graph['lower-limit'] = '0';
$rrdtool_graph['vertical-label'] = 'seconds';
$rrdtool_graph['extras'] = '--rigid';
if ( file_exists("$rrd_dir/apache_90th_dur.rrd")) {
$series = "DEF:'apache_90th_dur'='${rrd_dir}/apache_90th_dur.rrd':'sum':AVERAGE ";
$series .="DEF:'apache_avg_dur'='${rrd_dir}/apache_avg_dur.rrd':'sum':AVERAGE ";
$series .="LINE2:'apache_90th_dur'#$cpu_num_color:'90th duration' ";
$series .="LINE2:'apache_avg_dur'#$proc_run_color:'AVG duration' ";
} else {
# If there are no Apache metrics put something so that the report doesn't barf
$series = "DEF:'cpu_num'='${rrd_dir}/cpu_num.rrd':'sum':AVERAGE ";
$series .= "LINE2:'cpu_num'#$mem_swapped_color:'Apache metrics not collected' ";
}
$rrdtool_graph['series'] = $series;
return $rrdtool_graph;
}
示例10: graph_gpu_power_violation_report
function graph_gpu_power_violation_report(&$rrdtool_graph)
{
global $context, $hostname, $mem_shared_color, $mem_cached_color, $mem_buffered_color, $mem_swapped_color, $mem_used_color, $cpu_num_color, $range, $rrd_dir, $size, $strip_domainname;
if ($strip_domainname) {
$hostname = strip_domainname($hostname);
}
$dIndex = $rrdtool_graph["arguments"]["dindex"];
$title = 'GPU' . $dIndex . ' Power Violation';
$rrdtool_graph['title'] = $title;
$rrdtool_graph['lower-limit'] = '0';
$rrdtool_graph['vertical-label'] = '% Violation';
$rrdtool_graph['extras'] = '--rigid --base 1024';
$series = "DEF:'gpu_power_violation'='{$rrd_dir}/gpu" . $dIndex . "_power_violation_report.rrd':'sum':AVERAGE " . "LINE2:'gpu_power_violation'#555555:'GPU" . $dIndex . " Power Violation' " . "CDEF:nice_pos=gpu_power_violation,0,INF,LIMIT " . "VDEF:nice_last=nice_pos,LAST " . "VDEF:nice_min=nice_pos,MINIMUM " . "VDEF:nice_avg=nice_pos,AVERAGE " . "VDEF:nice_max=nice_pos,MAXIMUM " . "GPRINT:'nice_last':' Now\\:%5.0lf' " . "GPRINT:'nice_min':' Min\\:%5.0lf\\l' " . "GPRINT:'nice_avg':' Avg\\:%5.0lf ' " . "GPRINT:'nice_max':' Max\\:%5.0lf\\l' ";
$rrdtool_graph['series'] = $series;
return $rrdtool_graph;
}
示例11: graph_mysql_temporary_objects_report
function graph_mysql_temporary_objects_report(&$rrdtool_graph)
{
global $context, $hostname, $range, $rrd_dir, $size, $strip_domainname;
if ($strip_domainname) {
$hostname = strip_domainname($hostname);
}
$title = 'Mysql Temporary Objects';
if ($context != 'host') {
$rrdtool_graph['title'] = $title;
} else {
$rrdtool_graph['title'] = "{$hostname} {$title} last {$range}";
}
$rrdtool_graph['lower-limit'] = '0';
$rrdtool_graph['extras'] = '--rigid';
$rrdtool_graph['height'] += $size == 'medium' ? 28 : 0;
$series = "DEF:'tables'='{$rrd_dir}/mysql_created_tmp_tables.rrd':'sum':AVERAGE " . "DEF:'disk_tables'='{$rrd_dir}/mysql_created_tmp_disk_tables.rrd':'sum':AVERAGE " . "DEF:'files'='{$rrd_dir}/mysql_created_tmp_files.rrd':'sum':AVERAGE " . "AREA:'tables'#FFAB00:'Temp Tables' " . "LINE:'tables'#837C04:'' " . "LINE:'disk_tables'#F51D30:'Temp Disk Tables' " . "LINE:'files'#157419:'Temp Files' ";
$rrdtool_graph['series'] = $series;
return $rrdtool_graph;
}
示例12: graph_mysql_qcache_report
function graph_mysql_qcache_report(&$rrdtool_graph)
{
global $context, $hostname, $range, $rrd_dir, $size, $strip_domainname;
if ($strip_domainname) {
$hostname = strip_domainname($hostname);
}
$title = 'Mysql Query Cache';
if ($context != 'host') {
$rrdtool_graph['title'] = $title;
} else {
$rrdtool_graph['title'] = "{$hostname} {$title} last {$range}";
}
$rrdtool_graph['lower-limit'] = '0';
$rrdtool_graph['extras'] = '--rigid';
$rrdtool_graph['height'] += $size == 'medium' ? 28 : 0;
$series = "DEF:'hits'='{$rrd_dir}/mysql_qcache_hits.rrd':'sum':AVERAGE " . "DEF:'inserts'='{$rrd_dir}/mysql_qcache_inserts.rrd':'sum':AVERAGE " . "DEF:'not_cached'='{$rrd_dir}/mysql_qcache_not_cached.rrd':'sum':AVERAGE " . "DEF:'lowmem_prunes'='{$rrd_dir}/mysql_qcache_lowmem_prunes.rrd':'sum':AVERAGE " . "AREA:'hits'#EAAF00:'Hits' " . "STACK:'inserts'#157419:'Inserts' " . "STACK:'not_cached'#00A0C1:'Not Cached' " . "STACK:'lowmem_prunes'#FF0000:'Low-Memory Prunes' ";
$rrdtool_graph['series'] = $series;
return $rrdtool_graph;
}
示例13: graph_mysql_query_report
function graph_mysql_query_report(&$rrdtool_graph)
{
global $context, $hostname, $range, $rrd_dir, $size, $strip_domainname;
if ($strip_domainname) {
$hostname = strip_domainname($hostname);
}
$title = 'Mysql Query Report';
if ($context != 'host') {
$rrdtool_graph['title'] = $title;
} else {
$rrdtool_graph['title'] = "{$hostname} {$title} last {$range}";
}
$rrdtool_graph['lower-limit'] = '0';
$rrdtool_graph['extras'] = '--rigid';
$rrdtool_graph['height'] += $size == 'medium' ? 28 : 0;
$series = "DEF:'questions'='{$rrd_dir}/mysql_questions.rrd':'sum':AVERAGE " . "DEF:'qc_hits'='{$rrd_dir}/mysql_qcache_hits.rrd':'sum':AVERAGE " . "DEF:'select'='{$rrd_dir}/mysql_com_select.rrd':'sum':AVERAGE " . "DEF:'insert'='{$rrd_dir}/mysql_com_insert.rrd':'sum':AVERAGE " . "DEF:'update'='{$rrd_dir}/mysql_com_update.rrd':'sum':AVERAGE " . "DEF:'replace'='{$rrd_dir}/mysql_com_replace.rrd':'sum':AVERAGE " . "DEF:'delete'='{$rrd_dir}/mysql_com_delete.rrd':'sum':AVERAGE " . "AREA:'questions'#CCCCCC:'Questions' " . "AREA:'select'#0000FF:'Select' " . "STACK:'delete'#FF0000:'Delete' " . "STACK:'insert'#00FFFF:'Insert' " . "STACK:'update'#FF00FF:'Update' " . "STACK:'replace'#2175D9:'Replace' " . "STACK:'qc_hits'#00FF00:'QC Hits' " . "LINE:'questions'#00000033:'' ";
$rrdtool_graph['series'] = $series;
return $rrdtool_graph;
}
示例14: graph_mysql_innodb_io_report
function graph_mysql_innodb_io_report(&$rrdtool_graph)
{
global $context, $hostname, $range, $rrd_dir, $size, $strip_domainname;
if ($strip_domainname) {
$hostname = strip_domainname($hostname);
}
$title = 'Mysql InnoDB I/O';
if ($context != 'host') {
$rrdtool_graph['title'] = $title;
} else {
$rrdtool_graph['title'] = "{$hostname} {$title} last {$range}";
}
$rrdtool_graph['lower-limit'] = '0';
$rrdtool_graph['extras'] = '--rigid';
$rrdtool_graph['height'] += $size == 'medium' ? 28 : 0;
$series = "DEF:'file_reads'='{$rrd_dir}/mysql_innodb_data_reads.rrd':'sum':AVERAGE " . "DEF:'file_writes'='{$rrd_dir}/mysql_innodb_data_writes.rrd':'sum':AVERAGE " . "DEF:'file_syncs'='{$rrd_dir}/mysql_innodb_data_fsyncs.rrd':'sum':AVERAGE " . "DEF:'log_writes'='{$rrd_dir}/mysql_innodb_log_writes.rrd':'sum':AVERAGE " . "LINE2:'file_reads'#ED7600:'File Reads' " . "LINE2:'file_writes'#157419:'File Writes' " . "LINE2:'file_syncs'#4444FF:'File Syncs' " . "LINE2:'log_writes'#DA4725:'Log Writes' ";
$rrdtool_graph['series'] = $series;
return $rrdtool_graph;
}
示例15: graph_mysql_innodb_bp_activity_report
function graph_mysql_innodb_bp_activity_report(&$rrdtool_graph)
{
global $context, $hostname, $range, $rrd_dir, $size, $strip_domainname;
if ($strip_domainname) {
$hostname = strip_domainname($hostname);
}
$title = 'Mysql InnoDB Buffer Pool Activity';
if ($context != 'host') {
$rrdtool_graph['title'] = $title;
} else {
$rrdtool_graph['title'] = "{$hostname} {$title} last {$range}";
}
$rrdtool_graph['lower-limit'] = '0';
$rrdtool_graph['extras'] = '--rigid';
$rrdtool_graph['height'] += $size == 'medium' ? 28 : 0;
$series = "DEF:'created'='{$rrd_dir}/mysql_innodb_pages_created.rrd':'sum':AVERAGE " . "DEF:'read'='{$rrd_dir}/mysql_innodb_pages_read.rrd':'sum':AVERAGE " . "DEF:'written'='{$rrd_dir}/mysql_innodb_pages_written.rrd':'sum':AVERAGE " . "AREA:'created'#FFAB00:'Pages Created' " . "STACK:'read'#D8ACE0:'Pages Read' " . "STACK:'written'#7CB3F1:'Pages Written' " . "LINE:'0'#5291D3:'':STACK ";
$rrdtool_graph['series'] = $series;
return $rrdtool_graph;
}