Skip to content

Simple ruby script to explain log-lines from haproxy (Timings, queue connections, etc) so you don't have to look up the fields from the docs.

Notifications You must be signed in to change notification settings

phillipp/haproxy-explain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

haproxy-explain

Let's say you have the following log-line from a haproxy HTTP log file:

Jan 20 15:46:00 localhost haproxy[3167]: 127.0.0.1:38052 [20/Jan/2015:15:46:00.116] http-in zeus-apache/megatron 0/0/6/11/17 200 314 - - ---- 68/20/1/0/0 0/0 - "GET /index.html HTTP/1.0"

Now you want to know how long each step of the processing took, how many requests were queued etc. You can look it up the docs, but that takes some time. Why not let it explain to you like this?

cat your_request.log | ruby explain.rb

Or from the clipboard:

cat - | ruby explain.rb

You will get a nice explanation for each request, like this:

[Timings]
Waiting for request:      0 ms
Waiting in queue:         0 ms
Connection to backend:    6 ms (including retries)
Waiting for HTTP headers: 11 ms (without sending data)
Time to transmit data:    0 ms
End-to-End timing:        17 ms

[HTTP Request]
Response code: 200
Bytes read:    314 (314 Bytes)

[Connections and Queueing]
Connections at the time of logging:
Process:  68
Frontend: 20
Backend:  1
Server:   0
Retries:  0

Requests before this one in queues:
Server queue:  0
Backend queue: 0

Just for me it's easier to read ;-)

Installation

Just install active_support (fo the number helper) gem and you're all set:

gem install activesupport

About

Simple ruby script to explain log-lines from haproxy (Timings, queue connections, etc) so you don't have to look up the fields from the docs.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages