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