LT API for Logging Timer Messages

LT API for Logging Timer Messages

LT API

Release Date: 4/28/2023
Versions: V8.5 and Higher

Purpose
This API allows the developer to log a timing message in application code.  It can be helpful when trying to determine where there may be time-consuming processing bottlenecks.

Features of this API include the following:
  • Multiple programs can use the same timer log file by specifying the same timer name in Screen-Alpha-Field.  
  • The first LT API for a specified timer log file within a process will delete the timer log file if it already exists.
  • Multiple log timer files can be produced in the same process at the same time by using different timer names.
  • LT APIs can be left in production code without causing any significant performance costs as long as the timer is not turned on in the configuration file.
  • The timestamp column in each line of output is formatted so that it can be used to look for a precise spot in FileMonitor output.  FileMonitor is a tool from Infragistics that tracks every access to registry and disk files in a process.

API Details


Screen-Parameters:
LT                     To log a timing message to a specified log file

Screen-Alpha-Field:
 timer name      The base portion of the log filename

Screen-Literal:
message          The text that will be logged along with the timing information
                         If message = "RESET," the elapsed time will be set back to zero

Example:


    MOVE "LT" TO SCREEN-PARAMETERS.
    MOVE "CRDTCARD" TO SCREEN-ALPHA-FIELD.
    MOVE "Send credit card request to the credit card processor"
    PERFORM SCREEN-ROUTINE.
...
    MOVE "LT" TO SCREEN-PARAMETERS.
    MOVE "CRDTCARD" TO SCREEN-ALPHA-FIELD.
    MOVE "Received response from the credit card processor"
    PERFORM SCREEN-ROUTINE.

ElliottTimer.INI

Just adding the LT API to the program is not enough to cause logging to happen.  You must also create an entry, matching the contents of Screen-Alpha-Field, to enable logging for the timer:
     
[Log-Timer]
CRDTCARD=Yes

When the log file is not enabled in ElliottTimer.Ini, there will be no logging of the timer messages.

The Log File

The log file, CRDTCARD.LOG in the above example, is created in the %temp% directory.  The output will look similar to this:

NWSMRGP : 4/28/2023 7:36am Timer = NWSMRGP
  Incr. Total TimeStamp   Program   Log Message
------- ----- ----------- --------- -----------
    .00   .00 07:36:43.31 ...Timer Reset
    .04   .05 07:36:43.36 NWSMRGP: Before Init-Panels2...
    .71   .76 07:36:44.07 NWSMRGP: Before Load-Fonts...
    .30  1.06 07:36:44.37 NWSMRGP: Before Verify-Window-Active...
    .01  1.07 07:36:44.38 NWSMRGP: Before Start-Up-Step-1
    .33  1.40 07:36:44.71 NWSMRGP: After Start-NSIFH-Runtime
    .00  1.40 07:36:44.71 NWSMRGP: After Synchronize-For-RunLocal
    .20  1.60 07:36:44.91 NWSMRGP: After Check-PSQL2000-Settings
    .02  1.62 07:36:44.93 NWSMRGP: After NWSTRTFH
    .19  1.81 07:36:45.12 NWSMRGP: After Start-Up-Step-1


JEG
NWSMSCRN.CBL

    • Related Articles

    • DM API Changes - Use DM,99 to Display Long Messages

      Release Date: 02/05/2024 Version: 8.2 & Up The DM API call is limited to display a message up to 80 digits. For example, you can use the following message to display a message up to 80 digits: MOVE SHORT-MESSAGE TO SCREEN-LITERAL MOVE "DM" TO ...
    • Elliott API (JSON REST Web Service)

      Introduction In the past, Elliott web services is based on SOAP standard since that is the first web services standard created for the industry. Since then, RESTful APIs (Representational State Transfer) have become the backbone of modern web ...
    • Log-Timer / ElliottTimer.Ini Support

      Release Date: 02/21/2018 Description From time to time, a systems-layer developer may need to embed some low-footprint debugging statements in production code that can be activated with a configuration file at a client's site. There is an RCM ...
    • EM API - Create and Send an Email

      Release Date: 12/23/20 Version: 7.0 and Higher This is a set of API calls introduced after Elliott 6.X.060. Use them collectively. They will send out emails through the SMTP or MAPI interface. Developers who use these API calls do not need to know ...
    • DN API (Document Number Handling)

      Release: 1/11/2021 Version: V8.5 and higher DN API: Document Number Increase, Roll Back or Validate In Elliott V8.5, the system supports alphabetic document numbers. The logic to sequentially assigning the next document number is complicated. For ...