pcp
[Top] [All Lists]

Re: Output format

To: Patrick Aland <paland@xxxxxxxxxxx>
Subject: Re: Output format
From: Ken McDonell <kenmcd@xxxxxxxxxxxxxxxxx>
Date: Wed, 24 Jan 2001 10:37:32 +1100
Cc: pcp@xxxxxxxxxxx
In-reply-to: <20010123161504.K16498@xxxxxxxxxxx>
Reply-to: kenmcd@xxxxxxx
Sender: owner-pcp@xxxxxxxxxxx
On Tue, 23 Jan 2001, Patrick Aland wrote:

> Which program will take the pcp data and output it in a certain format?
> Mainly I am looking to use our current system which take logs of the form
> 
> [column1_name]        [column2_name]  ...     [columnx_name]
> [column1_data]        [column2_data]  ...     [columnx_data]
> [column1_data]        [column2_data]  ...     [columnx_data]
> [column1_data]        [column2_data]  ...     [columnx_data]
> [column1_data]        [column2_data]  ...     [columnx_data]
> 
> I think i could use pmie to do this but am not sure. Any help is appreciated. 
> Thanks. 

depends a little ... can you expand on what columnx_name might be?

If these are instance of a single metric, pmval will do this
out of the box.

If these are different metrics (with or without instances), then
if you have the IRIX or pcp-pro pieces, pmdumptext will do this,
otherwise something like ...

cat <<End-of-File \
| pmie \
| some-awk
column1_name=some expression;
column2_name=some other expression;
column3_name=a third expression;
...
End-of-File

To be more concrete, here's a pmie script ...

load_1 = kernel.all.load #'1 minute';
idle = kernel.all.cpu.idle;
EOL = hinv.ncpu;

The EOL line is a sentinel and special in what follows, so there
are 2 metrics being reported here.

Running pmie -v produces ...

load_1: 3.70
idle: ?
EOL: 12

load_1: 3.55
idle: 8.3
EOL: 12

load_1: 3.20
idle: 9.9
EOL: 12

load_1: 3.04
idle: 9.4
EOL: 12

load_1: 3.22
idle: 8.6
EOL: 12

Now feed this to pmie2col (a quick and dirty awk script, copy attached)
and you get ...

 load_1:   idle:
    3.70       ?
    3.55    8.30
    3.20    9.90
    3.04    9.40
    3.22    8.60

Attachment: pmie2col
Description: pmie2col

<Prev in Thread] Current Thread [Next in Thread>