===
OWM version 1.7 February 2017
===

A tool meant to help answer the question "How lean is my program?"

OWM runs a specified program and samples its performance until
completion.  Then the final measurements are displayed, and may
optionally be saved as a textual report or CSV data.

OWM is not a profiler.  It only reports final bulk statistics.
These are not precise since after process termination values are
not available.  Instead it samples roughly 10 times per second
until statistics are no longer retrievable.


Saving

When data is saved to an existing report or CSV file it is appended
to the end.

Effort is made to be locale-aware when writing reports and CSV data.
This means respecting "comma as decimal point" and delimiting output
columns with semicolons in such cases.  Other locale formats should
work automatically as well.  In the report text the appropriate
"thousands separators" should be used as well.

CSV text values are always wrapped in quotes (") with quote
characters escaped by doubling (as "").  No other escaping is
attempted.

CSV output files always use the ANSI encoding of the current locale.


Requirements

Requires at least Windows 2000, but some things might fail before
Windows Vista.  Only tested on Windows 10.


Program flow of OWM

  Sub Main
    o Load saved (or default) settings.
    o Show Parameters Form as modal dialog:
      * Close: Quits without saving.
      * Run: Hands off control to Run Form.

  Run Form (initializing):
    o Minimizes and runs specified child program:
      * Failed:
        + Restores from minimized.
        + Displays error message.
      * Succeeded: Starts timer control.

  Run Form (child running and timer ticking):
    o Abort menu:
      * Stops timer.
      * Kills child process.
      * Displays message.
    o Timer:
      * Takes statistics snapshot if still possible.
      * Checks for child process completion.
        When complete:
          + Stops timer.
          + Gets ExitCode.
          + Reports statistics.
          + Hides abort menu, shows save menu.
          + Restores from minimized.

  Run Form (child finished and timer stopped):
    o Save menu: Saves statistics as CSV or displayed statistics as
      text file.
    o Close:
      * Saves settings.
      * Exits program.


Stats gathered by OWM

    o General:
      * Program.
      * Run date and time.
      * Note (optional single-line text entered by the user).
      * ExitCode.
      * Termination (0=Normal, 1=Unhandled exception, 2=Aborted,
                     3=Failed to get ExitCode, but case 1 is not
                     detected for a Windows Subsystem process).
      * Run elapsed time (Exit - Creation).
    o CPU:
      * Kernel time.
      * User time.
      * Total time.
    o I/O:
      * Read Operations.
      * Write Operations.
      * Other Operations.
      * Total Operations.
      * Read Bytes Transferred.
      * Write Bytes Transferred.
      * Other Bytes Transferred.
      * Total Bytes Transferred.
    o Memory:
      * Page Faults.
      * Peak WorkingSet Size.
      * Average WorkingSet Size.
      * Peak Shared WorkingSet Size.
      * Average Shared WorkingSet Size.
      * Peak Private WorkingSet Size.
      * Average Private WorkingSet Size.
      * Peak PagedPool Usage.
      * Peak NonPagedPool Usage.
      * Peak Pagefile Usage.


CSV output column names

    Program, Timestamp, Note, ExitCode, Termination,
    Elapsed, CPUKernel, CPUUser, CPUTotal,
    IOReadOps, IOWriteOps, IOOtherOps, IOTotalOps,
    IOReadBytes, IOWriteBytes, IOOtherBytes, IOTotalBytes,
    MemPageFaults,
    MemPeakTWS, MemAvgTWS,
    MemPeakSWS, MemAvgSWS,
    MemPeakPWS, MemAvgPWS,
    MemPeakPP, MemPeakNPP,
    MemPeakPagefile


Sample report (U.S. English locale)

                        Program ExportQuery.exe
              Run date and time 2/2/2017 1:09:14 PM
                           Note 
                      Exit code 0
                    Termination Normal
                   Elapsed time 2,074 ms
               CPU: Kernel time 62 ms
                 CPU: User time 953 ms
                CPU: Total time 1,015 ms
           I/O: Read operations 119
          I/O: Write operations 149
          I/O: Other operations 295
          I/O: Total operations 563
    I/O: Read bytes transferred 2,408,900 bytes
   I/O: Write bytes transferred 607,823 bytes
   I/O: Other bytes transferred 4,012 bytes
   I/O: Total bytes transferred 3,020,735 bytes
            Memory: Page faults 6,127
  Memory: Peak total workingset 22,450,176 bytes
   Memory: Avg total workingset 22,437,374 bytes
 Memory: Peak shared workingset 11,223,040 bytes
  Memory: Avg shared workingset 11,210,238 bytes
Memory: Peak private workingset 11,227,136 bytes
 Memory: Avg private workingset 11,227,136 bytes
   Memory: Peak pagedpool usage 166,912 bytes
Memory: Peak nonpagedpool usage 8,960 bytes
    Memory: Peak pagefile usage 13,578,240 bytes
