@sentry/profiling-node 8.6.0 → 8.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/bindings/cpu_profiler.cc +19 -13
  2. package/lib/sentry_cpu_profiler-darwin-arm64-108.node +0 -0
  3. package/lib/sentry_cpu_profiler-darwin-arm64-115.node +0 -0
  4. package/lib/sentry_cpu_profiler-darwin-arm64-127.node +0 -0
  5. package/lib/sentry_cpu_profiler-darwin-arm64-93.node +0 -0
  6. package/lib/sentry_cpu_profiler-darwin-x64-108.node +0 -0
  7. package/lib/sentry_cpu_profiler-darwin-x64-115.node +0 -0
  8. package/lib/sentry_cpu_profiler-darwin-x64-127.node +0 -0
  9. package/lib/sentry_cpu_profiler-darwin-x64-93.node +0 -0
  10. package/lib/sentry_cpu_profiler-linux-arm64-glibc-108.node +0 -0
  11. package/lib/sentry_cpu_profiler-linux-arm64-glibc-115.node +0 -0
  12. package/lib/sentry_cpu_profiler-linux-arm64-glibc-127.node +0 -0
  13. package/lib/sentry_cpu_profiler-linux-arm64-glibc-93.node +0 -0
  14. package/lib/sentry_cpu_profiler-linux-arm64-musl-108.node +0 -0
  15. package/lib/sentry_cpu_profiler-linux-arm64-musl-115.node +0 -0
  16. package/lib/sentry_cpu_profiler-linux-arm64-musl-127.node +0 -0
  17. package/lib/sentry_cpu_profiler-linux-arm64-musl-93.node +0 -0
  18. package/lib/sentry_cpu_profiler-linux-x64-glibc-108.node +0 -0
  19. package/lib/sentry_cpu_profiler-linux-x64-glibc-115.node +0 -0
  20. package/lib/sentry_cpu_profiler-linux-x64-glibc-127.node +0 -0
  21. package/lib/sentry_cpu_profiler-linux-x64-glibc-93.node +0 -0
  22. package/lib/sentry_cpu_profiler-linux-x64-musl-108.node +0 -0
  23. package/lib/sentry_cpu_profiler-linux-x64-musl-115.node +0 -0
  24. package/lib/sentry_cpu_profiler-linux-x64-musl-127.node +0 -0
  25. package/lib/sentry_cpu_profiler-linux-x64-musl-93.node +0 -0
  26. package/lib/sentry_cpu_profiler-win32-x64-108.node +0 -0
  27. package/lib/sentry_cpu_profiler-win32-x64-115.node +0 -0
  28. package/lib/sentry_cpu_profiler-win32-x64-127.node +0 -0
  29. package/lib/sentry_cpu_profiler-win32-x64-93.node +0 -0
  30. package/package.json +5 -5
@@ -76,7 +76,8 @@ public:
76
76
  MeasurementsTicker(uv_loop_t *loop)
77
77
  : period_ms(100), isolate(v8::Isolate::GetCurrent()) {
78
78
  uv_timer_init(loop, &timer);
79
- timer.data = this;
79
+ uv_handle_set_data(reinterpret_cast<uv_handle_t *>(&timer), this);
80
+ uv_unref(reinterpret_cast<uv_handle_t *>(&timer));
80
81
  }
81
82
 
82
83
  static void ticker(uv_timer_t *);
@@ -196,6 +197,10 @@ void MeasurementsTicker::cpu_callback() {
196
197
  };
197
198
 
198
199
  void MeasurementsTicker::ticker(uv_timer_t *handle) {
200
+ if (handle == nullptr) {
201
+ return;
202
+ }
203
+
199
204
  MeasurementsTicker *self = static_cast<MeasurementsTicker *>(handle->data);
200
205
  self->heap_callback();
201
206
  self->cpu_callback();
@@ -323,18 +328,6 @@ void SentryProfile::Start(Profiler *profiler) {
323
328
  status = ProfileStatus::kStarted;
324
329
  }
325
330
 
326
- static void CleanupSentryProfile(Profiler *profiler,
327
- SentryProfile *sentry_profile,
328
- const std::string &profile_id) {
329
- if (sentry_profile == nullptr) {
330
- return;
331
- }
332
-
333
- sentry_profile->Stop(profiler);
334
- profiler->active_profiles.erase(profile_id);
335
- delete sentry_profile;
336
- };
337
-
338
331
  v8::CpuProfile *SentryProfile::Stop(Profiler *profiler) {
339
332
  // Stop the CPU Profiler
340
333
  v8::CpuProfile *profile = profiler->cpu_profiler->StopProfiling(
@@ -376,6 +369,18 @@ const uint16_t &SentryProfile::cpu_usage_write_index() const {
376
369
  return cpu_write_index;
377
370
  };
378
371
 
372
+ static void CleanupSentryProfile(Profiler *profiler,
373
+ SentryProfile *sentry_profile,
374
+ const std::string &profile_id) {
375
+ if (sentry_profile == nullptr) {
376
+ return;
377
+ }
378
+
379
+ sentry_profile->Stop(profiler);
380
+ profiler->active_profiles.erase(profile_id);
381
+ delete sentry_profile;
382
+ };
383
+
379
384
  #ifdef _WIN32
380
385
  static const char kPlatformSeparator = '\\';
381
386
  static const char kWinDiskPrefix = ':';
@@ -1049,6 +1054,7 @@ void FreeAddonData(napi_env env, void *data, void *hint) {
1049
1054
 
1050
1055
  if (profiler->cpu_profiler != nullptr) {
1051
1056
  profiler->cpu_profiler->Dispose();
1057
+ profiler->cpu_profiler = nullptr;
1052
1058
  }
1053
1059
 
1054
1060
  delete profiler;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/profiling-node",
3
- "version": "8.6.0",
3
+ "version": "8.8.0",
4
4
  "description": "Official Sentry SDK for Node.js Profiling",
5
5
  "repository": "git://github.com/getsentry/sentry-javascript.git",
6
6
  "homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/profiling-node",
@@ -77,10 +77,10 @@
77
77
  "test": "cross-env SENTRY_PROFILER_BINARY_DIR=lib jest --config jest.config.js"
78
78
  },
79
79
  "dependencies": {
80
- "@sentry/core": "8.6.0",
81
- "@sentry/node": "8.6.0",
82
- "@sentry/types": "8.6.0",
83
- "@sentry/utils": "8.6.0",
80
+ "@sentry/core": "8.8.0",
81
+ "@sentry/node": "8.8.0",
82
+ "@sentry/types": "8.8.0",
83
+ "@sentry/utils": "8.8.0",
84
84
  "detect-libc": "^2.0.2",
85
85
  "node-abi": "^3.61.0"
86
86
  },