Giter Club home page Giter Club logo

pagetime-analyzer's Introduction

=== PageTime Analyzer ====

Page time analyzer is a package that allows you to compute per page/URL performance
information. Currently following stats are supported

- total number of requests
- aggregate compute time
- average request time
- 90th percentile time


Requirements
============

You will need 

- Python 2.4+ 
- Memcache server
- PHP with Memcache support (specifically http://pecl.php.net/package/memcache)
- Web access logs that record request timing. You can find info how to turn it on in Apache
  here http://vuksan.com/linux/ganglia/index.html#Apache_Traffic_Stats

Installation
============

Clone the repository. Within the repository there are two directories.

CLI
===

This directory contains a tool written in Python that parses logs. You will need to change 
following things.

In parse_log.py:
   Adjust lesspipe_path to a cat like utility. lesspipe is a wrapper that recognizes compressed
   archives etc.
   
In PageTimeAnalyzer.py
   Need to adjust following variables
   
   self.reg  which is used to match your log files
   
   self.ignore_patterns = "(.png|.jpg|.gif)"
   
   
Following are options to parse_log.py

  -l LOG_FILE, --log_file=LOG_FILE
                        The path to the file to parse
  -s SERVER, --server=SERVER
                        Name of the memcache server where data is stored.
                        Defaults to localhost if none supplied
  -n INSTANCE_NAME, --instance_name=INSTANCE_NAME
                        Name of the instance/web server for which we are
                        processing logs


Now run it e.g.

python parse_log.py -l access_log.web01.gz -n web01 -s memcache01 

What this will do is store every response time for non-ignored URLs in memcache. Response times
are grouped by hour (we can change that in the future). It doesn't actually compute anything.

WEB
===

Contains the Web GUI and a script that computes all the stats. This has to do with our 
goal of eventually providing real-time statistics.

To configure the Web GUI you need to create copy the contents of the web directory into 
your web tree ie. /var/www/html/pagetime-analyzer. Then you need to create a file called
config.php where you can override any of the values present in config.default.php. In 
general you just need to point to your memcache server e.g.

<?php

$memcache_server = "memcache01";

?>


To actually compute the data you need to invoke the batch_analyzer.php with secret=1 argument ie.

wget -O - http://localhost/pagetime-analyzer/batch_analyzer.php?secret=1

This will take a bit but once it's done you will have your data available by visiting

http://localhost/pagetime-analyzer/

It should look something like this

http://vuksan.com/blog/wp-content/uploads/2010/07/pt_overview.png
http://vuksan.com/blog/wp-content/uploads/2010/07/pt_url_breakdown.png

You will need to run batch_analyzer.php any time you add more data.


WARNING
=======

All the computed data is stored in Memcache infinitely however it will all disappear if you
restart it. In next release I will try to put it in a more of a permanent storage. I haven't
decided yet whether it will be something like Membase or CouchDB. Stay tuned.


===============================================================================================
###  Released under the GPL v2 or later.
###  For a full description of the license, please visit http://www.gnu.org/licenses/gpl.txt

pagetime-analyzer's People

Stargazers

 avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.