Hvrstats

Last updated on Dec 23, 2020

  Since    v5.3.1/25  

Contents

Name

hvrstats - Gather or output statistics information.

Statistics generation for HVR version 5.3.1/24 and older, see Hvrstatistics.

Synopsis

hvrstats [-h class] [-u user-Clett hubdb

hvrstats [-h class] [-u user-flogf [-flogf]... [-Tgranhubdb

hvrstats [-h class] [-u user-gN [-Tgran] [-Gtyphubdb

hvrstats [-h class] [-u user-ofname [-outoptshubdb

hvrstats [-h class] [-u user-ppol hubdb

Description

Command hvrstats gathers or outputs statistics information.

The argument hubdb specifies the connection to the hub database. For more information about supported hub databases and the syntax for using this argument, see Calling HVR on the Command Line.

This command can be invoked in five distinct ways:

  1. Option -C creates database objects.
  2. Option -f gathers statistics information from a static log file.
  3. Option -g gathers live information into table hvr_stats.
  4. Option -o outputs statistics information from table hvr_stats to a file.
  5. Option -p purges old data from table hvr_stats.

Regular Options

Parameter

Description

-Cletters

Create database objects for hvrstats. Value letters can be one or more of the following:

  • t : Create tables hvr_stats and hvr_stats_staging.
  • j : Create hvrstats job in scheduler. Once created, the job can be started and suspended using commands Hvrstart and Hvrsuspend respectively.

This option cannot be used with -g -f -o or -p.

-flogf

Gather statistics measurements from HVR log file logf. This option can be supplied multiple times. Examples of use are to catch-up with the current log file ($HVR_CONFIG/log/hubdb.out) or to consume archived log files (in $HVR_CONFIG/logarchive) . This option does not change the statistics offset state file.

This option cannot be used with -C -g -o or -p.

-gbool

Gather information from runtime; normal run-time hvrstats processing. Value bool should either be 0 (run continuously in a loop until terminated) or 1 (perform just one [full] cycle, then stop).

This option cannot be used with -C -f -o or -p.

-Gletters

Type of information to gather.

By default all types of information is gathered (but not at same frequency).

Value _letters_can one of the following:

  • j : Job information, including latency (from $HVR_CONFIG/router) and log files sizes (from $HVR_CONFIG/log).
  • s : Statistics metrics from live HVR log file's contents.

This option requires option -g (gather). If this option is not supplied then all types of information is gathered (-Gjs).

-hclass

Location class of the hub database. Valid values for class are db2db2iingresmysqloraclepostgresqlsqlserver, or teradata. For more information, see Calling HVR on the Command Line.

-ofname

Writes statistics information (fetched from table hvr_stats) into file fname. The default file format is JSON, for other file formats see output option -V.

To filter the output written into file fname, you can use the output options along with -o.

-ppolicy

Purge old records immediately from the catalog table hvr_stats. Value policy can be one of the following:

  • SMALL : Per-table measurements at 1min/10 min/1hour/1day granularity are purged after 1hour/4hours/1day/7days respectively. Rows for all tables (table=*) at 1min/10 min/1hour/1day granularity are purged after 4hours/1day/7days/30days respectively.
  • MEDIUM (default): Per-table measurements at 1min/10 min/1hour/1day granularity are purged after 4hours/1day/7days/30days respectively. Rows for all tables (table=*) at 1min/10min/1hour/1day granularity are purged after 1day/7days/30days/never respectively.
  • LARGE : Per-table measurements at 1min/10min/1hour/1day granularity are purged after 1day/7days/30days/never respectively. Rows for all tables (table=*) at 1min/10min/1hour/1day granularity are purged after 7days/30days/never/never respectively.

Values NONE and UNBOUNDED are not allowed here but are valid for action Scheduling /StatsHistory. This option cannot be used with -C -g -f or -o.

-Tgran

Time granularity of data to gather or to output. Value gran must be only one of the following:

  • m : Minute granularity
  • t : Ten (10) minutes granularity
  • h : Hour granularity
  • d : Day granularity
  • c : Current granularity. This letter is allowed with option -o(view output), not option -g(gather from runtime).

This option can only be used with -f (gather from file), -g(gather from runtime) or -o(view output).

When gathering (option -g) if this option is omitted the default is m (minute granularity). Also, when gathering (but not when showing) if a small granularity is supplied then large granularities (e.g. m > t > h > d) will also be calculated. For example for option -T t (for 10 minutes) is supplied then aggregate values are also calculated for hour and day granularity. With option -o(view output), multiple letters can be supplied and the default is to return all time granularities (-T mthd).

-uuser[/pwd]

Username for hub database.

Output Options

The following options (-outopts) can only be used with option -o.

For list of all statistics metrics, see Metrics for Statistics.

Parameter

Description

-bbegin_time

Only write statistics information since begin_time. Value begin_time must have form YYYY-MM-DD HH:MM:SS, YYYY-MM-DDTHH:MM:SS+TZD or YYYY-MM-DDTHH:MM:SSZ.

-cchn

Only write statistics information for channel chn. This option can be supplied multiple times.

-eend_time

Only write statistics information upto end_time. Value end_time must have form YYYY-MM-DD HH:MM:SS, YYYY-MM-DDTHH:MM:SS+TZD or YYYY-MM-DDTHH:MM:SSZ.

-lloc

Only write statistics information for location loc. This option can be supplied multiple times.

-mmchoice

Only write statistics information for specific metrics. Values mchoice can be either a metric name (e.g. Integrated Updates), a group of metrics (e.g. Latency) or a named label of metrics (__kpi_lines). This option can be supplied multiple times; if it is not supplied then all metrics are displayed.

-sscope

Only write statistics information for metric with specific scope. A scope is identified by three letters for channel, location and table The first letter of scope is either c if the value is for a specific channel or * if it is associated (an aggregate) for all channels. The second is either l if the value is for a specific location or * if it is associated (an aggregate) for all locations. The third is either t if the value is for a specific table or * if it is associated (an aggregate) for all tables.

Value scope must be one of the following:

  • clt : Specific (named) channel, location and table.
  • cl* : Specific channel and location, but for all tables (e.g. table=*).
  • c*t : Specific channel and table, but for all locations.
  • *l* : Specific locations, but for all channels and tables.
  • c** : Specific channel, but for all locations and tables.
  • *** : General values, which apply to all channels, locations and tables.

If this option is not supplied then measurements for all scope are shown. This option can be supplied multiple times.



cl**l*





clt

***






c*tc**

Note that two combinations (*lt and **t) are not supported.

-ttbl

Only write statistics information for table tbl. This option can be supplied multiple times.

-Vfmt

Format of the output file fname. Value fmt can be one of the following:

  • json (default). This format is available only in CLI.
  • csv
  • xlsx   Since    v5.6.0/1  

-wtime

Only write statistics information that was updated after time. Value time must have form YYYY-MM-DD HH:MM:SS, YYYY-MM-DDTHH:MM:SS+TZD or YYYY-MM-DDTHH:MM:SSZ.

Example

This command will create the hvrstats catalog tables (if necessary), gather all data from a log file (-f <hvr_log>), select data for time granularity '10 minutes' (-Tt) into a file (-o <ofile>) and purge (-p) old rows according to the SMALL purge policy. Note that these actions will be performed in that exact order.

hvrstats -Ct -f <hvr_log> -o <ofile> -Tt -pSMALL <hub_db>

Files

HVR_CONFIG







files








hvrstatistics-stats-hubdb.offset





Statistics state file.


hvr_stats_staging_hubdb.xml






See Also