-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#229] Refactoring Trace, AsyncTrace, DisableTrace and AsyncDisableTr…
…ace With TraceRoot * continueTrace parent Information header parsing
- Loading branch information
Showing
33 changed files
with
734 additions
and
179 deletions.
There are no files selected for viewing
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
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 was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/** | ||
* Pinpoint Node.js Agent | ||
* Copyright 2020-present NAVER Corp. | ||
* Apache License v2.0 | ||
*/ | ||
|
||
'use strict' | ||
|
||
class SpanEvent { | ||
constructor(sequence) { | ||
this.sequence = sequence | ||
} | ||
} | ||
|
||
class SpanEventBuilder { | ||
// DefaultCallStack.java: push sequence 0 start value, depth 1 start value | ||
static nullObject = new SpanEventBuilder(-1, 0) | ||
|
||
constructor(sequence, depth) { | ||
this.sequence = sequence | ||
this.depth = depth | ||
this.annotations = [] | ||
this.startTime = Date.now() | ||
} | ||
|
||
markElapsedTime() { | ||
this.elapsedTime = Date.now() - this.startTime | ||
return this | ||
} | ||
|
||
addAnnotation(annotation) { | ||
this.annotations.push(annotation) | ||
return this | ||
} | ||
|
||
setApiId(apiId) { | ||
this.apiId = apiId | ||
return this | ||
} | ||
|
||
setNextAsyncId(asyncId) { | ||
this.asyncId = asyncId | ||
return this | ||
} | ||
|
||
makeSequenceAndDepthGrowth() { | ||
return new SpanEventBuilder(this.sequence + 1, this.depth + 1) | ||
} | ||
|
||
build() { | ||
const spanEvent = new SpanEvent(this.sequence) | ||
spanEvent.apiId = this.apiId | ||
spanEvent.depth = this.depth | ||
spanEvent.annotations = this.annotations | ||
spanEvent.startTime = this.startTime | ||
spanEvent.elapsedTime = this.elapsedTime | ||
return spanEvent | ||
} | ||
} | ||
|
||
module.exports = SpanEventBuilder |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.