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

[Bug] (metrics) doris_be_process_thread_num is always 0 #36091

Closed
3 tasks done
kylinmac opened this issue Jun 11, 2024 · 0 comments
Closed
3 tasks done

[Bug] (metrics) doris_be_process_thread_num is always 0 #36091

kylinmac opened this issue Jun 11, 2024 · 0 comments

Comments

@kylinmac
Copy link
Contributor

Search before asking

  • I had searched in the issues and found no similar issues.

Version

2.0.9

What's Wrong?

doris_be_process_thread_num is always 0 , maybe is_regular_file should be replaced by is_directory

void DorisMetrics::_update_process_thread_num() {
    std::error_code ec;
    std::filesystem::directory_iterator dict_iter("/proc/self/task/", ec);
    if (ec) {
        LOG(WARNING) << "failed to count thread num: " << ec.message();
        process_fd_num_used->set_value(0);
        return;
    }
    int64_t count =
            std::count_if(dict_iter, std::filesystem::end(dict_iter), [](const auto& entry) {
                std::error_code error_code;
                return entry.is_regular_file(error_code) && !error_code;
            });

    process_thread_num->set_value(count);
}`

What You Expected?

get right doris_be_process_thread_num

How to Reproduce?

No response

Anything Else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

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 a pull request may close this issue.

1 participant