Class ZCL_LLM_STATISTICS
AI Generated documentation.
Overview
The zcl_llm_statistics class is designed to manage and add statistical data, implementing the zif_llm_statistics interface. The class provides a public method add to insert statistical records and a constructor to initialize the class with the active status from the zllm_system table.
Public Methods
- add: This method inserts a statistical record into the
zllm_statisticstable. It checks theactivestatus before performing the insertion. - constructor: This method initializes the class by retrieving the
stat_activevalue from thezllm_systemtable and setting theactiveattribute accordingly.
Dependencies
- Interface:
zif_llm_statistics - Tables:
zllm_statistics,zllm_system
Details
The class zcl_llm_statistics interacts with the zllm_system table to determine if statistical data should be processed. The active attribute, which is set during the class initialization, controls whether the add method performs its insertion operation.
Class Diagram
classDiagram
class zcl_llm_statistics {
-active: sap_bool
+constructor()
+add(record: zllm_statistics)
}
zcl_llm_statistics --> zif_llm_statistics : implements
zcl_llm_statistics --> zllm_system : reads
zcl_llm_statistics --> zllm_statistics : writes
Logic Flow
The logic flow of the zcl_llm_statistics class can be visualized as follows:
graph TD
A[Constructor] --> B[Read stat_active from zllm_system]
B --> C[Set active attribute]
D[add Method] --> E[Check if active]
E -- No --> F[Return]
E -- Yes --> G[Insert record into zllm_statistics]
Interaction with Tables
The class interacts with two main tables:
- zllm_system: Read operation to retrieve the
stat_activevalue during class initialization. - zllm_statistics: Write operation to insert statistical records when the
addmethod is called and theactivestatus is true.