-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use high-resolution host language timer (#641)
* Add hrTime function In order to set times from the host language, instead of relying on the agent's internal timing, this patch adds a hrTime (high-resolution time) function based on the one shipped by OpenTelemetry, and functioning through Node's built-in perf_hooks module. * Set times from span creation functions Use the newly added hrTime function to set the time when starting and completing spans, if no custom time has been passed. * Add changeset to explain timer change Adding the new timer is marked as a patch release. * Update packages/nodejs/.changesets/use-high-resolution-host-language-timer.md Co-authored-by: Tom de Bruijn <[email protected]> * Update packages/nodejs/src/__tests__/span.test.ts Co-authored-by: Tom de Bruijn <[email protected]> * Update packages/nodejs/src/utils.ts Co-authored-by: Tom de Bruijn <[email protected]> * Update packages/nodejs/src/__tests__/utils.test.ts Co-authored-by: Tom de Bruijn <[email protected]> * Remove span.closeSpan from the extension Since all spans are closed with explicit timestamps (using span.closeSpanWithTimestamp), span.closeSpan is no longer used, and can be removed from the extension. Co-authored-by: Tom de Bruijn <[email protected]>
- Loading branch information
1 parent
e7ca9d1
commit fc9f2fd
Showing
6 changed files
with
67 additions
and
18 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
packages/nodejs/.changesets/use-high-resolution-host-language-timer.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
bump: "patch" | ||
type: "change" | ||
--- | ||
|
||
Use the Node.js performance module as high-resolution timer for span creation and close times. This provides more accurate times and improves compatibility with other systems in the future. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters