forked from eclipse-cdt-cloud/theia-trace-extension
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Properly deserialize Experiment in signals to create BigInt timestamps
Contributes to fixing eclipse-cdt-cloud#35 Signed-off-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
- Loading branch information
Showing
7 changed files
with
93 additions
and
19 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { Experiment } from 'tsp-typescript-client/lib/models/experiment'; | ||
import { Trace } from 'tsp-typescript-client/lib/models/trace'; | ||
|
||
export function convertSignalExperiment(signalExperiment: Experiment): Experiment { | ||
const experiment: Experiment = { | ||
name: signalExperiment.name, | ||
UUID: signalExperiment.UUID, | ||
indexingStatus: signalExperiment.indexingStatus, | ||
end: BigInt(signalExperiment.end), | ||
start: BigInt(signalExperiment.start), | ||
nbEvents: signalExperiment.nbEvents, | ||
traces: convertSignalTraces(signalExperiment) | ||
}; | ||
return experiment; | ||
} | ||
|
||
export function convertSignalTraces(signalExperiment: Experiment): Trace[] { | ||
const traces: Trace[] = []; | ||
|
||
signalExperiment.traces.forEach(t => { | ||
const trace: Trace = { | ||
name: t.name, | ||
UUID: t.UUID, | ||
end: BigInt(t.end), | ||
start: BigInt(t.start), | ||
indexingStatus: t.indexingStatus, | ||
nbEvents: t.nbEvents, | ||
path: t.path | ||
}; | ||
traces.push(trace); | ||
}); | ||
return traces; | ||
} | ||
|
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
34 changes: 34 additions & 0 deletions
34
vscode-trace-webviews/src/common/vscode-signal-converter.ts
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,34 @@ | ||
import { Experiment } from 'tsp-typescript-client/lib/models/experiment'; | ||
import { Trace } from 'tsp-typescript-client/lib/models/trace'; | ||
|
||
export function convertSignalExperiment(signalExperiment: Experiment): Experiment { | ||
const experiment: Experiment = { | ||
name: signalExperiment.name, | ||
UUID: signalExperiment.UUID, | ||
indexingStatus: signalExperiment.indexingStatus, | ||
end: BigInt(signalExperiment.end), | ||
start: BigInt(signalExperiment.start), | ||
nbEvents: signalExperiment.nbEvents, | ||
traces: convertSignalTraces(signalExperiment) | ||
}; | ||
return experiment; | ||
} | ||
|
||
export function convertSignalTraces(signalExperiment: Experiment): Trace[] { | ||
const traces: Trace[] = []; | ||
|
||
signalExperiment.traces.forEach(t => { | ||
const trace: Trace = { | ||
name: t.name, | ||
UUID: t.UUID, | ||
end: BigInt(t.end), | ||
start: BigInt(t.start), | ||
indexingStatus: t.indexingStatus, | ||
nbEvents: t.nbEvents, | ||
path: t.path | ||
}; | ||
traces.push(trace); | ||
}); | ||
return traces; | ||
} | ||
|
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