Hi Cyril,

On Tue, Feb 01, 2011 at 11:10:54PM +0100, Cyril Bonté wrote:
> Hi all,
> 
> I'd be very pleased if someone can give a try to this patch and give me some
> feedbacks. I started to write it more than a month ago and couldn't find time
> to finalize it. Now it is :-)

I'll talk to Emeric and Hervé about this, I know they generally have
insightful opinion on whatever is related to stats and monitoring.

> Willy, I've refactored the session structure to reduce the memory footprint of
> this command, let me know if it's ok for you.

OK I'll review that, thanks for letting me know. If there are many changes,
we'll merge them as separate patches to ease merging of other patches.

> I successfully used it on a small server for about a month without any issue
> (in a slightly different version). But as each configuration can bring its own
> bugs, I wish it can be tested on various ones before being merged.
> 
> I'll try to work on the documentation by the end of the week. Here is a short
> description of how to use it :
> 
> Syntax :
> show conds [clear] [<proxy id> [<cond id> [<suite id> [<term id>]]]]
> 
> Those ids follow haproxy internals, where :
> - "term" : can be compared to an acl in the configuration (named or anonymous)
> - "suite" : a suite is a list of terms separed by "AND" operators, each "OR"
>   begins a new suite.
> - "cond" : is the whole condition (if or unless)
> 
> Example :
> acl missing_cl hdr_cnt(Content-length) eq 0
> block if HTTP_URL_STAR !METH_OPTIONS || METH_POST missing_cl
>          |---term1---| |---term2---|    |-term1-| |--term2-|
>          |---------suite1----------|    |------suite2------|
>       |-----------------------cond1------------------------|
> 
> Usage :
> "show conds" :
>   will display every statistics.
> 
> "show conds 1" :
>   will only display the statistics of the proxy #1.
> 
> "show conds 1 1" :
>   will only display the first condition of the proxy #1, with the detailed
>   statistics of each terms.
> 
> "show conds 1 1 2" :
>   will only display the terms of the second suite.
> 
> "show conds 1 1 0" :
>   This is a special case to only display the condition statistics, without its
>   terms details.
> 
> "show conds 1 1 2 2" :
>   Used to extract only a specific term.
> 
> By preceeding those ids by the keyword "clear", the counters that matched are
> reset to 0 after being displayed.
> 
> The output is in CSV format.
> Using the previous example, this will give something like :
> pct,pass,fail,path,detail
> ,,,1-0-0-0,[PROXY test (#1) h5.cfg]
> 0.00,0,0,1-1-0-0,[IF line 6]
> 0.00,0,0,1-1-1-1,HTTP_URL_STAR
> 0.00,0,0,1-1-1-2,!METH_OPTIONS
> ,,,1-1-2-0,[OR]
> 0.00,0,0,1-1-2-1,METH_POST
> 0.00,0,0,1-1-2-2,missing_cl
> 
> (and for readability)
> pct   pass  fail  path     detail
>                   1-0-0-0  [PROXY test (#1) h5.cfg]

I'm realizing soemthing here, we should say PROXY, FRONTEND or BACKEND
depending on the type of the proxy, because you can have a frontend and
a backend with the same name.

> 0.00  0     0     1-1-0-0  [IF line 6]
> 0.00  0     0     1-1-1-1  HTTP_URL_STAR
> 0.00  0     0     1-1-1-2  !METH_OPTIONS
>                   1-1-2-0  [OR]
> 0.00  0     0     1-1-2-1  METH_POST
> 0.00  0     0     1-1-2-2  missing_cl
> 
> I hope it's clear enough for a first approach ;-)

Yes it is, thank you very much for that, Cyril.

Cheers,
Willy


Reply via email to