Windows has performance counters that can be used to track this, and even graph it. Head to Administrative Tools in the Control Panel and select Performance. you can see it charted in real time in System Monitor (right-click, Add Counter, ...) or log it using Counter Logs (right-click, New Log Settings, ...). I think there's a way to graph logs, but I didn't look for it since you wanted to use perl.

When logging, you have the option of starting a new file and/or having a program automatically launched every X time units. You could use this to lauch a perl script to analyse the logs regularly. (Maybe it passes the log name as an arg?? Maybe only if you specify %1??).

There a few file formats available (binary, CSV, TSV, binary circlular). Binary appears to be a list of packed timestamped samples preceeded with a header. You might be able to find some info on it if you search, or it should be pretty easy to deduce enough to use it. Or you could simply use CSV, which looks as follow:

"(PDH-CSV 4.0) (Eastern Daylight Time)(240)","\Network Interface(D-Lin +k DFE-530TX PCI Fast Ethernet Adapter)\Bytes Total/sec" "09/07/2004 16:55:52.920","197.72459904908843" "09/07/2004 16:56:07.922","8463.4043604248636" "09/07/2004 16:56:22.924","3580.6992148876643" "09/07/2004 16:56:37.926","3465.1013327365235" "09/07/2004 16:56:52.928","3496.5035571311519" "09/07/2004 16:57:07.930","3578.1525481840044"

(This should give a hint as to the fields in the bin format, btw)


In reply to Logging and Analysing Performance Counters in Windows by ikegami
in thread Bandwidth measurement with Perl? by DaWolf

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.