Skip to content
This repository has been archived by the owner on Dec 17, 2023. It is now read-only.

Sm58 collector #85

Merged
merged 2 commits into from
Jan 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
50 changes: 50 additions & 0 deletions src/zamp_collector/zcl_amp_c_transactional_rfcs.clas.abap
Original file line number Diff line number Diff line change
@@ -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(<job>).

"status from include LBTCHDEF
status = SWITCH #( <job>-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 = <job>-count ) ).

ENDLOOP.

ENDMETHOD.

ENDCLASS.
16 changes: 16 additions & 0 deletions src/zamp_collector/zcl_amp_c_transactional_rfcs.clas.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<abapGit version="v1.0.0" serializer="LCL_OBJECT_CLAS" serializer_version="v1.0.0">
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
<asx:values>
<VSEOCLASS>
<CLSNAME>ZCL_AMP_C_TRANSACTIONAL_RFCS</CLSNAME>
<LANGU>E</LANGU>
<DESCRIPT>amp collector transactional RFCs (SM58)</DESCRIPT>
<STATE>1</STATE>
<CLSCCINCL>X</CLSCCINCL>
<FIXPT>X</FIXPT>
<UNICODE>X</UNICODE>
</VSEOCLASS>
</asx:values>
</asx:abap>
</abapGit>