toddy has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I am new to perl but have managed to create a script to gather performance stats from the Unix box I am working on. The script outputs the information to a comma seperated file so the output is like: Time,IO/s,CPU....... 10:20:15,100.95,87.3....... I want to produce a script to generate a results doc which will take the figures from the file and produce graphs such as CPU over Time and IO/s over Time, however I do not know where to begin. Any advice would be helpful. I see there is a CPAN module which could help but all documentation says to install 'Some::Module' but all I know is that the module is called GD. Cheers, Tom

Replies are listed 'Best First'.
Re: Creating and writing Graphs to File
by AcidHawk (Vicar) on Jan 14, 2003 at 12:19 UTC

    Hi,

    Some GD docs GD.pm or the GD::Graph FAQ or the GD::Graph::Map site

    I have whacked a simple piece of code together for this type of thing. I am outputting the GD stuff to a PNG file and then displaying this in a web page.

    This script is purely a sample it displays GD::Graph as well as GD::Graph::Map which allows you to click on the bar and output a further query that is run in from the @urls script not show here.

Re: Creating and writing Graphs to File
by Tanalis (Curate) on Jan 14, 2003 at 12:01 UTC
    I think the module you're meaning is GD::Graph. This seems to be able to do what you need, according to its docs, though I haven't used it so can't say for sure.

    Info about installing modules is on CPAN.

    Hope that helps some ..
    -- Foxcub

(jeffa) Re: Creating and writing Graphs to File
by jeffa (Bishop) on Jan 14, 2003 at 14:23 UTC
    GD::Graph is really nice. You will need to install GD as well. I recommend you install the latest version (2.06 as of the date of this node) which requires libgd version 2.0.5 or higher (which you can get at http://www.boutell.com/gd/)

    jeffa

    L-LL-L--L-LL-L--L-LL-L--
    -R--R-RR-R--R-RR-R--R-RR
    B--B--B--B--B--B--B--B--
    H---H---H---H---H---H---
    (the triplet paradiddle with high-hat)