Migrate request invocations (controller)
[integration/test.git] / csit / libraries / CheckJVMResource.robot
1 *** Settings ***
2 Documentation       Robot keyword library for Monitoring JVM resources
3
4 Library             ${CURDIR}/Appenders/ElasticsearchAppender.py
5 Variables           ${CURDIR}/../variables/Variables.py
6
7
8 *** Keywords ***
9 Get JVM Memory
10     [Documentation]    Return latest jvm Memory object
11     [Arguments]    ${controller-ip}=${ODL_SYSTEM_IP}    ${elastic-port}=${ELASTICPORT}
12     ${session}    ElasticsearchAppender.Get_Connection    ${controller-ip}    ${elastic-port}
13     ${value}    ElasticsearchAppender.Get Jvm Memory    ${session}
14     Log    ${value}
15     RETURN    ${value}
16
17 Get JVM Threading
18     [Documentation]    Return latest jvm Threading object
19     [Arguments]    ${controller-ip}=${ODL_SYSTEM_IP}    ${elastic-port}=${ELASTICPORT}
20     ${session}    ElasticsearchAppender.Get_Connection    ${controller-ip}    ${elastic-port}
21     ${value}    ElasticsearchAppender.Get Jvm Threading    ${session}
22     Log    ${value}
23     RETURN    ${value}
24
25 Get JVM Classloading
26     [Documentation]    Return latest jvm Classloading object
27     [Arguments]    ${controller-ip}=${ODL_SYSTEM_IP}    ${elastic-port}=${ELASTICPORT}
28     ${session}    ElasticsearchAppender.Get_Connection    ${controller-ip}    ${elastic-port}
29     ${value}    ElasticsearchAppender.Get Jvm Classloading    ${session}
30     Log    ${value}
31     RETURN    ${value}
32
33 Get JVM Operatingsystem
34     [Documentation]    Return latest jvm Operatingsystem object
35     [Arguments]    ${controller-ip}=${ODL_SYSTEM_IP}    ${elastic-port}=${ELASTICPORT}
36     ${session}    ElasticsearchAppender.Get_Connection    ${controller-ip}    ${elastic-port}
37     ${value}    ElasticsearchAppender.Get Jvm Operatingsystem    ${session}
38     Log    ${value}
39     RETURN    ${value}
40
41 Create JVM Plots
42     [Documentation]    Draw Resource usage plot using plot_points method.
43     [Arguments]    ${controllers_number}=${NUM_ODL_SYSTEM}    ${elastic-port}=${ELASTICPORT}
44     FOR    ${index}    IN RANGE    1    ${controllers_number}+1
45         ${controller-ip}    Builtin.Set Variable    ${ODL_SYSTEM_${index}_IP}
46         Log    ${controller-ip}
47         ${session}    ElasticsearchAppender.Get_Connection    ${controller-ip}    ${elastic-port}
48         Log    ${session}
49         ElasticsearchAppender.Plot Points
50         ...    ${session}
51         ...    JVM Threads
52         ...    threadcount_${index}.png
53         ...    'Threading'
54         ...    'ThreadCount'
55         ElasticsearchAppender.Plot Points
56         ...    ${session}
57         ...    JVM Heap Memory
58         ...    heapmemory_${index}.png
59         ...    'Memory'
60         ...    'HeapMemoryUsage'
61         ...    'used'
62         ElasticsearchAppender.Plot Points
63         ...    ${session}
64         ...    JVM Loaded Classes
65         ...    class_count_${index}.png
66         ...    'ClassLoading'
67         ...    'TotalLoadedClassCount'
68         ElasticsearchAppender.Plot Points
69         ...    ${session}
70         ...    JVM CPU Usage
71         ...    cpu_usage_${index}.png
72         ...    'OperatingSystem'
73         ...    'ProcessCpuLoad'
74     END