Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[enhancement](jni)append exception check for jni code. #42507

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hubgeter
Copy link
Contributor

Proposed changes

Because in jni, we need to manually check for exceptions thrown, and if we do not handle the exception, the program will continue to execute, which is not like the try catch logic we often use. Therefore, in order to reduce the potential risks caused by not handling exceptions, I checked most of the jni code and added exception detection for it.

@doris-robot
Copy link

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR

Since 2024-03-18, the Document has been moved to doris-website.
See Doris Document.

@hubgeter
Copy link
Contributor Author

run buildall

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

<< "Class java/lang/management/ManagementFactory Not Find.JVM monitoring fails.";
return;
}
Status JvmStats::init() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: function 'init' has cognitive complexity of 147 (threshold 50) [readability-function-cognitive-complexity]

Status JvmStats::init() {
                 ^
Additional context

be/src/util/jvm_metrics.cpp:192: +1, including nesting penalty of 0, nesting level increased to 1

    RETURN_IF_ERROR(JniUtil::GetJNIEnv(&env));
    ^

be/src/common/status.h:629: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/util/jvm_metrics.cpp:192: +2, including nesting penalty of 1, nesting level increased to 2

    RETURN_IF_ERROR(JniUtil::GetJNIEnv(&env));
    ^

be/src/common/status.h:631: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/util/jvm_metrics.cpp:194: +1, including nesting penalty of 0, nesting level increased to 1

    RETURN_IF_ERROR(JniUtil::GetGlobalClassRef(env, "java/lang/management/ManagementFactory",
    ^

be/src/common/status.h:629: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/util/jvm_metrics.cpp:194: +2, including nesting penalty of 1, nesting level increased to 2

    RETURN_IF_ERROR(JniUtil::GetGlobalClassRef(env, "java/lang/management/ManagementFactory",
    ^

be/src/common/status.h:631: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/util/jvm_metrics.cpp:197: +1, including nesting penalty of 0, nesting level increased to 1

    JNI_CALL_METHOD_CHECK_EXCEPTION(, _getMemoryMXBeanMethod, env,
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:42: expanded from macro 'RETURN_ERROR_IF_EXC'

    do {                                             \
    ^

be/src/util/jvm_metrics.cpp:197: +2, including nesting penalty of 1, nesting level increased to 2

    JNI_CALL_METHOD_CHECK_EXCEPTION(, _getMemoryMXBeanMethod, env,
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:43: expanded from macro 'RETURN_ERROR_IF_EXC'

        if (env->ExceptionCheck()) [[unlikely]]      \
        ^

be/src/util/jvm_metrics.cpp:201: +1, including nesting penalty of 0, nesting level increased to 1

    RETURN_IF_ERROR(JniUtil::GetGlobalClassRef(env, "java/lang/management/MemoryUsage",
    ^

be/src/common/status.h:629: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/util/jvm_metrics.cpp:201: +2, including nesting penalty of 1, nesting level increased to 2

    RETURN_IF_ERROR(JniUtil::GetGlobalClassRef(env, "java/lang/management/MemoryUsage",
    ^

be/src/common/status.h:631: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/util/jvm_metrics.cpp:204: +1, including nesting penalty of 0, nesting level increased to 1

    JNI_CALL_METHOD_CHECK_EXCEPTION(, _getMemoryUsageUsedMethod, env,
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:42: expanded from macro 'RETURN_ERROR_IF_EXC'

    do {                                             \
    ^

be/src/util/jvm_metrics.cpp:204: +2, including nesting penalty of 1, nesting level increased to 2

    JNI_CALL_METHOD_CHECK_EXCEPTION(, _getMemoryUsageUsedMethod, env,
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:43: expanded from macro 'RETURN_ERROR_IF_EXC'

        if (env->ExceptionCheck()) [[unlikely]]      \
        ^

be/src/util/jvm_metrics.cpp:207: +1, including nesting penalty of 0, nesting level increased to 1

    JNI_CALL_METHOD_CHECK_EXCEPTION(, _getMemoryUsageCommittedMethod, env,
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:42: expanded from macro 'RETURN_ERROR_IF_EXC'

    do {                                             \
    ^

be/src/util/jvm_metrics.cpp:207: +2, including nesting penalty of 1, nesting level increased to 2

    JNI_CALL_METHOD_CHECK_EXCEPTION(, _getMemoryUsageCommittedMethod, env,
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:43: expanded from macro 'RETURN_ERROR_IF_EXC'

        if (env->ExceptionCheck()) [[unlikely]]      \
        ^

be/src/util/jvm_metrics.cpp:210: +1, including nesting penalty of 0, nesting level increased to 1

    JNI_CALL_METHOD_CHECK_EXCEPTION(, _getMemoryUsageMaxMethod, env,
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:42: expanded from macro 'RETURN_ERROR_IF_EXC'

    do {                                             \
    ^

be/src/util/jvm_metrics.cpp:210: +2, including nesting penalty of 1, nesting level increased to 2

    JNI_CALL_METHOD_CHECK_EXCEPTION(, _getMemoryUsageMaxMethod, env,
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:43: expanded from macro 'RETURN_ERROR_IF_EXC'

        if (env->ExceptionCheck()) [[unlikely]]      \
        ^

be/src/util/jvm_metrics.cpp:213: +1, including nesting penalty of 0, nesting level increased to 1

    RETURN_IF_ERROR(JniUtil::GetGlobalClassRef(env, "java/lang/management/MemoryMXBean",
    ^

be/src/common/status.h:629: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/util/jvm_metrics.cpp:213: +2, including nesting penalty of 1, nesting level increased to 2

    RETURN_IF_ERROR(JniUtil::GetGlobalClassRef(env, "java/lang/management/MemoryMXBean",
    ^

be/src/common/status.h:631: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/util/jvm_metrics.cpp:216: +1, including nesting penalty of 0, nesting level increased to 1

    JNI_CALL_METHOD_CHECK_EXCEPTION(, _getHeapMemoryUsageMethod, env,
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:42: expanded from macro 'RETURN_ERROR_IF_EXC'

    do {                                             \
    ^

be/src/util/jvm_metrics.cpp:216: +2, including nesting penalty of 1, nesting level increased to 2

    JNI_CALL_METHOD_CHECK_EXCEPTION(, _getHeapMemoryUsageMethod, env,
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:43: expanded from macro 'RETURN_ERROR_IF_EXC'

        if (env->ExceptionCheck()) [[unlikely]]      \
        ^

be/src/util/jvm_metrics.cpp:219: +1, including nesting penalty of 0, nesting level increased to 1

    JNI_CALL_METHOD_CHECK_EXCEPTION(, _getNonHeapMemoryUsageMethod, env,
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:42: expanded from macro 'RETURN_ERROR_IF_EXC'

    do {                                             \
    ^

be/src/util/jvm_metrics.cpp:219: +2, including nesting penalty of 1, nesting level increased to 2

    JNI_CALL_METHOD_CHECK_EXCEPTION(, _getNonHeapMemoryUsageMethod, env,
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:43: expanded from macro 'RETURN_ERROR_IF_EXC'

        if (env->ExceptionCheck()) [[unlikely]]      \
        ^

be/src/util/jvm_metrics.cpp:223: +1, including nesting penalty of 0, nesting level increased to 1

    JNI_CALL_METHOD_CHECK_EXCEPTION(
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:42: expanded from macro 'RETURN_ERROR_IF_EXC'

    do {                                             \
    ^

be/src/util/jvm_metrics.cpp:223: +2, including nesting penalty of 1, nesting level increased to 2

    JNI_CALL_METHOD_CHECK_EXCEPTION(
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:43: expanded from macro 'RETURN_ERROR_IF_EXC'

        if (env->ExceptionCheck()) [[unlikely]]      \
        ^

be/src/util/jvm_metrics.cpp:228: +1, including nesting penalty of 0, nesting level increased to 1

    RETURN_IF_ERROR(JniUtil::GetGlobalClassRef(env, "java/util/List", &_listClass));
    ^

be/src/common/status.h:629: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/util/jvm_metrics.cpp:228: +2, including nesting penalty of 1, nesting level increased to 2

    RETURN_IF_ERROR(JniUtil::GetGlobalClassRef(env, "java/util/List", &_listClass));
    ^

be/src/common/status.h:631: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/util/jvm_metrics.cpp:230: +1, including nesting penalty of 0, nesting level increased to 1

    JNI_CALL_METHOD_CHECK_EXCEPTION(, _getListSizeMethod, env,
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:42: expanded from macro 'RETURN_ERROR_IF_EXC'

    do {                                             \
    ^

be/src/util/jvm_metrics.cpp:230: +2, including nesting penalty of 1, nesting level increased to 2

    JNI_CALL_METHOD_CHECK_EXCEPTION(, _getListSizeMethod, env,
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:43: expanded from macro 'RETURN_ERROR_IF_EXC'

        if (env->ExceptionCheck()) [[unlikely]]      \
        ^

be/src/util/jvm_metrics.cpp:233: +1, including nesting penalty of 0, nesting level increased to 1

    JNI_CALL_METHOD_CHECK_EXCEPTION(, _getListUseIndexMethod, env,
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:42: expanded from macro 'RETURN_ERROR_IF_EXC'

    do {                                             \
    ^

be/src/util/jvm_metrics.cpp:233: +2, including nesting penalty of 1, nesting level increased to 2

    JNI_CALL_METHOD_CHECK_EXCEPTION(, _getListUseIndexMethod, env,
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:43: expanded from macro 'RETURN_ERROR_IF_EXC'

        if (env->ExceptionCheck()) [[unlikely]]      \
        ^

be/src/util/jvm_metrics.cpp:236: +1, including nesting penalty of 0, nesting level increased to 1

    RETURN_IF_ERROR(JniUtil::GetGlobalClassRef(env, "java/lang/management/MemoryPoolMXBean",
    ^

be/src/common/status.h:629: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/util/jvm_metrics.cpp:236: +2, including nesting penalty of 1, nesting level increased to 2

    RETURN_IF_ERROR(JniUtil::GetGlobalClassRef(env, "java/lang/management/MemoryPoolMXBean",
    ^

be/src/common/status.h:631: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/util/jvm_metrics.cpp:239: +1, including nesting penalty of 0, nesting level increased to 1

    JNI_CALL_METHOD_CHECK_EXCEPTION(, _getMemoryPoolMXBeanUsageMethod, env,
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:42: expanded from macro 'RETURN_ERROR_IF_EXC'

    do {                                             \
    ^

be/src/util/jvm_metrics.cpp:239: +2, including nesting penalty of 1, nesting level increased to 2

    JNI_CALL_METHOD_CHECK_EXCEPTION(, _getMemoryPoolMXBeanUsageMethod, env,
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:43: expanded from macro 'RETURN_ERROR_IF_EXC'

        if (env->ExceptionCheck()) [[unlikely]]      \
        ^

be/src/util/jvm_metrics.cpp:243: +1, including nesting penalty of 0, nesting level increased to 1

    JNI_CALL_METHOD_CHECK_EXCEPTION(, _getMemoryPollMXBeanPeakMethod, env,
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:42: expanded from macro 'RETURN_ERROR_IF_EXC'

    do {                                             \
    ^

be/src/util/jvm_metrics.cpp:243: +2, including nesting penalty of 1, nesting level increased to 2

    JNI_CALL_METHOD_CHECK_EXCEPTION(, _getMemoryPollMXBeanPeakMethod, env,
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:43: expanded from macro 'RETURN_ERROR_IF_EXC'

        if (env->ExceptionCheck()) [[unlikely]]      \
        ^

be/src/util/jvm_metrics.cpp:246: +1, including nesting penalty of 0, nesting level increased to 1

    JNI_CALL_METHOD_CHECK_EXCEPTION(
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:42: expanded from macro 'RETURN_ERROR_IF_EXC'

    do {                                             \
    ^

be/src/util/jvm_metrics.cpp:246: +2, including nesting penalty of 1, nesting level increased to 2

    JNI_CALL_METHOD_CHECK_EXCEPTION(
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:43: expanded from macro 'RETURN_ERROR_IF_EXC'

        if (env->ExceptionCheck()) [[unlikely]]      \
        ^

be/src/util/jvm_metrics.cpp:250: +1, including nesting penalty of 0, nesting level increased to 1

    JNI_CALL_METHOD_CHECK_EXCEPTION(, _getThreadMXBeanMethod, env,
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:42: expanded from macro 'RETURN_ERROR_IF_EXC'

    do {                                             \
    ^

be/src/util/jvm_metrics.cpp:250: +2, including nesting penalty of 1, nesting level increased to 2

    JNI_CALL_METHOD_CHECK_EXCEPTION(, _getThreadMXBeanMethod, env,
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:43: expanded from macro 'RETURN_ERROR_IF_EXC'

        if (env->ExceptionCheck()) [[unlikely]]      \
        ^

be/src/util/jvm_metrics.cpp:254: +1, including nesting penalty of 0, nesting level increased to 1

    JNI_CALL_METHOD_CHECK_EXCEPTION(
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:42: expanded from macro 'RETURN_ERROR_IF_EXC'

    do {                                             \
    ^

be/src/util/jvm_metrics.cpp:254: +2, including nesting penalty of 1, nesting level increased to 2

    JNI_CALL_METHOD_CHECK_EXCEPTION(
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:43: expanded from macro 'RETURN_ERROR_IF_EXC'

        if (env->ExceptionCheck()) [[unlikely]]      \
        ^

be/src/util/jvm_metrics.cpp:259: +1, including nesting penalty of 0, nesting level increased to 1

    RETURN_IF_ERROR(JniUtil::GetGlobalClassRef(env, "java/lang/management/GarbageCollectorMXBean",
    ^

be/src/common/status.h:629: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/util/jvm_metrics.cpp:259: +2, including nesting penalty of 1, nesting level increased to 2

    RETURN_IF_ERROR(JniUtil::GetGlobalClassRef(env, "java/lang/management/GarbageCollectorMXBean",
    ^

be/src/common/status.h:631: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/util/jvm_metrics.cpp:262: +1, including nesting penalty of 0, nesting level increased to 1

    JNI_CALL_METHOD_CHECK_EXCEPTION(
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:42: expanded from macro 'RETURN_ERROR_IF_EXC'

    do {                                             \
    ^

be/src/util/jvm_metrics.cpp:262: +2, including nesting penalty of 1, nesting level increased to 2

    JNI_CALL_METHOD_CHECK_EXCEPTION(
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:43: expanded from macro 'RETURN_ERROR_IF_EXC'

        if (env->ExceptionCheck()) [[unlikely]]      \
        ^

be/src/util/jvm_metrics.cpp:266: +1, including nesting penalty of 0, nesting level increased to 1

    JNI_CALL_METHOD_CHECK_EXCEPTION(
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:42: expanded from macro 'RETURN_ERROR_IF_EXC'

    do {                                             \
    ^

be/src/util/jvm_metrics.cpp:266: +2, including nesting penalty of 1, nesting level increased to 2

    JNI_CALL_METHOD_CHECK_EXCEPTION(
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:43: expanded from macro 'RETURN_ERROR_IF_EXC'

        if (env->ExceptionCheck()) [[unlikely]]      \
        ^

be/src/util/jvm_metrics.cpp:270: +1, including nesting penalty of 0, nesting level increased to 1

    JNI_CALL_METHOD_CHECK_EXCEPTION(
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:42: expanded from macro 'RETURN_ERROR_IF_EXC'

    do {                                             \
    ^

be/src/util/jvm_metrics.cpp:270: +2, including nesting penalty of 1, nesting level increased to 2

    JNI_CALL_METHOD_CHECK_EXCEPTION(
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:43: expanded from macro 'RETURN_ERROR_IF_EXC'

        if (env->ExceptionCheck()) [[unlikely]]      \
        ^

be/src/util/jvm_metrics.cpp:274: +1, including nesting penalty of 0, nesting level increased to 1

    RETURN_IF_ERROR(JniUtil::GetGlobalClassRef(env, "java/lang/management/ThreadMXBean",
    ^

be/src/common/status.h:629: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/util/jvm_metrics.cpp:274: +2, including nesting penalty of 1, nesting level increased to 2

    RETURN_IF_ERROR(JniUtil::GetGlobalClassRef(env, "java/lang/management/ThreadMXBean",
    ^

be/src/common/status.h:631: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/util/jvm_metrics.cpp:277: +1, including nesting penalty of 0, nesting level increased to 1

    JNI_CALL_METHOD_CHECK_EXCEPTION(,
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:42: expanded from macro 'RETURN_ERROR_IF_EXC'

    do {                                             \
    ^

be/src/util/jvm_metrics.cpp:277: +2, including nesting penalty of 1, nesting level increased to 2

    JNI_CALL_METHOD_CHECK_EXCEPTION(,
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:43: expanded from macro 'RETURN_ERROR_IF_EXC'

        if (env->ExceptionCheck()) [[unlikely]]      \
        ^

be/src/util/jvm_metrics.cpp:282: +1, including nesting penalty of 0, nesting level increased to 1

    JNI_CALL_METHOD_CHECK_EXCEPTION(,
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:42: expanded from macro 'RETURN_ERROR_IF_EXC'

    do {                                             \
    ^

be/src/util/jvm_metrics.cpp:282: +2, including nesting penalty of 1, nesting level increased to 2

    JNI_CALL_METHOD_CHECK_EXCEPTION(,
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:43: expanded from macro 'RETURN_ERROR_IF_EXC'

        if (env->ExceptionCheck()) [[unlikely]]      \
        ^

be/src/util/jvm_metrics.cpp:288: +1, including nesting penalty of 0, nesting level increased to 1

    JNI_CALL_METHOD_CHECK_EXCEPTION(,
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:42: expanded from macro 'RETURN_ERROR_IF_EXC'

    do {                                             \
    ^

be/src/util/jvm_metrics.cpp:288: +2, including nesting penalty of 1, nesting level increased to 2

    JNI_CALL_METHOD_CHECK_EXCEPTION(,
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:43: expanded from macro 'RETURN_ERROR_IF_EXC'

        if (env->ExceptionCheck()) [[unlikely]]      \
        ^

be/src/util/jvm_metrics.cpp:293: +1, including nesting penalty of 0, nesting level increased to 1

    RETURN_IF_ERROR(
    ^

be/src/common/status.h:629: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/util/jvm_metrics.cpp:293: +2, including nesting penalty of 1, nesting level increased to 2

    RETURN_IF_ERROR(
    ^

be/src/common/status.h:631: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/util/jvm_metrics.cpp:296: +1, including nesting penalty of 0, nesting level increased to 1

    JNI_CALL_METHOD_CHECK_EXCEPTION(
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:42: expanded from macro 'RETURN_ERROR_IF_EXC'

    do {                                             \
    ^

be/src/util/jvm_metrics.cpp:296: +2, including nesting penalty of 1, nesting level increased to 2

    JNI_CALL_METHOD_CHECK_EXCEPTION(
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:43: expanded from macro 'RETURN_ERROR_IF_EXC'

        if (env->ExceptionCheck()) [[unlikely]]      \
        ^

be/src/util/jvm_metrics.cpp:302: +1, including nesting penalty of 0, nesting level increased to 1

    RETURN_IF_ERROR(JniUtil::GetGlobalClassRef(env, "java/lang/Thread$State", &_threadStateClass));
    ^

be/src/common/status.h:629: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/util/jvm_metrics.cpp:302: +2, including nesting penalty of 1, nesting level increased to 2

    RETURN_IF_ERROR(JniUtil::GetGlobalClassRef(env, "java/lang/Thread$State", &_threadStateClass));
    ^

be/src/common/status.h:631: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/util/jvm_metrics.cpp:304: +1, including nesting penalty of 0, nesting level increased to 1

    JNI_CALL_METHOD_CHECK_EXCEPTION(
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:42: expanded from macro 'RETURN_ERROR_IF_EXC'

    do {                                             \
    ^

be/src/util/jvm_metrics.cpp:304: +2, including nesting penalty of 1, nesting level increased to 2

    JNI_CALL_METHOD_CHECK_EXCEPTION(
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:43: expanded from macro 'RETURN_ERROR_IF_EXC'

        if (env->ExceptionCheck()) [[unlikely]]      \
        ^

be/src/util/jvm_metrics.cpp:308: +1, including nesting penalty of 0, nesting level increased to 1

    JNI_CALL_METHOD_CHECK_EXCEPTION(
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:42: expanded from macro 'RETURN_ERROR_IF_EXC'

    do {                                             \
    ^

be/src/util/jvm_metrics.cpp:308: +2, including nesting penalty of 1, nesting level increased to 2

    JNI_CALL_METHOD_CHECK_EXCEPTION(
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:43: expanded from macro 'RETURN_ERROR_IF_EXC'

        if (env->ExceptionCheck()) [[unlikely]]      \
        ^

be/src/util/jvm_metrics.cpp:312: +1, including nesting penalty of 0, nesting level increased to 1

    JNI_CALL_METHOD_CHECK_EXCEPTION(
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:42: expanded from macro 'RETURN_ERROR_IF_EXC'

    do {                                             \
    ^

be/src/util/jvm_metrics.cpp:312: +2, including nesting penalty of 1, nesting level increased to 2

    JNI_CALL_METHOD_CHECK_EXCEPTION(
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:43: expanded from macro 'RETURN_ERROR_IF_EXC'

        if (env->ExceptionCheck()) [[unlikely]]      \
        ^

be/src/util/jvm_metrics.cpp:315: +1, including nesting penalty of 0, nesting level increased to 1

    JNI_CALL_METHOD_CHECK_EXCEPTION(
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:42: expanded from macro 'RETURN_ERROR_IF_EXC'

    do {                                             \
    ^

be/src/util/jvm_metrics.cpp:315: +2, including nesting penalty of 1, nesting level increased to 2

    JNI_CALL_METHOD_CHECK_EXCEPTION(
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:43: expanded from macro 'RETURN_ERROR_IF_EXC'

        if (env->ExceptionCheck()) [[unlikely]]      \
        ^

be/src/util/jvm_metrics.cpp:319: +1, including nesting penalty of 0, nesting level increased to 1

    JNI_CALL_METHOD_CHECK_EXCEPTION(
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:42: expanded from macro 'RETURN_ERROR_IF_EXC'

    do {                                             \
    ^

be/src/util/jvm_metrics.cpp:319: +2, including nesting penalty of 1, nesting level increased to 2

    JNI_CALL_METHOD_CHECK_EXCEPTION(
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:43: expanded from macro 'RETURN_ERROR_IF_EXC'

        if (env->ExceptionCheck()) [[unlikely]]      \
        ^

be/src/util/jvm_metrics.cpp:322: +1, including nesting penalty of 0, nesting level increased to 1

    JNI_CALL_METHOD_CHECK_EXCEPTION(
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:42: expanded from macro 'RETURN_ERROR_IF_EXC'

    do {                                             \
    ^

be/src/util/jvm_metrics.cpp:322: +2, including nesting penalty of 1, nesting level increased to 2

    JNI_CALL_METHOD_CHECK_EXCEPTION(
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:43: expanded from macro 'RETURN_ERROR_IF_EXC'

        if (env->ExceptionCheck()) [[unlikely]]      \
        ^

be/src/util/jvm_metrics.cpp:326: +1, including nesting penalty of 0, nesting level increased to 1

    JNI_CALL_METHOD_CHECK_EXCEPTION(jobject, newThreadStateObj, env,
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:42: expanded from macro 'RETURN_ERROR_IF_EXC'

    do {                                             \
    ^

be/src/util/jvm_metrics.cpp:326: +2, including nesting penalty of 1, nesting level increased to 2

    JNI_CALL_METHOD_CHECK_EXCEPTION(jobject, newThreadStateObj, env,
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:43: expanded from macro 'RETURN_ERROR_IF_EXC'

        if (env->ExceptionCheck()) [[unlikely]]      \
        ^

be/src/util/jvm_metrics.cpp:328: +1, including nesting penalty of 0, nesting level increased to 1

    RETURN_IF_ERROR(JniUtil::LocalToGlobalRef(env, newThreadStateObj, &_newThreadStateObj));
    ^

be/src/common/status.h:629: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/util/jvm_metrics.cpp:328: +2, including nesting penalty of 1, nesting level increased to 2

    RETURN_IF_ERROR(JniUtil::LocalToGlobalRef(env, newThreadStateObj, &_newThreadStateObj));
    ^

be/src/common/status.h:631: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/util/jvm_metrics.cpp:330: +1, including nesting penalty of 0, nesting level increased to 1

    JNI_CALL_METHOD_CHECK_EXCEPTION(jobject, runnableThreadStateObj, env,
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:42: expanded from macro 'RETURN_ERROR_IF_EXC'

    do {                                             \
    ^

be/src/util/jvm_metrics.cpp:330: +2, including nesting penalty of 1, nesting level increased to 2

    JNI_CALL_METHOD_CHECK_EXCEPTION(jobject, runnableThreadStateObj, env,
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:43: expanded from macro 'RETURN_ERROR_IF_EXC'

        if (env->ExceptionCheck()) [[unlikely]]      \
        ^

be/src/util/jvm_metrics.cpp:332: +1, including nesting penalty of 0, nesting level increased to 1

    RETURN_IF_ERROR(
    ^

be/src/common/status.h:629: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/util/jvm_metrics.cpp:332: +2, including nesting penalty of 1, nesting level increased to 2

    RETURN_IF_ERROR(
    ^

be/src/common/status.h:631: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/util/jvm_metrics.cpp:335: +1, including nesting penalty of 0, nesting level increased to 1

    JNI_CALL_METHOD_CHECK_EXCEPTION(jobject, blockedThreadStateObj, env,
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:42: expanded from macro 'RETURN_ERROR_IF_EXC'

    do {                                             \
    ^

be/src/util/jvm_metrics.cpp:335: +2, including nesting penalty of 1, nesting level increased to 2

    JNI_CALL_METHOD_CHECK_EXCEPTION(jobject, blockedThreadStateObj, env,
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:43: expanded from macro 'RETURN_ERROR_IF_EXC'

        if (env->ExceptionCheck()) [[unlikely]]      \
        ^

be/src/util/jvm_metrics.cpp:337: +1, including nesting penalty of 0, nesting level increased to 1

    RETURN_IF_ERROR(JniUtil::LocalToGlobalRef(env, blockedThreadStateObj, &_blockedThreadStateObj));
    ^

be/src/common/status.h:629: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/util/jvm_metrics.cpp:337: +2, including nesting penalty of 1, nesting level increased to 2

    RETURN_IF_ERROR(JniUtil::LocalToGlobalRef(env, blockedThreadStateObj, &_blockedThreadStateObj));
    ^

be/src/common/status.h:631: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/util/jvm_metrics.cpp:339: +1, including nesting penalty of 0, nesting level increased to 1

    JNI_CALL_METHOD_CHECK_EXCEPTION(jobject, waitingThreadStateObj, env,
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:42: expanded from macro 'RETURN_ERROR_IF_EXC'

    do {                                             \
    ^

be/src/util/jvm_metrics.cpp:339: +2, including nesting penalty of 1, nesting level increased to 2

    JNI_CALL_METHOD_CHECK_EXCEPTION(jobject, waitingThreadStateObj, env,
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:43: expanded from macro 'RETURN_ERROR_IF_EXC'

        if (env->ExceptionCheck()) [[unlikely]]      \
        ^

be/src/util/jvm_metrics.cpp:341: +1, including nesting penalty of 0, nesting level increased to 1

    RETURN_IF_ERROR(JniUtil::LocalToGlobalRef(env, waitingThreadStateObj, &_waitingThreadStateObj));
    ^

be/src/common/status.h:629: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/util/jvm_metrics.cpp:341: +2, including nesting penalty of 1, nesting level increased to 2

    RETURN_IF_ERROR(JniUtil::LocalToGlobalRef(env, waitingThreadStateObj, &_waitingThreadStateObj));
    ^

be/src/common/status.h:631: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/util/jvm_metrics.cpp:343: +1, including nesting penalty of 0, nesting level increased to 1

    JNI_CALL_METHOD_CHECK_EXCEPTION(
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:42: expanded from macro 'RETURN_ERROR_IF_EXC'

    do {                                             \
    ^

be/src/util/jvm_metrics.cpp:343: +2, including nesting penalty of 1, nesting level increased to 2

    JNI_CALL_METHOD_CHECK_EXCEPTION(
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:43: expanded from macro 'RETURN_ERROR_IF_EXC'

        if (env->ExceptionCheck()) [[unlikely]]      \
        ^

be/src/util/jvm_metrics.cpp:346: +1, including nesting penalty of 0, nesting level increased to 1

    RETURN_IF_ERROR(JniUtil::LocalToGlobalRef(env, timedWaitingThreadStateObj,
    ^

be/src/common/status.h:629: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/util/jvm_metrics.cpp:346: +2, including nesting penalty of 1, nesting level increased to 2

    RETURN_IF_ERROR(JniUtil::LocalToGlobalRef(env, timedWaitingThreadStateObj,
    ^

be/src/common/status.h:631: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/util/jvm_metrics.cpp:349: +1, including nesting penalty of 0, nesting level increased to 1

    JNI_CALL_METHOD_CHECK_EXCEPTION(
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:42: expanded from macro 'RETURN_ERROR_IF_EXC'

    do {                                             \
    ^

be/src/util/jvm_metrics.cpp:349: +2, including nesting penalty of 1, nesting level increased to 2

    JNI_CALL_METHOD_CHECK_EXCEPTION(
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:43: expanded from macro 'RETURN_ERROR_IF_EXC'

        if (env->ExceptionCheck()) [[unlikely]]      \
        ^

be/src/util/jvm_metrics.cpp:352: +1, including nesting penalty of 0, nesting level increased to 1

    RETURN_IF_ERROR(
    ^

be/src/common/status.h:629: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/util/jvm_metrics.cpp:352: +2, including nesting penalty of 1, nesting level increased to 2

    RETURN_IF_ERROR(
    ^

be/src/common/status.h:631: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

<< "Class java/lang/management/ManagementFactory Not Find.JVM monitoring fails.";
return;
}
Status JvmStats::init() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: function 'init' exceeds recommended size/complexity thresholds [readability-function-size]

Status JvmStats::init() {
                 ^
Additional context

be/src/util/jvm_metrics.cpp:190: 169 lines including whitespace and comments (threshold 80)

Status JvmStats::init() {
                 ^

}

void JvmStats::refresh(JvmMetrics* jvm_metrics) {
Status JvmStats::refresh(JvmMetrics* jvm_metrics) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: function 'refresh' has cognitive complexity of 184 (threshold 50) [readability-function-cognitive-complexity]

Status JvmStats::refresh(JvmMetrics* jvm_metrics) {
                 ^
Additional context

be/src/util/jvm_metrics.cpp:362: +1, including nesting penalty of 0, nesting level increased to 1

    if (!_init_complete) {
    ^

be/src/util/jvm_metrics.cpp:367: +1, including nesting penalty of 0, nesting level increased to 1

    RETURN_IF_ERROR(JniUtil::GetJNIEnv(&env));
    ^

be/src/common/status.h:629: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/util/jvm_metrics.cpp:367: +2, including nesting penalty of 1, nesting level increased to 2

    RETURN_IF_ERROR(JniUtil::GetJNIEnv(&env));
    ^

be/src/common/status.h:631: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/util/jvm_metrics.cpp:369: nesting level increased to 1

    JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF(
    ^

be/src/util/jni-util.h:49: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF'

    DEFER(env->DeleteLocalRef(result));                                     \
    ^

be/src/util/defer_op.h:45: expanded from macro 'DEFER'

#define DEFER(...) DEFER_FWD(__LINE__, __VA_ARGS__)
                   ^

be/src/util/defer_op.h:44: expanded from macro 'DEFER_FWD'

#define DEFER_FWD(n, ...) DEFER_CONCAT(n, __VA_ARGS__)
                          ^

be/src/util/defer_op.h:43: expanded from macro 'DEFER_CONCAT'

#define DEFER_CONCAT(n, ...) const auto defer##n = doris::Defer([&]() { __VA_ARGS__; })
                                                                ^

be/src/util/jvm_metrics.cpp:369: +1, including nesting penalty of 0, nesting level increased to 1

    JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF(
    ^

be/src/util/jni-util.h:50: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:42: expanded from macro 'RETURN_ERROR_IF_EXC'

    do {                                             \
    ^

be/src/util/jvm_metrics.cpp:369: +2, including nesting penalty of 1, nesting level increased to 2

    JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF(
    ^

be/src/util/jni-util.h:50: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:43: expanded from macro 'RETURN_ERROR_IF_EXC'

        if (env->ExceptionCheck()) [[unlikely]]      \
        ^

be/src/util/jvm_metrics.cpp:373: nesting level increased to 1

    JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF(
    ^

be/src/util/jni-util.h:49: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF'

    DEFER(env->DeleteLocalRef(result));                                     \
    ^

be/src/util/defer_op.h:45: expanded from macro 'DEFER'

#define DEFER(...) DEFER_FWD(__LINE__, __VA_ARGS__)
                   ^

be/src/util/defer_op.h:44: expanded from macro 'DEFER_FWD'

#define DEFER_FWD(n, ...) DEFER_CONCAT(n, __VA_ARGS__)
                          ^

be/src/util/defer_op.h:43: expanded from macro 'DEFER_CONCAT'

#define DEFER_CONCAT(n, ...) const auto defer##n = doris::Defer([&]() { __VA_ARGS__; })
                                                                ^

be/src/util/jvm_metrics.cpp:373: +1, including nesting penalty of 0, nesting level increased to 1

    JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF(
    ^

be/src/util/jni-util.h:50: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:42: expanded from macro 'RETURN_ERROR_IF_EXC'

    do {                                             \
    ^

be/src/util/jvm_metrics.cpp:373: +2, including nesting penalty of 1, nesting level increased to 2

    JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF(
    ^

be/src/util/jni-util.h:50: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:43: expanded from macro 'RETURN_ERROR_IF_EXC'

        if (env->ExceptionCheck()) [[unlikely]]      \
        ^

be/src/util/jvm_metrics.cpp:377: +1, including nesting penalty of 0, nesting level increased to 1

    JNI_CALL_METHOD_CHECK_EXCEPTION(jlong, heapMemoryUsed, env,
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:42: expanded from macro 'RETURN_ERROR_IF_EXC'

    do {                                             \
    ^

be/src/util/jvm_metrics.cpp:377: +2, including nesting penalty of 1, nesting level increased to 2

    JNI_CALL_METHOD_CHECK_EXCEPTION(jlong, heapMemoryUsed, env,
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:43: expanded from macro 'RETURN_ERROR_IF_EXC'

        if (env->ExceptionCheck()) [[unlikely]]      \
        ^

be/src/util/jvm_metrics.cpp:380: +1, including nesting penalty of 0, nesting level increased to 1

    JNI_CALL_METHOD_CHECK_EXCEPTION(
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:42: expanded from macro 'RETURN_ERROR_IF_EXC'

    do {                                             \
    ^

be/src/util/jvm_metrics.cpp:380: +2, including nesting penalty of 1, nesting level increased to 2

    JNI_CALL_METHOD_CHECK_EXCEPTION(
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:43: expanded from macro 'RETURN_ERROR_IF_EXC'

        if (env->ExceptionCheck()) [[unlikely]]      \
        ^

be/src/util/jvm_metrics.cpp:384: +1, including nesting penalty of 0, nesting level increased to 1

    JNI_CALL_METHOD_CHECK_EXCEPTION(jlong, heapMemoryMax, env,
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:42: expanded from macro 'RETURN_ERROR_IF_EXC'

    do {                                             \
    ^

be/src/util/jvm_metrics.cpp:384: +2, including nesting penalty of 1, nesting level increased to 2

    JNI_CALL_METHOD_CHECK_EXCEPTION(jlong, heapMemoryMax, env,
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:43: expanded from macro 'RETURN_ERROR_IF_EXC'

        if (env->ExceptionCheck()) [[unlikely]]      \
        ^

be/src/util/jvm_metrics.cpp:387: +1, including nesting penalty of 0, nesting level increased to 1

    jvm_metrics->jvm_heap_size_bytes_used->set_value(heapMemoryUsed < 0 ? 0 : heapMemoryUsed);
                                                                        ^

be/src/util/jvm_metrics.cpp:389: +1, including nesting penalty of 0, nesting level increased to 1

            heapMemoryCommitted < 0 ? 0 : heapMemoryCommitted);
                                    ^

be/src/util/jvm_metrics.cpp:390: +1, including nesting penalty of 0, nesting level increased to 1

    jvm_metrics->jvm_heap_size_bytes_max->set_value(heapMemoryMax < 0 ? 0 : heapMemoryMax);
                                                                      ^

be/src/util/jvm_metrics.cpp:392: nesting level increased to 1

    JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF(
    ^

be/src/util/jni-util.h:49: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF'

    DEFER(env->DeleteLocalRef(result));                                     \
    ^

be/src/util/defer_op.h:45: expanded from macro 'DEFER'

#define DEFER(...) DEFER_FWD(__LINE__, __VA_ARGS__)
                   ^

be/src/util/defer_op.h:44: expanded from macro 'DEFER_FWD'

#define DEFER_FWD(n, ...) DEFER_CONCAT(n, __VA_ARGS__)
                          ^

be/src/util/defer_op.h:43: expanded from macro 'DEFER_CONCAT'

#define DEFER_CONCAT(n, ...) const auto defer##n = doris::Defer([&]() { __VA_ARGS__; })
                                                                ^

be/src/util/jvm_metrics.cpp:392: +1, including nesting penalty of 0, nesting level increased to 1

    JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF(
    ^

be/src/util/jni-util.h:50: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:42: expanded from macro 'RETURN_ERROR_IF_EXC'

    do {                                             \
    ^

be/src/util/jvm_metrics.cpp:392: +2, including nesting penalty of 1, nesting level increased to 2

    JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF(
    ^

be/src/util/jni-util.h:50: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:43: expanded from macro 'RETURN_ERROR_IF_EXC'

        if (env->ExceptionCheck()) [[unlikely]]      \
        ^

be/src/util/jvm_metrics.cpp:396: +1, including nesting penalty of 0, nesting level increased to 1

    JNI_CALL_METHOD_CHECK_EXCEPTION(
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:42: expanded from macro 'RETURN_ERROR_IF_EXC'

    do {                                             \
    ^

be/src/util/jvm_metrics.cpp:396: +2, including nesting penalty of 1, nesting level increased to 2

    JNI_CALL_METHOD_CHECK_EXCEPTION(
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:43: expanded from macro 'RETURN_ERROR_IF_EXC'

        if (env->ExceptionCheck()) [[unlikely]]      \
        ^

be/src/util/jvm_metrics.cpp:400: +1, including nesting penalty of 0, nesting level increased to 1

    JNI_CALL_METHOD_CHECK_EXCEPTION(
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:42: expanded from macro 'RETURN_ERROR_IF_EXC'

    do {                                             \
    ^

be/src/util/jvm_metrics.cpp:400: +2, including nesting penalty of 1, nesting level increased to 2

    JNI_CALL_METHOD_CHECK_EXCEPTION(
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:43: expanded from macro 'RETURN_ERROR_IF_EXC'

        if (env->ExceptionCheck()) [[unlikely]]      \
        ^

be/src/util/jvm_metrics.cpp:405: +1, including nesting penalty of 0, nesting level increased to 1

            nonHeapMemoryCommitted < 0 ? 0 : nonHeapMemoryCommitted);
                                       ^

be/src/util/jvm_metrics.cpp:406: +1, including nesting penalty of 0, nesting level increased to 1

    jvm_metrics->jvm_non_heap_size_bytes_used->set_value(nonHeapMemoryUsed < 0 ? 0
                                                                               ^

be/src/util/jvm_metrics.cpp:409: nesting level increased to 1

    JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF(
    ^

be/src/util/jni-util.h:49: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF'

    DEFER(env->DeleteLocalRef(result));                                     \
    ^

be/src/util/defer_op.h:45: expanded from macro 'DEFER'

#define DEFER(...) DEFER_FWD(__LINE__, __VA_ARGS__)
                   ^

be/src/util/defer_op.h:44: expanded from macro 'DEFER_FWD'

#define DEFER_FWD(n, ...) DEFER_CONCAT(n, __VA_ARGS__)
                          ^

be/src/util/defer_op.h:43: expanded from macro 'DEFER_CONCAT'

#define DEFER_CONCAT(n, ...) const auto defer##n = doris::Defer([&]() { __VA_ARGS__; })
                                                                ^

be/src/util/jvm_metrics.cpp:409: +1, including nesting penalty of 0, nesting level increased to 1

    JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF(
    ^

be/src/util/jni-util.h:50: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:42: expanded from macro 'RETURN_ERROR_IF_EXC'

    do {                                             \
    ^

be/src/util/jvm_metrics.cpp:409: +2, including nesting penalty of 1, nesting level increased to 2

    JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF(
    ^

be/src/util/jni-util.h:50: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:43: expanded from macro 'RETURN_ERROR_IF_EXC'

        if (env->ExceptionCheck()) [[unlikely]]      \
        ^

be/src/util/jvm_metrics.cpp:413: +1, including nesting penalty of 0, nesting level increased to 1

    JNI_CALL_METHOD_CHECK_EXCEPTION(jint, size, env,
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:42: expanded from macro 'RETURN_ERROR_IF_EXC'

    do {                                             \
    ^

be/src/util/jvm_metrics.cpp:413: +2, including nesting penalty of 1, nesting level increased to 2

    JNI_CALL_METHOD_CHECK_EXCEPTION(jint, size, env,
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:43: expanded from macro 'RETURN_ERROR_IF_EXC'

        if (env->ExceptionCheck()) [[unlikely]]      \
        ^

be/src/util/jvm_metrics.cpp:416: +1, including nesting penalty of 0, nesting level increased to 1

    for (int i = 0; i < size; ++i) {
    ^

be/src/util/jvm_metrics.cpp:417: nesting level increased to 2

        JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF(
        ^

be/src/util/jni-util.h:49: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF'

    DEFER(env->DeleteLocalRef(result));                                     \
    ^

be/src/util/defer_op.h:45: expanded from macro 'DEFER'

#define DEFER(...) DEFER_FWD(__LINE__, __VA_ARGS__)
                   ^

be/src/util/defer_op.h:44: expanded from macro 'DEFER_FWD'

#define DEFER_FWD(n, ...) DEFER_CONCAT(n, __VA_ARGS__)
                          ^

be/src/util/defer_op.h:43: expanded from macro 'DEFER_CONCAT'

#define DEFER_CONCAT(n, ...) const auto defer##n = doris::Defer([&]() { __VA_ARGS__; })
                                                                ^

be/src/util/jvm_metrics.cpp:417: +2, including nesting penalty of 1, nesting level increased to 2

        JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF(
        ^

be/src/util/jni-util.h:50: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:42: expanded from macro 'RETURN_ERROR_IF_EXC'

    do {                                             \
    ^

be/src/util/jvm_metrics.cpp:417: +3, including nesting penalty of 2, nesting level increased to 3

        JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF(
        ^

be/src/util/jni-util.h:50: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:43: expanded from macro 'RETURN_ERROR_IF_EXC'

        if (env->ExceptionCheck()) [[unlikely]]      \
        ^

be/src/util/jvm_metrics.cpp:421: nesting level increased to 2

        JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF(
        ^

be/src/util/jni-util.h:49: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF'

    DEFER(env->DeleteLocalRef(result));                                     \
    ^

be/src/util/defer_op.h:45: expanded from macro 'DEFER'

#define DEFER(...) DEFER_FWD(__LINE__, __VA_ARGS__)
                   ^

be/src/util/defer_op.h:44: expanded from macro 'DEFER_FWD'

#define DEFER_FWD(n, ...) DEFER_CONCAT(n, __VA_ARGS__)
                          ^

be/src/util/defer_op.h:43: expanded from macro 'DEFER_CONCAT'

#define DEFER_CONCAT(n, ...) const auto defer##n = doris::Defer([&]() { __VA_ARGS__; })
                                                                ^

be/src/util/jvm_metrics.cpp:421: +2, including nesting penalty of 1, nesting level increased to 2

        JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF(
        ^

be/src/util/jni-util.h:50: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:42: expanded from macro 'RETURN_ERROR_IF_EXC'

    do {                                             \
    ^

be/src/util/jvm_metrics.cpp:421: +3, including nesting penalty of 2, nesting level increased to 3

        JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF(
        ^

be/src/util/jni-util.h:50: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:43: expanded from macro 'RETURN_ERROR_IF_EXC'

        if (env->ExceptionCheck()) [[unlikely]]      \
        ^

be/src/util/jvm_metrics.cpp:425: +2, including nesting penalty of 1, nesting level increased to 2

        JNI_CALL_METHOD_CHECK_EXCEPTION(jlong, used, env,
        ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:42: expanded from macro 'RETURN_ERROR_IF_EXC'

    do {                                             \
    ^

be/src/util/jvm_metrics.cpp:425: +3, including nesting penalty of 2, nesting level increased to 3

        JNI_CALL_METHOD_CHECK_EXCEPTION(jlong, used, env,
        ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:43: expanded from macro 'RETURN_ERROR_IF_EXC'

        if (env->ExceptionCheck()) [[unlikely]]      \
        ^

be/src/util/jvm_metrics.cpp:428: +2, including nesting penalty of 1, nesting level increased to 2

        JNI_CALL_METHOD_CHECK_EXCEPTION(jlong, max, env,
        ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:42: expanded from macro 'RETURN_ERROR_IF_EXC'

    do {                                             \
    ^

be/src/util/jvm_metrics.cpp:428: +3, including nesting penalty of 2, nesting level increased to 3

        JNI_CALL_METHOD_CHECK_EXCEPTION(jlong, max, env,
        ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:43: expanded from macro 'RETURN_ERROR_IF_EXC'

        if (env->ExceptionCheck()) [[unlikely]]      \
        ^

be/src/util/jvm_metrics.cpp:431: nesting level increased to 2

        JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF(
        ^

be/src/util/jni-util.h:49: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF'

    DEFER(env->DeleteLocalRef(result));                                     \
    ^

be/src/util/defer_op.h:45: expanded from macro 'DEFER'

#define DEFER(...) DEFER_FWD(__LINE__, __VA_ARGS__)
                   ^

be/src/util/defer_op.h:44: expanded from macro 'DEFER_FWD'

#define DEFER_FWD(n, ...) DEFER_CONCAT(n, __VA_ARGS__)
                          ^

be/src/util/defer_op.h:43: expanded from macro 'DEFER_CONCAT'

#define DEFER_CONCAT(n, ...) const auto defer##n = doris::Defer([&]() { __VA_ARGS__; })
                                                                ^

be/src/util/jvm_metrics.cpp:431: +2, including nesting penalty of 1, nesting level increased to 2

        JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF(
        ^

be/src/util/jni-util.h:50: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:42: expanded from macro 'RETURN_ERROR_IF_EXC'

    do {                                             \
    ^

be/src/util/jvm_metrics.cpp:431: +3, including nesting penalty of 2, nesting level increased to 3

        JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF(
        ^

be/src/util/jni-util.h:50: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:43: expanded from macro 'RETURN_ERROR_IF_EXC'

        if (env->ExceptionCheck()) [[unlikely]]      \
        ^

be/src/util/jvm_metrics.cpp:435: +2, including nesting penalty of 1, nesting level increased to 2

        JNI_CALL_METHOD_CHECK_EXCEPTION(jlong, peakUsed, env,
        ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:42: expanded from macro 'RETURN_ERROR_IF_EXC'

    do {                                             \
    ^

be/src/util/jvm_metrics.cpp:435: +3, including nesting penalty of 2, nesting level increased to 3

        JNI_CALL_METHOD_CHECK_EXCEPTION(jlong, peakUsed, env,
        ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:43: expanded from macro 'RETURN_ERROR_IF_EXC'

        if (env->ExceptionCheck()) [[unlikely]]      \
        ^

be/src/util/jvm_metrics.cpp:438: nesting level increased to 2

        JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF(
        ^

be/src/util/jni-util.h:49: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF'

    DEFER(env->DeleteLocalRef(result));                                     \
    ^

be/src/util/defer_op.h:45: expanded from macro 'DEFER'

#define DEFER(...) DEFER_FWD(__LINE__, __VA_ARGS__)
                   ^

be/src/util/defer_op.h:44: expanded from macro 'DEFER_FWD'

#define DEFER_FWD(n, ...) DEFER_CONCAT(n, __VA_ARGS__)
                          ^

be/src/util/defer_op.h:43: expanded from macro 'DEFER_CONCAT'

#define DEFER_CONCAT(n, ...) const auto defer##n = doris::Defer([&]() { __VA_ARGS__; })
                                                                ^

be/src/util/jvm_metrics.cpp:438: +2, including nesting penalty of 1, nesting level increased to 2

        JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF(
        ^

be/src/util/jni-util.h:50: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:42: expanded from macro 'RETURN_ERROR_IF_EXC'

    do {                                             \
    ^

be/src/util/jvm_metrics.cpp:438: +3, including nesting penalty of 2, nesting level increased to 3

        JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF(
        ^

be/src/util/jni-util.h:50: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:43: expanded from macro 'RETURN_ERROR_IF_EXC'

        if (env->ExceptionCheck()) [[unlikely]]      \
        ^

be/src/util/jvm_metrics.cpp:444: +2, including nesting penalty of 1, nesting level increased to 2

        if (nameStr != nullptr) {
        ^

be/src/util/jvm_metrics.cpp:446: +3, including nesting penalty of 2, nesting level increased to 3

            if (it == _memoryPoolName.end()) {
            ^

be/src/util/jvm_metrics.cpp:449: +3, including nesting penalty of 2, nesting level increased to 3

            if (it->second == memoryPoolNameEnum::YOUNG) {
            ^

be/src/util/jvm_metrics.cpp:450: +4, including nesting penalty of 3, nesting level increased to 4

                jvm_metrics->jvm_young_size_bytes_used->set_value(used < 0 ? 0 : used);
                                                                           ^

be/src/util/jvm_metrics.cpp:451: +4, including nesting penalty of 3, nesting level increased to 4

                jvm_metrics->jvm_young_size_bytes_peak_used->set_value(peakUsed < 0 ? 0 : peakUsed);
                                                                                    ^

be/src/util/jvm_metrics.cpp:452: +4, including nesting penalty of 3, nesting level increased to 4

                jvm_metrics->jvm_young_size_bytes_max->set_value(max < 0 ? 0 : max);
                                                                         ^

be/src/util/jvm_metrics.cpp:454: +1, nesting level increased to 3

            } else if (it->second == memoryPoolNameEnum::OLD) {
                   ^

be/src/util/jvm_metrics.cpp:455: +4, including nesting penalty of 3, nesting level increased to 4

                jvm_metrics->jvm_old_size_bytes_used->set_value(used < 0 ? 0 : used);
                                                                         ^

be/src/util/jvm_metrics.cpp:456: +4, including nesting penalty of 3, nesting level increased to 4

                jvm_metrics->jvm_old_size_bytes_peak_used->set_value(peakUsed < 0 ? 0 : peakUsed);
                                                                                  ^

be/src/util/jvm_metrics.cpp:457: +4, including nesting penalty of 3, nesting level increased to 4

                jvm_metrics->jvm_old_size_bytes_max->set_value(max < 0 ? 0 : max);
                                                                       ^

be/src/util/jvm_metrics.cpp:464: nesting level increased to 1

    JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF(
    ^

be/src/util/jni-util.h:49: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF'

    DEFER(env->DeleteLocalRef(result));                                     \
    ^

be/src/util/defer_op.h:45: expanded from macro 'DEFER'

#define DEFER(...) DEFER_FWD(__LINE__, __VA_ARGS__)
                   ^

be/src/util/defer_op.h:44: expanded from macro 'DEFER_FWD'

#define DEFER_FWD(n, ...) DEFER_CONCAT(n, __VA_ARGS__)
                          ^

be/src/util/defer_op.h:43: expanded from macro 'DEFER_CONCAT'

#define DEFER_CONCAT(n, ...) const auto defer##n = doris::Defer([&]() { __VA_ARGS__; })
                                                                ^

be/src/util/jvm_metrics.cpp:464: +1, including nesting penalty of 0, nesting level increased to 1

    JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF(
    ^

be/src/util/jni-util.h:50: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:42: expanded from macro 'RETURN_ERROR_IF_EXC'

    do {                                             \
    ^

be/src/util/jvm_metrics.cpp:464: +2, including nesting penalty of 1, nesting level increased to 2

    JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF(
    ^

be/src/util/jni-util.h:50: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:43: expanded from macro 'RETURN_ERROR_IF_EXC'

        if (env->ExceptionCheck()) [[unlikely]]      \
        ^

be/src/util/jvm_metrics.cpp:468: nesting level increased to 1

    JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF(
    ^

be/src/util/jni-util.h:49: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF'

    DEFER(env->DeleteLocalRef(result));                                     \
    ^

be/src/util/defer_op.h:45: expanded from macro 'DEFER'

#define DEFER(...) DEFER_FWD(__LINE__, __VA_ARGS__)
                   ^

be/src/util/defer_op.h:44: expanded from macro 'DEFER_FWD'

#define DEFER_FWD(n, ...) DEFER_CONCAT(n, __VA_ARGS__)
                          ^

be/src/util/defer_op.h:43: expanded from macro 'DEFER_CONCAT'

#define DEFER_CONCAT(n, ...) const auto defer##n = doris::Defer([&]() { __VA_ARGS__; })
                                                                ^

be/src/util/jvm_metrics.cpp:468: +1, including nesting penalty of 0, nesting level increased to 1

    JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF(
    ^

be/src/util/jni-util.h:50: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:42: expanded from macro 'RETURN_ERROR_IF_EXC'

    do {                                             \
    ^

be/src/util/jvm_metrics.cpp:468: +2, including nesting penalty of 1, nesting level increased to 2

    JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF(
    ^

be/src/util/jni-util.h:50: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:43: expanded from macro 'RETURN_ERROR_IF_EXC'

        if (env->ExceptionCheck()) [[unlikely]]      \
        ^

be/src/util/jvm_metrics.cpp:473: +1, including nesting penalty of 0, nesting level increased to 1

    JNI_CALL_METHOD_CHECK_EXCEPTION(jint, threadCount, env, GetArrayLength(threadIds));
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:42: expanded from macro 'RETURN_ERROR_IF_EXC'

    do {                                             \
    ^

be/src/util/jvm_metrics.cpp:473: +2, including nesting penalty of 1, nesting level increased to 2

    JNI_CALL_METHOD_CHECK_EXCEPTION(jint, threadCount, env, GetArrayLength(threadIds));
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:43: expanded from macro 'RETURN_ERROR_IF_EXC'

        if (env->ExceptionCheck()) [[unlikely]]      \
        ^

be/src/util/jvm_metrics.cpp:475: nesting level increased to 1

    JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF(
    ^

be/src/util/jni-util.h:49: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF'

    DEFER(env->DeleteLocalRef(result));                                     \
    ^

be/src/util/defer_op.h:45: expanded from macro 'DEFER'

#define DEFER(...) DEFER_FWD(__LINE__, __VA_ARGS__)
                   ^

be/src/util/defer_op.h:44: expanded from macro 'DEFER_FWD'

#define DEFER_FWD(n, ...) DEFER_CONCAT(n, __VA_ARGS__)
                          ^

be/src/util/defer_op.h:43: expanded from macro 'DEFER_CONCAT'

#define DEFER_CONCAT(n, ...) const auto defer##n = doris::Defer([&]() { __VA_ARGS__; })
                                                                ^

be/src/util/jvm_metrics.cpp:475: +1, including nesting penalty of 0, nesting level increased to 1

    JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF(
    ^

be/src/util/jni-util.h:50: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:42: expanded from macro 'RETURN_ERROR_IF_EXC'

    do {                                             \
    ^

be/src/util/jvm_metrics.cpp:475: +2, including nesting penalty of 1, nesting level increased to 2

    JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF(
    ^

be/src/util/jni-util.h:50: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:43: expanded from macro 'RETURN_ERROR_IF_EXC'

        if (env->ExceptionCheck()) [[unlikely]]      \
        ^

be/src/util/jvm_metrics.cpp:482: +1, including nesting penalty of 0, nesting level increased to 1

    JNI_CALL_METHOD_CHECK_EXCEPTION(jint, peakThreadCount, env,
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:42: expanded from macro 'RETURN_ERROR_IF_EXC'

    do {                                             \
    ^

be/src/util/jvm_metrics.cpp:482: +2, including nesting penalty of 1, nesting level increased to 2

    JNI_CALL_METHOD_CHECK_EXCEPTION(jint, peakThreadCount, env,
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:43: expanded from macro 'RETURN_ERROR_IF_EXC'

        if (env->ExceptionCheck()) [[unlikely]]      \
        ^

be/src/util/jvm_metrics.cpp:485: +1, including nesting penalty of 0, nesting level increased to 1

    jvm_metrics->jvm_thread_peak_count->set_value(peakThreadCount < 0 ? 0 : peakThreadCount);
                                                                      ^

be/src/util/jvm_metrics.cpp:486: +1, including nesting penalty of 0, nesting level increased to 1

    jvm_metrics->jvm_thread_count->set_value(threadCount < 0 ? 0 : threadCount);
                                                             ^

be/src/util/jvm_metrics.cpp:488: +1, including nesting penalty of 0, nesting level increased to 1

    for (int i = 0; i < threadCount; i++) {
    ^

be/src/util/jvm_metrics.cpp:489: +2, including nesting penalty of 1, nesting level increased to 2

        JNI_CALL_METHOD_CHECK_EXCEPTION(jobject, threadInfo, env,
        ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:42: expanded from macro 'RETURN_ERROR_IF_EXC'

    do {                                             \
    ^

be/src/util/jvm_metrics.cpp:489: +3, including nesting penalty of 2, nesting level increased to 3

        JNI_CALL_METHOD_CHECK_EXCEPTION(jobject, threadInfo, env,
        ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:43: expanded from macro 'RETURN_ERROR_IF_EXC'

        if (env->ExceptionCheck()) [[unlikely]]      \
        ^

be/src/util/jvm_metrics.cpp:492: +2, including nesting penalty of 1, nesting level increased to 2

        if (threadInfo == nullptr) {
        ^

be/src/util/jvm_metrics.cpp:496: nesting level increased to 2

        JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF(
        ^

be/src/util/jni-util.h:49: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF'

    DEFER(env->DeleteLocalRef(result));                                     \
    ^

be/src/util/defer_op.h:45: expanded from macro 'DEFER'

#define DEFER(...) DEFER_FWD(__LINE__, __VA_ARGS__)
                   ^

be/src/util/defer_op.h:44: expanded from macro 'DEFER_FWD'

#define DEFER_FWD(n, ...) DEFER_CONCAT(n, __VA_ARGS__)
                          ^

be/src/util/defer_op.h:43: expanded from macro 'DEFER_CONCAT'

#define DEFER_CONCAT(n, ...) const auto defer##n = doris::Defer([&]() { __VA_ARGS__; })
                                                                ^

be/src/util/jvm_metrics.cpp:496: +2, including nesting penalty of 1, nesting level increased to 2

        JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF(
        ^

be/src/util/jni-util.h:50: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:42: expanded from macro 'RETURN_ERROR_IF_EXC'

    do {                                             \
    ^

be/src/util/jvm_metrics.cpp:496: +3, including nesting penalty of 2, nesting level increased to 3

        JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF(
        ^

be/src/util/jni-util.h:50: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:43: expanded from macro 'RETURN_ERROR_IF_EXC'

        if (env->ExceptionCheck()) [[unlikely]]      \
        ^

be/src/util/jvm_metrics.cpp:500: +2, including nesting penalty of 1, nesting level increased to 2

        if (env->IsSameObject(threadState, _newThreadStateObj)) {
        ^

be/src/util/jvm_metrics.cpp:502: +1, nesting level increased to 2

        } else if (env->IsSameObject(threadState, _runnableThreadStateObj)) {
               ^

be/src/util/jvm_metrics.cpp:504: +1, nesting level increased to 2

        } else if (env->IsSameObject(threadState, _blockedThreadStateObj)) {
               ^

be/src/util/jvm_metrics.cpp:506: +1, nesting level increased to 2

        } else if (env->IsSameObject(threadState, _waitingThreadStateObj)) {
               ^

be/src/util/jvm_metrics.cpp:508: +1, nesting level increased to 2

        } else if (env->IsSameObject(threadState, _timedWaitingThreadStateObj)) {
               ^

be/src/util/jvm_metrics.cpp:510: +1, nesting level increased to 2

        } else if (env->IsSameObject(threadState, _terminatedThreadStateObj)) {
               ^

be/src/util/jvm_metrics.cpp:515: +1, including nesting penalty of 0, nesting level increased to 1

    jvm_metrics->jvm_thread_new_count->set_value(threadsNew < 0 ? 0 : threadsNew);
                                                                ^

be/src/util/jvm_metrics.cpp:516: +1, including nesting penalty of 0, nesting level increased to 1

    jvm_metrics->jvm_thread_runnable_count->set_value(threadsRunnable < 0 ? 0 : threadsRunnable);
                                                                          ^

be/src/util/jvm_metrics.cpp:517: +1, including nesting penalty of 0, nesting level increased to 1

    jvm_metrics->jvm_thread_blocked_count->set_value(threadsBlocked < 0 ? 0 : threadsBlocked);
                                                                        ^

be/src/util/jvm_metrics.cpp:518: +1, including nesting penalty of 0, nesting level increased to 1

    jvm_metrics->jvm_thread_waiting_count->set_value(threadsWaiting < 0 ? 0 : threadsWaiting);
                                                                        ^

be/src/util/jvm_metrics.cpp:520: +1, including nesting penalty of 0, nesting level increased to 1

            threadsTimedWaiting < 0 ? 0 : threadsTimedWaiting);
                                    ^

be/src/util/jvm_metrics.cpp:521: +1, including nesting penalty of 0, nesting level increased to 1

    jvm_metrics->jvm_thread_terminated_count->set_value(threadsTerminated < 0 ? 0
                                                                              ^

be/src/util/jvm_metrics.cpp:524: nesting level increased to 1

    JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF(
    ^

be/src/util/jni-util.h:49: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF'

    DEFER(env->DeleteLocalRef(result));                                     \
    ^

be/src/util/defer_op.h:45: expanded from macro 'DEFER'

#define DEFER(...) DEFER_FWD(__LINE__, __VA_ARGS__)
                   ^

be/src/util/defer_op.h:44: expanded from macro 'DEFER_FWD'

#define DEFER_FWD(n, ...) DEFER_CONCAT(n, __VA_ARGS__)
                          ^

be/src/util/defer_op.h:43: expanded from macro 'DEFER_CONCAT'

#define DEFER_CONCAT(n, ...) const auto defer##n = doris::Defer([&]() { __VA_ARGS__; })
                                                                ^

be/src/util/jvm_metrics.cpp:524: +1, including nesting penalty of 0, nesting level increased to 1

    JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF(
    ^

be/src/util/jni-util.h:50: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:42: expanded from macro 'RETURN_ERROR_IF_EXC'

    do {                                             \
    ^

be/src/util/jvm_metrics.cpp:524: +2, including nesting penalty of 1, nesting level increased to 2

    JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF(
    ^

be/src/util/jni-util.h:50: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:43: expanded from macro 'RETURN_ERROR_IF_EXC'

        if (env->ExceptionCheck()) [[unlikely]]      \
        ^

be/src/util/jvm_metrics.cpp:528: +1, including nesting penalty of 0, nesting level increased to 1

    JNI_CALL_METHOD_CHECK_EXCEPTION(jint, numCollectors, env,
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:42: expanded from macro 'RETURN_ERROR_IF_EXC'

    do {                                             \
    ^

be/src/util/jvm_metrics.cpp:528: +2, including nesting penalty of 1, nesting level increased to 2

    JNI_CALL_METHOD_CHECK_EXCEPTION(jint, numCollectors, env,
    ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:43: expanded from macro 'RETURN_ERROR_IF_EXC'

        if (env->ExceptionCheck()) [[unlikely]]      \
        ^

be/src/util/jvm_metrics.cpp:531: +1, including nesting penalty of 0, nesting level increased to 1

    for (int i = 0; i < numCollectors; i++) {
    ^

be/src/util/jvm_metrics.cpp:532: nesting level increased to 2

        JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF(
        ^

be/src/util/jni-util.h:49: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF'

    DEFER(env->DeleteLocalRef(result));                                     \
    ^

be/src/util/defer_op.h:45: expanded from macro 'DEFER'

#define DEFER(...) DEFER_FWD(__LINE__, __VA_ARGS__)
                   ^

be/src/util/defer_op.h:44: expanded from macro 'DEFER_FWD'

#define DEFER_FWD(n, ...) DEFER_CONCAT(n, __VA_ARGS__)
                          ^

be/src/util/defer_op.h:43: expanded from macro 'DEFER_CONCAT'

#define DEFER_CONCAT(n, ...) const auto defer##n = doris::Defer([&]() { __VA_ARGS__; })
                                                                ^

be/src/util/jvm_metrics.cpp:532: +2, including nesting penalty of 1, nesting level increased to 2

        JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF(
        ^

be/src/util/jni-util.h:50: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:42: expanded from macro 'RETURN_ERROR_IF_EXC'

    do {                                             \
    ^

be/src/util/jvm_metrics.cpp:532: +3, including nesting penalty of 2, nesting level increased to 3

        JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF(
        ^

be/src/util/jni-util.h:50: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:43: expanded from macro 'RETURN_ERROR_IF_EXC'

        if (env->ExceptionCheck()) [[unlikely]]      \
        ^

be/src/util/jvm_metrics.cpp:535: nesting level increased to 2

        JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF(jobject, gcName, env,
        ^

be/src/util/jni-util.h:49: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF'

    DEFER(env->DeleteLocalRef(result));                                     \
    ^

be/src/util/defer_op.h:45: expanded from macro 'DEFER'

#define DEFER(...) DEFER_FWD(__LINE__, __VA_ARGS__)
                   ^

be/src/util/defer_op.h:44: expanded from macro 'DEFER_FWD'

#define DEFER_FWD(n, ...) DEFER_CONCAT(n, __VA_ARGS__)
                          ^

be/src/util/defer_op.h:43: expanded from macro 'DEFER_CONCAT'

#define DEFER_CONCAT(n, ...) const auto defer##n = doris::Defer([&]() { __VA_ARGS__; })
                                                                ^

be/src/util/jvm_metrics.cpp:535: +2, including nesting penalty of 1, nesting level increased to 2

        JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF(jobject, gcName, env,
        ^

be/src/util/jni-util.h:50: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:42: expanded from macro 'RETURN_ERROR_IF_EXC'

    do {                                             \
    ^

be/src/util/jvm_metrics.cpp:535: +3, including nesting penalty of 2, nesting level increased to 3

        JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF(jobject, gcName, env,
        ^

be/src/util/jni-util.h:50: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION_DELETE_REF'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:43: expanded from macro 'RETURN_ERROR_IF_EXC'

        if (env->ExceptionCheck()) [[unlikely]]      \
        ^

be/src/util/jvm_metrics.cpp:538: +2, including nesting penalty of 1, nesting level increased to 2

        JNI_CALL_METHOD_CHECK_EXCEPTION(jlong, gcCollectionCount, env,
        ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:42: expanded from macro 'RETURN_ERROR_IF_EXC'

    do {                                             \
    ^

be/src/util/jvm_metrics.cpp:538: +3, including nesting penalty of 2, nesting level increased to 3

        JNI_CALL_METHOD_CHECK_EXCEPTION(jlong, gcCollectionCount, env,
        ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:43: expanded from macro 'RETURN_ERROR_IF_EXC'

        if (env->ExceptionCheck()) [[unlikely]]      \
        ^

be/src/util/jvm_metrics.cpp:541: +2, including nesting penalty of 1, nesting level increased to 2

        JNI_CALL_METHOD_CHECK_EXCEPTION(jlong, gcCollectionTime, env,
        ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:42: expanded from macro 'RETURN_ERROR_IF_EXC'

    do {                                             \
    ^

be/src/util/jvm_metrics.cpp:541: +3, including nesting penalty of 2, nesting level increased to 3

        JNI_CALL_METHOD_CHECK_EXCEPTION(jlong, gcCollectionTime, env,
        ^

be/src/util/jni-util.h:54: expanded from macro 'JNI_CALL_METHOD_CHECK_EXCEPTION'

    RETURN_ERROR_IF_EXC(env)
    ^

be/src/util/jni-util.h:43: expanded from macro 'RETURN_ERROR_IF_EXC'

        if (env->ExceptionCheck()) [[unlikely]]      \
        ^

be/src/util/jvm_metrics.cpp:545: +2, including nesting penalty of 1, nesting level increased to 2

        if (gcNameStr != nullptr) {
        ^

be/src/util/jvm_metrics.cpp:546: +3, including nesting penalty of 2, nesting level increased to 3

            if (strcmp(gcNameStr, "G1 Young Generation") == 0) {
            ^

be/src/util/jvm_metrics.cpp:550: +1, nesting level increased to 3

            } else {
              ^

}

void JvmStats::refresh(JvmMetrics* jvm_metrics) {
Status JvmStats::refresh(JvmMetrics* jvm_metrics) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: function 'refresh' exceeds recommended size/complexity thresholds [readability-function-size]

Status JvmStats::refresh(JvmMetrics* jvm_metrics) {
                 ^
Additional context

be/src/util/jvm_metrics.cpp:361: 199 lines including whitespace and comments (threshold 80)

Status JvmStats::refresh(JvmMetrics* jvm_metrics) {
                 ^

}

void JvmStats::refresh(JvmMetrics* jvm_metrics) {
Status JvmStats::refresh(JvmMetrics* jvm_metrics) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: method 'refresh' can be made const [readability-make-member-function-const]

be/src/util/jvm_metrics.h:100:

-     Status refresh(JvmMetrics* jvm_metrics);
+     Status refresh(JvmMetrics* jvm_metrics) const;
Suggested change
Status JvmStats::refresh(JvmMetrics* jvm_metrics) {
Status JvmStats::refresh(JvmMetrics* jvm_metrics) const {

@doris-robot
Copy link

TPC-H: Total hot run time: 41624 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 7179aefcbfd75a03594b704aa4d6c03150f3f321, data reload: false

------ Round 1 ----------------------------------
q1	17587	7472	7270	7270
q2	2031	286	282	282
q3	11934	1125	1155	1125
q4	10578	873	874	873
q5	7741	3196	3100	3100
q6	231	146	140	140
q7	1042	629	596	596
q8	9357	1952	1984	1952
q9	6621	6450	6467	6450
q10	7080	2423	2440	2423
q11	441	244	246	244
q12	401	218	205	205
q13	17770	3006	3005	3005
q14	251	213	208	208
q15	566	526	518	518
q16	647	604	586	586
q17	988	587	573	573
q18	7399	6863	6824	6824
q19	1333	979	961	961
q20	479	173	175	173
q21	3997	3292	3130	3130
q22	1099	986	1013	986
Total cold run time: 109573 ms
Total hot run time: 41624 ms

----- Round 2, with runtime_filter_mode=off -----
q1	7257	7200	7271	7200
q2	328	232	226	226
q3	3065	3012	2994	2994
q4	2109	1897	1819	1819
q5	5810	5796	5851	5796
q6	225	137	139	137
q7	2235	1819	1769	1769
q8	3404	3540	3470	3470
q9	8977	8953	8985	8953
q10	3581	3566	3596	3566
q11	577	488	497	488
q12	857	645	613	613
q13	9291	3189	3220	3189
q14	333	277	287	277
q15	576	528	526	526
q16	696	641	638	638
q17	1853	1638	1611	1611
q18	8394	7961	7628	7628
q19	1731	1657	1732	1657
q20	2084	1850	1904	1850
q21	5588	5662	5649	5649
q22	1133	1090	1051	1051
Total cold run time: 70104 ms
Total hot run time: 61107 ms

@doris-robot
Copy link

TeamCity be ut coverage result:
Function Coverage: 37.46% (9714/25934)
Line Coverage: 28.73% (80581/280507)
Region Coverage: 28.04% (41652/148564)
Branch Coverage: 24.67% (21167/85784)
Coverage Report: http://coverage.selectdb-in.cc/coverage/7179aefcbfd75a03594b704aa4d6c03150f3f321_7179aefcbfd75a03594b704aa4d6c03150f3f321/report/index.html

@doris-robot
Copy link

TPC-DS: Total hot run time: 191880 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit 7179aefcbfd75a03594b704aa4d6c03150f3f321, data reload: false

query1	812	401	402	401
query2	6264	2183	2121	2121
query3	8686	192	206	192
query4	34526	23714	23512	23512
query5	4795	468	448	448
query6	287	180	183	180
query7	4196	293	293	293
query8	296	245	241	241
query9	9541	2724	2725	2724
query10	486	248	249	248
query11	18226	15240	15188	15188
query12	153	104	100	100
query13	1571	428	409	409
query14	9212	6482	7221	6482
query15	246	175	186	175
query16	8008	451	518	451
query17	1474	586	589	586
query18	2143	306	307	306
query19	293	153	151	151
query20	120	114	115	114
query21	215	106	112	106
query22	4936	4763	4838	4763
query23	34967	34106	33945	33945
query24	11036	2774	2728	2728
query25	589	412	399	399
query26	782	158	169	158
query27	2114	285	299	285
query28	6727	2425	2452	2425
query29	778	419	434	419
query30	262	160	167	160
query31	1117	815	819	815
query32	105	56	57	56
query33	786	273	265	265
query34	994	521	510	510
query35	1008	875	886	875
query36	1132	943	1001	943
query37	121	76	74	74
query38	4356	4198	4308	4198
query39	1498	1433	1416	1416
query40	198	97	98	97
query41	47	46	45	45
query42	113	103	99	99
query43	553	513	507	507
query44	1312	815	810	810
query45	185	168	165	165
query46	1140	698	687	687
query47	1937	1861	1890	1861
query48	436	314	323	314
query49	900	400	414	400
query50	808	389	390	389
query51	7144	6995	7065	6995
query52	97	89	96	89
query53	249	185	176	176
query54	1118	410	400	400
query55	75	75	75	75
query56	248	231	248	231
query57	1321	1181	1191	1181
query58	219	198	202	198
query59	3227	3187	3208	3187
query60	264	237	251	237
query61	104	100	100	100
query62	856	665	660	660
query63	223	189	180	180
query64	4094	641	654	641
query65	3331	3226	3229	3226
query66	809	303	315	303
query67	16104	15735	15996	15735
query68	4416	581	556	556
query69	419	256	252	252
query70	1252	1144	1169	1144
query71	321	265	254	254
query72	6247	3731	3964	3731
query73	761	360	375	360
query74	10172	9085	9011	9011
query75	3430	2698	2657	2657
query76	2507	988	1079	988
query77	379	274	295	274
query78	10489	9579	9547	9547
query79	1613	593	610	593
query80	884	431	437	431
query81	567	239	243	239
query82	586	114	114	114
query83	235	137	140	137
query84	237	70	72	70
query85	1173	307	285	285
query86	366	304	283	283
query87	4833	4743	4760	4743
query88	3223	2217	2169	2169
query89	394	294	291	291
query90	1952	184	186	184
query91	136	101	102	101
query92	56	49	46	46
query93	1468	531	540	531
query94	882	303	297	297
query95	359	253	246	246
query96	612	286	291	286
query97	2955	2741	2724	2724
query98	211	197	194	194
query99	1689	1292	1319	1292
Total cold run time: 296794 ms
Total hot run time: 191880 ms

@doris-robot
Copy link

ClickBench: Total hot run time: 32.92 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 7179aefcbfd75a03594b704aa4d6c03150f3f321, data reload: false

query1	0.03	0.03	0.03
query2	0.07	0.03	0.03
query3	0.24	0.06	0.06
query4	1.64	0.10	0.10
query5	0.41	0.40	0.40
query6	1.15	0.65	0.65
query7	0.02	0.01	0.01
query8	0.04	0.03	0.03
query9	0.55	0.51	0.53
query10	0.55	0.55	0.55
query11	0.15	0.10	0.11
query12	0.14	0.11	0.12
query13	0.61	0.60	0.59
query14	2.84	2.71	2.75
query15	0.89	0.83	0.85
query16	0.39	0.37	0.38
query17	1.06	1.02	1.05
query18	0.20	0.20	0.20
query19	1.96	1.88	2.00
query20	0.02	0.01	0.01
query21	15.37	0.60	0.59
query22	3.24	1.66	2.04
query23	17.22	0.84	0.85
query24	3.33	1.33	1.76
query25	0.18	0.19	0.04
query26	0.63	0.14	0.13
query27	0.03	0.04	0.04
query28	9.57	1.11	1.08
query29	12.60	3.31	3.35
query30	0.24	0.06	0.06
query31	2.87	0.38	0.38
query32	3.27	0.47	0.46
query33	2.98	3.05	3.05
query34	17.22	4.50	4.55
query35	4.53	4.48	4.64
query36	0.67	0.48	0.49
query37	0.09	0.06	0.06
query38	0.04	0.03	0.04
query39	0.03	0.02	0.03
query40	0.16	0.13	0.12
query41	0.08	0.02	0.03
query42	0.03	0.02	0.02
query43	0.04	0.03	0.03
Total cold run time: 107.38 s
Total hot run time: 32.92 s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants