Hi perlmonks, I'm relativley new to perl and I have a problem which I cannot seem to get my head around. I need to create an ASCII chart, which displays jobs that are running, or a list of jobs that were queuing at a particular time. The perl program will read a file which contains the following information:
Queue Queued Start End queuea 1161611468 1161612964 1161657611 queueb 1161612303 1161648292 1161674374 queuec 1161620067 1161620070 1161651772 queued 1161622109 1161622114 1161662607 queueb 1161626408 1161626414 1161650011 queueb 1161628081 1161628085 1161658563 queued 1161629319 1161651912 1161652722 queuea 1161629632 1161630900 1161649776 queuea 1161630141 1161646804 1161656606 queuec 1161632731 1161632986 1161670456 queuec 1161633898 1161633929 1161656900 queuea 1161635242 1161635247 1161703541 queueb 1161635268 1161635275 1161653284 queueb 1161635472 1161635479 1161657667 queueb 1161636392 1161636399 1161652133 queueb 1161636691 1161636698 1161652313 queueb 1161636780 1161636785 1161654656 queueb 1161638253 1161638258 1161652124 queued 1161638845 1161638851 1161652164 queueb 1161639646 1161639656 1161656089 queuea 1161639811 1161672455 1161672927 queued 1161639955 1161639958 1161650644 queued 1161640162 1161640165 1161651353 queued 1161640340 1161640343 1161650555 queued 1161640545 1161640547 1161652089 queued 1161641176 1161641181 1161651069 queued 1161641484 1161641488 1161652164 queued 1161643078 1161643083 1161653237
I've cut the above file down, it would be a lot longer for a whole day. as you can see the times are all in epoch time. I will need to display a chart, that has the time going down vertically on the chart and the name of the queue at the top. The problem is I need to be able to set the time unit, for example if I wanted to see how many jobs were queued each hour for a day, I would set the time variable to 60 and it would list every hour of the day down the Y axis with how many jobs were queued and how many jobs were running at that time, as well as the queue the job belonged to. The chart would look like this:
Date: 26/10/06 Time Queue Queued Running ----------------------------------------------------- 0:00 queuea 2 1 queueb 3 0 queuec 4 4 queued 0 6 ----------------------------------------------------- 1:00 queuea 0 1 queueb 0 10 queuec 5 2 queued 3 5 -----------------------------------------------------
and so on for the rest of the hours of the day. I just need to know how to build a program in perl to obtain those results. I know basic perl, for example I know how to read the file in and pass parameters with use getopt, but im not sure how to go about getting the results. I hope I explained this clearly enough. Can anybody help please?

In reply to ASCII chart that displays jobs that are running and jobs that are queued for a day by wishartz

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.