Skip to content

Commit be1b816

Browse files
authored
fix(profiling): continuous profile chunks should be in seconds (#12532)
Timestamps reported in the chunk format need to be in seconds
1 parent 307a3db commit be1b816

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/profiling-node/bindings/cpu_profiler.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,7 @@ static napi_value TranslateMeasurementsDouble(
759759
} else if (format == ProfileFormat::kFormatChunk) {
760760
napi_value ts;
761761
napi_create_double(
762-
env, profile_start_timestamp_ms + (timestamps_ns[i] * 1e-6), &ts);
762+
env, profile_start_timestamp_ms + (timestamps_ns[i] * 1e-9), &ts);
763763
napi_set_named_property(env, entry, "timestamp", ts);
764764
}
765765

@@ -818,7 +818,7 @@ TranslateMeasurements(const napi_env &env, const enum ProfileFormat format,
818818
case ProfileFormat::kFormatChunk: {
819819
napi_value ts;
820820
napi_create_double(
821-
env, profile_start_timestamp_ms + (timestamps_ns[i] * 1e-6), &ts);
821+
env, profile_start_timestamp_ms + (timestamps_ns[i] * 1e-9), &ts);
822822
napi_set_named_property(env, entry, "timestamp", ts);
823823
} break;
824824
default:

0 commit comments

Comments
 (0)