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 (Reusable Code Manager) macro named LOG-TIMER that provides that functionality.  Its features include the following:
  • Ability to produce a trace line with a variable message in the log file whenever it is encountered.
  • Include the elapsed time between LOG-TIMER statements and the running elapsed time.
  • When activated, produce a separate trace file for each program that contains the LOG-TIMER statement...
  • ...Or, produce a single, named trace file for LOG-TIMER statements in multiple programs with matching [NAME timer ] phrases.
  • Write the logs to the user's %TEMP% file to prevent collision of traces among users and to minimize the performance impact of the logging.
  • When not activated, has almost no performance impact on the program,
Typical uses include these activities:
  • Helps pinpoint performance bottlenecks.
  • Produce a trace to help pinpoint a failure in the code (e.g., 114-error).
Adding LOG-TIMER Statements to COBOL Programs

Syntax:

LOG-TIMER
    [ NAME timer ]
    [ USER logtimeruser ]
    { msg | RESET }

Description:

This macro logs the elapsed time (since the last RESET message) and %msg% to a file in the Windows %Temp% directory. By default, the filename is <progname>.Log.  Very little code is executed when the timer is not activated, so one can add Log-Timer macro statements to programs without concern for the overall overhead of the application.

The .Ini filename is ElliottTimer.Ini, but it can be overridden by adding an additional RCM statement before all LogTimer macro statements in the program:
        
              Set-RCM-Variable LogTimerIni = <filename>

[ NAME timer ], if specified, changes the log filename from <progname>.Log to %Timer%.Log.  %Timer% is a literal without quotes.  This optional phrase typically is used to log timing events across programs.

[ USER logtimeruser ], if supplied, will only log when the entry in the .Ini file is set to the same value as %logtimeruser%.  This allows selective activation of the timing and logging.  

For example, one must add the following phrase in each of a program's LOG-TIMER macro statements in order to enable activation for just a specific Elliott user:

         USER SMA-USER-NAME

Code Example

JG1802   Log-Timer User SMA-User-Name "Start"
...
JG1802   Log-Timer User SMA-User-Name " before WS-Mail-Desc..."
...
JG1802   Log-Timer User SMA-User-Name " before Save-Fltr-Rows..."
...
  JG1802   Log-Timer User SMA-User-Name " before Save-Fltr-Rows..."  

Example Output


NWSMMSEM: 2/21/2018 2:32pm Timer = NWSMMSEM
  Incr. Total Program     Log Message                                   ------- ------- ------------ -----------                                     .00 14.06 NWSMMSEM   Start                                              .01 14.07 NWSMMSEM     before WS-Mail-Desc...                           .00 14.07 NWSMMSEM     before Save-Fltr-Rows...                         .00 14.07 NWSMMSEM     before WS-Email-Fields...  

Configuration of ElliottTimer.Ini

Logging only takes place when the corresponding entry in ElliottTimer.Ini in the current directory is set to "Yes," "All" or a value matching %logtimeruser%, if that phrase is specified in the LOG-TIMER macro statement:  For example:

          [Log-Timer]
      ARCUSMNT=All
      STARTUP=Jim

In the above example, when ARCUSMNT is executing, any LOG-TIMER statements will produce output in %TEMP%\ARCUSMNT.Log for each user.  When LOG-TIMER NAME STARTUP statements are executing, only Elliott user "JIM" will produce output in his %TEMP%\STARTUP.Log.

All other LOG-TIMER statements in Elliott will be ignored.

We do not publish a list of LOG-TIMER possibilities in the Elliott programs, because they should be enabled on an as-needed basis with the coordination of an Elliott support specialist.

Modified programs: None
JEG

Developer Documentations

  1. Received Code 9999 with Web Services Call
  2. Received Return Status Code 3 When Using Elilogin Login Method
  3. Elliott Web Service Requirements
  4. Elliott eStore Checklist
  5. LN API
  6. FN API
  7. RN API
  8. IN and DF API Change (V9.0)
  9. FA API Changes (V9.0)
  10. VA API Changes (V9.0)
  11. CartService
  12. EliarachService
  13. ElicshtxService
  14. EliattrbService
  15. ElisyscdService
  16. EliNoteService
  17. El2rstimService
  18. EliOrderService
  19. ItemInquiry
  20. EliitmiqService
  21. EliShiptoService
  22. El2getfrService
  23. Steps Required to Test ReportWriter in V8.2
  24. Installation of ElliottService, NETcellent’s Web Services for Elliott
  25. ResellerFinder
  26. EliaptrxService
  27. VendorInquiry
  28. EliloginService
  29. ElislsmnService
  30. EliserhsService
  31. EliatpobService
  32. ElievprcService
  33. ElihdtrxService
  34. ElicuswlService
  35. QueryTurnaround
  36. InvoiceInquiry
  37. ElicustmService
  38. EligetcdService
  39. OrderInquiry
  40. EliordiqService
  41. EliecontService
  42. EliautdpService
  43. El2CrCrdService
  44. Log-Timer / ElliottTimer.Ini Support
  45. Alpha Document Number Support (V8.5/V9.0)
  46. ElliottService System.TypeInitializationException
  47. Feature - Printing API to Dynamically Set Number of Copies
  48. The Values and Meanings of Distribution Types - ARDISFIL, APDISFIL, IMDISFIL, BMDISFIL
  49. DD API Changes (V9.0)
  50. PA API (8.5)
  51. Validate License API
  52. AP API
  53. TP API: Temporary Path
  54. Data Structures for Report Desk Defaults and Enforcements
  55. COBOL to VB Interface Programs
  56. IN API: Option to Support Files and Folders Validation
  57. FF API: File Functions
  58. ID API
  59. LK: Links API
  60. FFLNearYou
  61. Report Desk Developing and Debugging
  62. Developing a New Elliott V8.6 Report Desk User Defined Report (UDR)
  63. CustomerInquiry
  64. Elliott API (JSON Web Service)
  65. Animating COBOL Code in Elliott V8.5
  66. Preliminary Programming Changes for Elliott 8.6
  67. CV API
  68. System Lock File Requirements
  69. How to Write Test Codes for C# ESS Projects
  70. Solving the Inability to Debug Elliott on a New Server
  71. Report Desk: Developing Custom Reports
  72. Report Desk Tables
  73. Report Desk Database Delivery Strategy

Feedback and Knowledge Base