To create a metric model for your customer or partner application, create a class in ABAP Development Tools (ADT) that implements the interface IF_GSM_API_PROVIDER
.
You have a developer role for creating objects with ABAP for Cloud Development.
You have created an ABAP Cloud project and a package in ABAP Development Tools.
With the class, you define the metric model and measurement.
For code samples, see https://github.com/SAP-samples/abap-platform-ops.
-
In your ABAP Cloud project and package, create a class implementing the interface
IF_GSM_API_PROVIDER
.As a result, you get a class with the following methods:
INITIALIZE( )
,DEFINE_MODEL( )
, andGET_METRIC_VALUES( )
. -
When you edit this class, we recommend that you define constants for the metric names and values that are exactly the same for methods
DEFINE_MODEL( )
andGET_METRIC_VALUES( )
. All metric names that do not match are ignored at runtime.For example, your code might look as follows:
CONSTANTS: BEGIN OF e_metric_group_id, demo_group TYPE if_gsm_api_types=>tv_metric_group_id VALUE 'zdemo_group_01', END OF e_metric_group_id . CONSTANTS: BEGIN OF e_metric_id, demo_metric_id TYPE if_gsm_api_types=>tv_metric_id VALUE 'zdemo_metric_01', END OF e_metric_id . CONSTANTS: BEGIN OF e_attribute_id, demo_attr_01 TYPE if_gsm_api_types=>tv_attribute_id VALUE 'zdemo_attr_01', END OF e_attribute_id .
You create one metric group and assign your metrics to the group. The metric group is just for semantical grouping and holder for meta data. It has no physical impact on the metric store or the data collection for metrics later.
-
Redefine the methods
DEFINE_MODEL( )
andGET_METRIC_VALUES( )
according to your business needs.
Related Information