SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

List of the most annoyed (performance) users of a specif day



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Security and Monitoring
View previous topic :: View next topic  
Author Message
admin
Администратор
Администратор



Joined: 01 Sep 2007
Posts: 1640

PostPosted: Sun Nov 25, 2007 12:55 pm    Post subject: List of the most annoyed (performance) users of a specif day Reply with quote

Create a rank list of the most annoyed users (because of the performance) of a specific day

Code:

*
* This program creates a rank list of the most annoyed users (because of
* performance) of a specific day.
* A user is more annoyed if he has to wait a lot (average response time is high)
* many times (high number of dialog steps).
*
REPORT ZUSRANOY LINE-SIZE 120.

DATA: BEGIN OF APPLICATION_STATISTIC OCCURS 200.
        INCLUDE STRUCTURE SAPWLUSTCX.
DATA: END OF APPLICATION_STATISTIC.
DATA: BEGIN OF INSTANCES OCCURS 10.
        INCLUDE STRUCTURE RZLLIAPSRV.
DATA: END OF INSTANCES.
DATA: AVG_RESPTIM TYPE I, DEST(8), ANNOYANCE TYPE F, IANOY TYPE I, I
      TYPE I.
DATA: BEGIN OF RESULT OCCURS 100,
    ACCOUNT LIKE APPLICATION_STATISTIC-ACCOUNT,
    ENTRY_ID LIKE APPLICATION_STATISTIC-ENTRY_ID,
    DCOUNT LIKE APPLICATION_STATISTIC-DCOUNT,
    RESPTI LIKE APPLICATION_STATISTIC-RESPTI,
    AVG_RESPTIM TYPE I,
    IANOY TYPE I,
END OF RESULT.

PARAMETERS: DATE TYPE D DEFAULT SY-DATUM.

CALL FUNCTION 'SMLG_GET_DEFINED_SERVERS'
     TABLES: INSTANCES = INSTANCES.

INSTANCES = 'db_server_host_name'.
APPEND INSTANCES.

LOOP AT INSTANCES.
  DEST = INSTANCES.
  CALL FUNCTION 'SAPWL_WORKLOAD_GET_STATISTIC'
       EXPORTING
            PERIODTYPE            = 'D'
            HOSTID                = DEST
            STARTDATE             = DATE
       TABLES
            APPLICATION_STATISTIC = APPLICATION_STATISTIC
       EXCEPTIONS
            NO_DATA_FOUND         = 1.

  LOOP AT APPLICATION_STATISTIC.
    IF APPLICATION_STATISTIC-TTYPE = '01'
      AND APPLICATION_STATISTIC-ACCOUNT <> 'SAP*'
      AND APPLICATION_STATISTIC-ACCOUNT <> 'SAPSYS'
      IF APPLICATION_STATISTIC-ENTRY_ID <> 'CPIC/RFC'
          AND APPLICATION_STATISTIC-ENTRY_ID <> 'Login_Pw'
          AND APPLICATION_STATISTIC-ENTRY_ID <> 'MainMenu'
          AND APPLICATION_STATISTIC-ENTRY_ID <> 'Logoff'
          AND APPLICATION_STATISTIC-ENTRY_ID <> 'SAPMSYST'.
        AVG_RESPTIM =
        APPLICATION_STATISTIC-RESPTI / APPLICATION_STATISTIC-DCOUNT.
        MOVE-CORRESPONDING APPLICATION_STATISTIC TO RESULT.
        IF AVG_RESPTIM < 1500. AVG_RESPTIM = 0. ENDIF.
        RESULT-AVG_RESPTIM = AVG_RESPTIM.
        ANNOYANCE =  AVG_RESPTIM * AVG_RESPTIM *
     AVG_RESPTIM  *  AVG_RESPTIM  * APPLICATION_STATISTIC-DCOUNT *
     APPLICATION_STATISTIC-DCOUNT * APPLICATION_STATISTIC-DCOUNT /
     100000000000000000.
        IANOY = ANNOYANCE.
        RESULT-IANOY = IANOY.
        APPEND RESULT.
      ENDIF.
    ENDIF.
  ENDLOOP.
ENDLOOP.
SORT RESULT BY IANOY DESCENDING.
WRITE: / 'USER' COLOR 4,
          8 'PROGRAM/TRANSACTION' COLOR 4,
          30 'DIALOG STEP #' COLOR 4,
          46 'AVRG RESP TIME' COLOR 4,
          64 'ANNOYANCE FACTOR' COLOR 4.
SKIP.


LOOP AT RESULT.
  I = I + 1.
  WRITE: / RESULT-ACCOUNT, RESULT-ENTRY_ID, 25(15) RESULT-DCOUNT,
    47 RESULT-AVG_RESPTIM , 64 RESULT-IANOY.
  IF I >= 30. EXIT. ENDIF.
ENDLOOP.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Security and Monitoring All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG.
SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG.
Every effort is made to ensure content integrity. Use information on this site at your own risk.