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

    • 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 ...
    • 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 Web Service)

      Prerequisites: Windows 2012 or later IIS .NET 4.61+ ASPNETCORE Hosting & Runtime Bundle - https://dotnet.microsoft.com/download/dotnet-core/2.2 PSQL v12+. (note some features require PSQL 13+. See "Features that require PSQL v13 or later section) ...
    • Logging I-O Logic Errors

      Release Date: 11/11/2020 Versions: 85. and up Background Internally, the file handling layer in Elliott allows programs to issue I-O commands, like closing a file when it is already closed, without penalty. That is, since there is no harm done in ...
    • Programming API Codes

      This document is provided for Elliott software developers. If you are not an Elliott software developer, this document is not meaningful for you. AP: Get SMA Values This API returns various values from the Shared Memory Area. For example: Move ‘AP’ ...