Analytics on Hash Arrays:-

Description of data:

Each server gathers metrics FC_IO_BY_R and FC_IO_BY_W for every one minute, and these metrics values are cumulative and also number of servers are unknown(can be upto 16 servers).

Requirement:-

I need to report metric values by subtracting the current metric value with the previous metric value(oldest one) within the Hour or Day group on the same server and get the definite value but not the cumulative value and report it for every one Hour and for each Day by adding values from all the servers. Please note that total number of servers are unknown, it can be derived by first column name in the DATA which total number of distinct server names.

How can I get the below report ? I know there should be some way using Hash Arrays.

Frequency Hour: --------------- CollectionTime FC_IO_BY_R(server01 + server02) FC_IO_BY_W(server01 + server02) 2015-06-23T21 1050 + 360 = 1410 115 + 98 = 213 2015-06-23T22 4342 + 2470 = 6812 775 + 826 = 1601 Frequency Day: --------------- CollectionTime FC_IO_BY_R(server01 + server02) FC_IO_BY_W(server01 + server02) 2015-06-23 5623 + 3452 = 9075 984 + 1042 = 2026 2015-06-24

Below is not complete data, but it should be sufficient enough to get the pattern of data. And also I don't want to mess up this forum. Also please let me know if the requirement is not clear enough.

__DATA__ server01: 2015-06-23T21:58:05-05:00 FC_IO_BY_R 13,5 +50,785 MB server01: 2015-06-23T21:58:05-05:00 FC_IO_BY_W 6,89 +2,224 MB server01: 2015-06-23T21:59:05-05:00 FC_IO_BY_R 13,5 +51,835 MB server01: 2015-06-23T21:59:05-05:00 FC_IO_BY_W 6,89 +2,339 MB server01: 2015-06-23T22:00:05-05:00 FC_IO_BY_R 13,5 +52,066 MB server01: 2015-06-23T22:00:05-05:00 FC_IO_BY_W 6,89 +2,433 MB server01: 2015-06-23T22:01:05-05:00 FC_IO_BY_R 13,5 +53,303 MB server01: 2015-06-23T22:01:05-05:00 FC_IO_BY_W 6,89 +2,590 MB server01: 2015-06-23T22:02:05-05:00 FC_IO_BY_R 13,5 +55,006 MB server01: 2015-06-23T22:02:05-05:00 FC_IO_BY_W 6,89 +2,836 MB server01: 2015-06-23T22:03:05-05:00 FC_IO_BY_R 13,5 +56,007 MB server01: 2015-06-23T22:03:05-05:00 FC_IO_BY_W 6,89 +2,961 MB server01: 2015-06-23T22:04:05-05:00 FC_IO_BY_R 13,5 +56,201 MB server01: 2015-06-23T22:04:05-05:00 FC_IO_BY_W 6,89 +3,086 MB server01: 2015-06-23T22:05:05-05:00 FC_IO_BY_R 13,5 +56,408 MB server01: 2015-06-23T22:05:05-05:00 FC_IO_BY_W 6,89 +3,208 MB server02: 2015-06-23T21:58:54-05:00 FC_IO_BY_R 13,4 +70,021 MB server02: 2015-06-23T21:58:54-05:00 FC_IO_BY_W 7,43 +1,544 MB server02: 2015-06-23T21:59:54-05:00 FC_IO_BY_R 13,4 +70,381 MB server02: 2015-06-23T21:59:54-05:00 FC_IO_BY_W 7,43 +1,642 MB server02: 2015-06-23T22:00:54-05:00 FC_IO_BY_R 13,4 +71,003 MB server02: 2015-06-23T22:00:54-05:00 FC_IO_BY_W 7,43 +1,760 MB server02: 2015-06-23T22:01:54-05:00 FC_IO_BY_R 13,4 +71,334 MB server02: 2015-06-23T22:01:54-05:00 FC_IO_BY_W 7,43 +1,980 MB server02: 2015-06-23T22:02:54-05:00 FC_IO_BY_R 13,4 +71,629 MB server02: 2015-06-23T22:02:54-05:00 FC_IO_BY_W 7,43 +2,196 MB server02: 2015-06-23T22:03:54-05:00 FC_IO_BY_R 13,4 +71,947 MB server02: 2015-06-23T22:03:54-05:00 FC_IO_BY_W 7,43 +2,307 MB server02: 2015-06-23T22:04:54-05:00 FC_IO_BY_R 13,4 +72,575 MB server02: 2015-06-23T22:04:54-05:00 FC_IO_BY_W 7,43 +2,418 MB server02: 2015-06-23T22:05:54-05:00 FC_IO_BY_R 13,4 +73,473 MB server02: 2015-06-23T22:05:54-05:00 FC_IO_BY_W 7,43 +2,586 MB

In reply to Analytics on Hash Arrays by yasser8@gmail.com

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.