## Class monitorPatterns

- java.lang.Object
- - monitorPatterns

-     public class monitorPatterns
      extends java.lang.Object

  Report command performance statistics.

  This class is a java program to create two command statistics reports. Both reports provide statistics on all commands executed on a particular server. The reports are run repeatedly at a specified interval of seconds until a "stop" file is created to signal the program to stop.

  The first report, called the cumulative report, lists the statistics for all commands since the start of the server.

  The second report, called the interval report, lists the statistics for the time period since the last report.

  OUTPUT FORMAT:

  The reports are output as a CSV format file. The first line names the columns. Each subsequent line gives the statistics for one of the internal commands on the server. For each report cycle all command are reported even if there were no commands received during that cycle. The columns are (unless otherwise noted all time values are in milli-seconds):

  rep_date

  A date stamp (yyyy-mm-dd-HH-MM-SS) of when the report was generated.

  cmd_name

  Internal name for the command.

  rep_start_time

  The actual starting time for the report. This is in internal clock ticks from a system dependent starting point.

  rep_end_time

  The actual ending time for the report. In same clock tick notation as rep_start_time.

  rep_duration

  The time period covered by the report.

  number_cmds

  The number of commands received by the server during this time period.

  For the following full time is from the time the connection for the command was accepted until the send of the response was completed. Note: the time spent waiting on the TPC/IP stack to be accepted is not known to the server process and not reflected in these times.

  min_full_time The minimum time take to process a command.

  max_full_time The maximum time taken to process a command.

  avg_full_time The average time taken to process a command.

  total_full_time The total time spent processing all of these commands.

  For the following processing time is the time spent actually processing the command. It does not include overhead items such as reading input and writing output, or time spent waiting for a command thread to become available.

  min_proc_time The minimum time take to process a command.

  max_proc_time The maximum time taken to process a command.

  avg_proc_time The average time taken to process a command.

  total_proc_time The total time spent processing all of these commands.

  For the following Overhead time is essentially (Full time)-(Process time).

  min_overhead_time The minimum time take to process a command.

  max_overhead_time The maximum time taken to process a command.

  avg_overhead_time The average time taken to process a command.

  total_overhead_time The total time spent processing all of these commands.

  max_throughput

  The maximum throughput figure for this command in terms of commands / second measured over any one minute period during the report period.

- - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static void` | `main​(java.lang.String[] args)` | Run the report statistics command.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### main

          public static void main​(java.lang.String[] args)
                           throws java.lang.Exception

      Run the report statistics command.

      SYNOPSIS:

           java -jar monitorPatterns.jar [-host host-name]
                                         [-port port-number]
                                         [-cumulative_file cum-file-name]
                                         [-interval_file int-file-name]
                                         [-report_interval interval]
                                         [-stop_file stop-file-name]

      ARGUMENTS:

      host-name the Patterns server IP address or URL. Default: 127.0.0.1

      port the port number the Patterns server is listening on. Default: 5051

      cum-file-name the name of the cumulative report file. Default: yyyy-mm-dd-HH-MM-SS_cumulative.csv (where yyyy-mm-dd-HH-MM-SS is date and time cmd was run).

      int-file-name the name of the interval report file. Default: yyyy-mm-dd-HH-MM-SS_interval.csv (where yyyy-mm-dd-HH-MM-SS is date and time cmd was run).

      interval A floating point value, the number of seconds between report runs. This is the time period covered by the interval report. Default: 60.0 seconds.

      stop-file-name The name of a "stop" file. Before each report cycle the program checks for the existence of this file. If the file exists it exits, if it does not exist it continues. The file name is relative to the directory the report is started from. So this must be a full path name, or the stop file must be created in the same directory as the report command is started from. Default: if this is not given the command outputs one cumulative report and exits.

      Parameters:
        `args` - command line arguments.
      Throws:
        `java.lang.Exception` - if an error occurs.