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

cpu metrics: introduce metrics to gather cpu usage #218

Merged
merged 1 commit into from
Apr 5, 2021

Conversation

zwirec
Copy link
Contributor

@zwirec zwirec commented Apr 1, 2021

This PR adds two new default metrics:

cpu_user_time - total cpu user time consumption
cpu_system_time - total cpu system time consumption

These metrics are slightly similar to those added in #69 but the getrusage() function call via ffi is used to get data.
There aren't cpu usage per tarantool threads as in #69 but only for the whole tarantool instance.

It is proposed to add these metrics to the default so that in all the services that we ship we can understand why tarantool broke.

I didn't forget about

  • Tests
  • Changelog
  • Documentation (README and rst)
  • Rockspec and rpm spec

Close #41

Copy link
Contributor

@Kasen Kasen left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@Kasen Kasen left a comment

Choose a reason for hiding this comment

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

error: Installed (but unpackaged) file(s) found:
371
/usr/share/tarantool/metrics/default_metrics/tarantool/cpu.lua

RPM build has been broken

Copy link
Contributor

@Kasen Kasen left a comment

Choose a reason for hiding this comment

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

LGTM


local function ss_get_rusage()
if ffi.C.getrusage(RUSAGE_SELF, shared_rusage) < 0 then
return -1
Copy link
Contributor

Choose a reason for hiding this comment

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

different return contract

@filonenko-mikhail
Copy link
Contributor

lgtm

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

Successfully merging this pull request may close these issues.

Add support for getrusage()
4 participants