diff --git a/docs/README.md b/docs/README.md index 3165e12..e73a2e5 100644 --- a/docs/README.md +++ b/docs/README.md @@ -46,3 +46,9 @@ Select the workload of the system. [zcl_amp_c_sql_monitor](../src/zamp_collector/zcl_amp_c_sql_monitor.clas.abap) Selects the sum of total DB time for the top five statements in the last hour. + +## transactional RFCs (SM58) + +[zcl_amp_c_transactional_rfcs](../src/zamp_collector/zcl_amp_c_transactional_rfcs.clas.abap) + +Selects the transactional RFCs for the current Day and create a metric for each status. \ No newline at end of file diff --git a/src/zamp_collector/zcl_amp_c_transactional_rfcs.clas.abap b/src/zamp_collector/zcl_amp_c_transactional_rfcs.clas.abap new file mode 100644 index 0000000..27cf055 --- /dev/null +++ b/src/zamp_collector/zcl_amp_c_transactional_rfcs.clas.abap @@ -0,0 +1,50 @@ +CLASS zcl_amp_c_transactional_rfcs DEFINITION + PUBLIC + FINAL + CREATE PUBLIC . + + PUBLIC SECTION. + + INTERFACES zif_amp_collector. + + PROTECTED SECTION. + PRIVATE SECTION. +ENDCLASS. + + + +CLASS zcl_amp_c_transactional_rfcs IMPLEMENTATION. + METHOD zif_amp_collector~get_metrics. + + DATA status TYPE string. + + SELECT + COUNT(*) AS count, + status AS status + FROM v_op + INTO TABLE @DATA(jobs) + WHERE strtdate = @sy-datum + GROUP BY status. + + LOOP AT jobs ASSIGNING FIELD-SYMBOL(). + + "status from include LBTCHDEF + status = SWITCH #( -status + WHEN 'R' THEN 'running' + WHEN 'Y' THEN 'ready' + WHEN 'P' THEN 'scheduled' + WHEN 'P' THEN 'intercepted' + WHEN 'S' THEN 'released' + WHEN 'A' THEN 'aborted' + WHEN 'F' THEN 'finished' + WHEN 'Z' THEN 'put_active' + WHEN 'X' THEN 'unknown_state' + ELSE 'no status found' ). + + metrics = VALUE #( BASE metrics ( metric_key = status metric_value = -count ) ). + + ENDLOOP. + + ENDMETHOD. + +ENDCLASS. diff --git a/src/zamp_collector/zcl_amp_c_transactional_rfcs.clas.xml b/src/zamp_collector/zcl_amp_c_transactional_rfcs.clas.xml new file mode 100644 index 0000000..d3c7959 --- /dev/null +++ b/src/zamp_collector/zcl_amp_c_transactional_rfcs.clas.xml @@ -0,0 +1,16 @@ + + + + + + ZCL_AMP_C_TRANSACTIONAL_RFCS + E + amp collector transactional RFCs (SM58) + 1 + X + X + X + + + +