Class StatisticsFunTsvManager

java.lang.Object
com.smeup.kokos.sdk.rpgle.util.TsvManager
com.smeup.kokos.sdk.rpgle.util.StatisticsFunTsvManager
All Implemented Interfaces:
AutoCloseable

public class StatisticsFunTsvManager extends TsvManager
The StatisticsFunTsvManager class extends the TsvManager class to manage and write statistics related to function executions in a Tab-Separated Values (TSV) format. This class is specifically designed to record the execution status of functions along with their timestamps and the number of statements executed. The following columns are included in the TSV: - COLUMN_TIMESTAMP: The timestamp of when the record was created. - COLUMN_FUN: The name of the function being executed. - COLUMN_EXECUTE: Indicates whether the function was executed successfully. - COLUMN_STATEMENTS: The number of statements executed in the function. This class uses a buffered writer to enhance performance when writing to the TSV.
Author:
Davide Palladino
  • Field Details

  • Constructor Details

    • StatisticsFunTsvManager

      public StatisticsFunTsvManager(Writer writer, String fun, boolean isNew)
      Constructs a new StatisticsFunTsvManager instance.
      Parameters:
      writer - the writer used to output the TSV data, which can be any implementation of Writer, such as a buffered writer
      fun - the name of the function for which statistics are recorded
      isNew - a boolean indicating whether to initialize the TSV with headers
  • Method Details

    • append

      public void append(boolean executed, Long nStatements, ArrayList<String> warnings)
      Appends a new entry to the TSV with the execution status and number of statements.
      Parameters:
      executed - a boolean indicating whether the function was executed successfully
      nStatements - the number of statements executed in the function
    • getHeadersSerialized

      public static String getHeadersSerialized()