Table of Contents Previous Next PDF


TSAM Plus Accounting and Chargeback

TSAM Plus Accounting and Chargeback
This chapter contains the following topics:
Accounting Information Output
Prerequisite
Before you can use this feature, make sure TSAM Plus agent is installed and TSAM Plus plug-in is enabled.
Configuration
A new option, -a, is added to servopts(5) for providing more various accounting information output fields:
-a FILENAME[[$FIELD]...]
If -a option is set, the Tuxedo server prints accounting information into the file specified by FILENAME.
The accounting file is generated daily with a file name in the format of [FILENAME].mmddyy.
The fields that can be specified for -a option are as follows:
DID: Indicates the Tuxedo Domain ID of the server process.
LMID: Indicates the LMID of the server process.
GRPID: Indicates the Tuxedo Group ID of the server process.
GRPNAME: Indicates the Tuxedo Group name of the server process.
SID: Indicates the Tuxedo Server ID of the server process.
PID: Indicates the process ID of the Tuxedo server process.  
PNAME: Indicates the process name of the Tuxedo server process.  
SVC: Indicates the name of the service being invoked. It always appears in the output fields when “-a” is specified.
GID: Indicates the Tuxedo user group invoking the service.
UID: Indicates the Tuxedo user ID invoking the service.
CLIENT: Indicates the Tuxedo client invoking the service.
STIME: Indicates the time entering the service routing.  The output of this field is in the format of “tv_sec/tv_usec”, where two values are expressed as seconds and microseconds since 00:00 Coordinated Universal Time (UTC), January 1, 1970 respectively. It always appears in the output fields when “-a” is specified.
ETIME: Indicates the time leaving the service routing. The output of this field is in the format of “tv_sec/tv_usec”, where two values are expressed as seconds and microseconds since 00:00 Coordinated Universal Time (UTC), January 1, 1970 respectively. It always appears in the output fields when “-a” is specified.
TIME: Indicates the total CPU time (in microsecond) consumed by the service call.
SYSTIME: Indicates the System CPU time (in microsecond) consumed by the service call.
USRTIME: Indicates the User CPU time (in microsecond) consumed by the service call.
ERRNO: Indicates the ERRNO returned to the service invoker.
URCODE: Indicates the URCODE returned to the service invoker.
SIZE: Indicates the size of the request message (in byte).
WTIME: Indicates the waiting time of the request message in a queue (in microsecond).
ALL: Indicates all fields above.
If no filed is specified for “-a” option, these fields are included in sequence by default: UID, SVC, STIME, ETIME, SYSTIME, USRTIME.
If a duplicate field name is specified, it is ignored and a warning message is printed in ULOG: “ERROR: duplicate field xxx for -a option”.
If an invalid field is specified, it is ignored and an error message is printed in ULOGERROR: xxx is not a valid field for -a option”.
The fields separated by TAB character are listed in the first line of a new accounting file. Following is a sample:
#UID SVC STIME ETIME SYSTIME USRTIME
Subsequently a line is printed for every service call in the same sequence of the field names and values are separated by a TAB character as well. If a field value is not available, it will be left empty.
Note:
The services in system server, such as BBL, GWTDOMAIN, TMS, etc. or the system services with the name starting with '.' cannot generate accounting records. The following Oracle Tuxedo Application Runtime for CICS servers are supported:
- ARTATR1
- ARTATRN
- ARTCNX
- ARTDPL
- ARTSTR1
- ARTSTRN
- ARTTDQ
- ARTTSQ
A multithread server (built with “-t” option) reports no TIME, SYSTIME or USRTIME.
A server with the “NONE” or “APP_PW” value of the SECURITY parameter in TUXCONFIG file reports no GID, UID or CLIENT.
Samples
CLOPT="-A -a account_file$SVC$GID$UID$TIME$SIZE --”
CLOPT="-A -a account_file$ALL --”
CLOPT="-A -a account_file --”
Accounting Information Analyzing
You can use a new tool accrpt to analyze and aggregate the content of accounting file.
If an accounting file is specified, accrpt analyzes and aggregates the file content and print the aggregated information into STDOUT.
accrpt [–k FIELD[,FIELD]...] [-t {MINUTE|5MINUTES|10MINUTES|15MINUTES|HOUR|DAY}] [–o FIELD[,FIELD]...] [-i] [FILE(s)]
Configuration
-k option
It indicates the key fields separated by ‘,’ . The following fields can be specified:
DID: Indicates the Tuxedo Domain ID of the server process.
LMID: Indicates the LMID of the server process.
GRPID: Indicates the Tuxedo Group ID of the server process.
GRPNAME: Indicates the Tuxedo Group name of the server process.
SID: Indicates the Tuxedo Server ID of the server process.
PID: Indicates the process ID of the Tuxedo server process.  
PNAME: Indicates the process name of the Tuxedo server process.  
SVC: Indicates the name of the service being invoked.
GID: Indicates the Tuxedo user group invoking the service.
UID: Indicates the ID of the Tuxedo user invoking the service.
CLIENT: Indicates the Tuxedo client invoking the service.
If this option is not specified, the SVC field is specified by default. If a field is specified but its value is not available, the field will be left empty in the output result.
-t option
It indicates the time window to aggregate the accounting information. If it is not specified, the accounting information is aggregated in hour by default.
-o option
It indicates the measurement fields that are outputted for accounting and chargeback purposes. Fields are separated by ‘,’. The following fields can be specified in the list:
TIMES: Indicates the total invoke times.
SUCC: Indicates the invoke times for returning success.
APPFAIL: Indicates the invoke times for returning application failure.
SYSFAIL: Indicates the invoke times for returning system failure.
ELPTIME: Indicates the total elapse time (in millisecond).
TIME: Indicates the total CPU time (in millisecond).
SYSTIME: Indicates the total System CPU time (in millisecond).
USRTIME: Indicates the total User CPU time (in millisecond).
SIZE: Indicates the total message size (in kilobytes) of the request message.
WTIME: Indicates the average waiting time of the request message in a queue (in microsecond).
By default, fields TIMES, ELPTIME, SYSTIME, and USRTIME are selected as measurement fields.
-i option
If this option is specified, accrpt ignores the line of accounting information where any empty key field is included.
File(s)
Specifies accounting files for analyzing. If no file is specified, accrpt reads input from STDIN.
Output
accrpt analyzes raw accounting information and outputs the aggregated accounting information into STDOUT. Three groups of fields are outputted in sequence:
Implicit fields: include STIME and ETIME of the time window. They are always printed as the first and second fields.
accrpt prints all fields in one line prefixed # character firstly and all accounting information subsequently, sorted by all Key fields, STIME, and ETIME in ascending order. In a line, all fields are separated by TAB character. If a value is not available, it is left empty.
Samples
Sample 1 - Default Usage
For SimpleServer, here we set its CLOPT parameter as “-A -a simpserv_acct --
Every day this server outputs its accounting information into a new file named simpserv_acct.mmddyy.
>cat simpserv_acct.022102
# SVC UID STIME ETIME SYSTIME USRTIME
TOUPPER John 1789249093/34452   1789249093/65389 100 50
......
>accrpt account3. 022102
#STIME ETIME SVC TIMES ELPTIME SYSTIME USRTIME
00:00:00 01:00:00 TOLOWER 10 100 20 40
01:00:00 02:00:00 TOLOWER 15 200 30 50
00:00:00 01:00:00 TOUPPER 10 100 20 40
01:00:00 02:00:00 TOUPPER 10 100 20 40
......
Sample 2
>accrpt –t DAY account.022012
#STIME ETIME SVC TIMES ELPTIME SYSTIME USRTIME
00:00:00 24:00:00 TOLOWER 150 2000 300 500
00:00:00 24:00:00 TOUPPER 100 1000 200 400
Sample 3
>accrpt –k SVC -o TIMES,ELPTIME,TIME,SIZE account1.022012 account3.022012
#STIME ETIME SVC TIMES ELPTIME TIME SIZE
00:00:00 01:00:00 TOLOWER 10 100 20 100
01:00:00 02:00:00 TOLOWER 15 200 30 500
00:00:00 01:00:00 TOUPPER 10 100 20 100
01:00:00 02:00:00 TOUPPER 15 200 30 500
......
Known Issues
The user ID of an ART service "connect" call is the domain ID. This works by design.
The ART service "disconnect" cannot be accounted.
 

Copyright © 1994, 2017, Oracle and/or its affiliates. All rights reserved.