Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Display the page load time #262

Merged
merged 1 commit into from

2 participants

@alexandru-iacob

The plugin will generate a graph that displays the page load time
We need to add our custom log format into Apache config.
The plugin was tested on Ubuntu Server 12.04.02 LTS - munin version
1.4.6
LogFormat "%h %l %u %t \"%r\" %>s %O %b %D \"%{Referer}i\"
\"%{User-Agent}i\"" custom

Alexandru Iacob Display the page load time
The plugin will generate a graph that displays the page load time
We need to add our custom log format into Apache config.
The plugin was tested on Ubuntu Server 12.04.02 LTS - munin version
1.4.6
LogFormat "%h %l %u %t \"%r\" %>s %O %b %D \"%{Referer}i\"
\"%{User-Agent}i\"" custom
1d2ba32
@kenyon kenyon merged commit 10de3ab into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 20, 2013
  1. Display the page load time

    Alexandru Iacob authored
    The plugin will generate a graph that displays the page load time
    We need to add our custom log format into Apache config.
    The plugin was tested on Ubuntu Server 12.04.02 LTS - munin version
    1.4.6
    LogFormat "%h %l %u %t \"%r\" %>s %O %b %D \"%{Referer}i\"
    \"%{User-Agent}i\"" custom
This page is out of date. Refresh to see the latest.
Showing with 59 additions and 0 deletions.
  1. +59 −0 plugins/apache/page_load
View
59 plugins/apache/page_load
@@ -0,0 +1,59 @@
+#!/bin/sh
+
+# Copyright (C) 2013 Alexandru Iacob
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+######################################################################################################
+# The plugin will generate a graph that displays the page load time
+# We need to add our custom log format into Apache config.
+# The plugin was tested on Ubuntu Server 12.04.02 LTS
+#
+# apache2.conf
+# LogFormat "%h %l %u %t \"%r\" %>s %O %b %D \"%{Referer}i\" \"%{User-Agent}i\"" custom
+#
+# Acording to : http://httpd.apache.org/docs/2.2/mod/mod_log_config.html
+# %D The time taken to serve the request, in microseconds.
+# In our case %D -> 9
+######################################################################################################
+# GLOBALS
+LOGFILE="/var/log/apache2/access.log"
+BUFFER_SIZE=500
+
+######################################################################################################
+
+
+do_ () {
+ command="tail -n $BUFFER_SIZE $LOGFILE | awk '{sum=sum+\$9} END {print \"exec_time.value \"(sum/$BUFFER_SIZE)/1000000}'"
+ eval $command
+ exit 0
+}
+
+do_config () {
+ echo "graph_title Average page execution time"
+ echo "graph_vlabel Seconds"
+ echo "graph_category apache"
+ echo "graph_args --base 1000 -l 0"
+ echo "graph_info Average page execution time"
+
+ echo "exec_time.label Execution time"
+ echo "exec_time.type GAUGE"
+}
+
+case $1 in
+ config|'')
+ eval do_$1
+esac
+
+exit $?
Something went wrong with that request. Please try again.