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

feat(measurements): collect heap usage #187

Merged
merged 12 commits into from Aug 29, 2023
Merged

feat(measurements): collect heap usage #187

merged 12 commits into from Aug 29, 2023

Conversation

JonasBa
Copy link
Member

@JonasBa JonasBa commented Aug 15, 2023

Collect heap memory usage at 10hz / every 100ms.

Initializes a single ticking timer which delegates collecting of memory usage stats to each profile.

@JonasBa JonasBa requested a review from indragiek August 15, 2023 14:44
playground/express/index.js Outdated Show resolved Hide resolved
@JonasBa JonasBa changed the title feat(profiling): collect heap usage feat(measurements): collect heap usage Aug 15, 2023
Copy link
Member

@indragiek indragiek left a comment

Choose a reason for hiding this comment

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

reviewed C++ only

bindings/cpu_profiler.cc Outdated Show resolved Hide resolved
bindings/cpu_profiler.cc Outdated Show resolved Hide resolved
bindings/cpu_profiler.cc Outdated Show resolved Hide resolved
bindings/cpu_profiler.cc Outdated Show resolved Hide resolved
bindings/cpu_profiler.cc Outdated Show resolved Hide resolved
bindings/cpu_profiler.cc Show resolved Hide resolved
bindings/cpu_profiler.cc Outdated Show resolved Hide resolved
bindings/cpu_profiler.cc Outdated Show resolved Hide resolved
bindings/cpu_profiler.cc Outdated Show resolved Hide resolved
bindings/cpu_profiler.cc Outdated Show resolved Hide resolved
bindings/cpu_profiler.cc Outdated Show resolved Hide resolved
bindings/cpu_profiler.cc Outdated Show resolved Hide resolved
bindings/cpu_profiler.cc Outdated Show resolved Hide resolved
bindings/cpu_profiler.cc Outdated Show resolved Hide resolved
JonasBa and others added 2 commits August 18, 2023 14:38
* ref(heapticker): generalize the ticker

* feat(metrics): collect cpu usage

* ref(review): remove statics

* ref(review): remove statics

* ref(cleanup): rename param

* ref(cleanup): free

* test: handle segfault

* test str

* test str

* test str

* test str

* test removing listeners

* explicit init

* explicit init

* test(measurements): add tests

* fix(ticker): adjust count

* fix(ticker): remove segfault handler

* fix(ticker): remove segfault handler

* fix(cpp): remove compiler warning

* fix(cpp): add remove safety so we dont overflow max measurements
@JonasBa JonasBa merged commit 1c2c350 into main Aug 29, 2023
13 checks passed
@JonasBa JonasBa deleted the jb/feat/memory-usage branch August 29, 2023 17:05
// If for some reason stopProfiling was called with an invalid profile title or
// if that title had somehow been stopped already, profile will be null.
if (!profile) {
if (!cpu_profile) {
napi_throw_error(env, "NAPI_ERROR", "StopProfiling: Stopping Sentry profile did not return a profile.");
Copy link
Member Author

Choose a reason for hiding this comment

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

Removing this

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.

None yet

2 participants