-
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.
- Loading branch information
1 parent
0b8ebca
commit 26816a0
Showing
2 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
src/Famix-OpenTelemetry-Importer/OTelSTONFileExtractor.class.st
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,26 @@ | ||
Class { | ||
#name : #OTelSTONFileExtractor, | ||
#superclass : #OTelAbstractExtractor, | ||
#instVars : [ | ||
'filename' | ||
], | ||
#category : #'Famix-OpenTelemetry-Importer' | ||
} | ||
|
||
{ #category : #extraction } | ||
OTelSTONFileExtractor >> extract [ | ||
|
||
^ (STONReader on: filename asFileReference readStream) next | ||
] | ||
|
||
{ #category : #accessing } | ||
OTelSTONFileExtractor >> filename [ | ||
|
||
^ filename | ||
] | ||
|
||
{ #category : #accessing } | ||
OTelSTONFileExtractor >> filename: anObject [ | ||
|
||
filename := anObject | ||
] |
25 changes: 25 additions & 0 deletions
25
src/Famix-OpenTelemetry-Importer/OTelSTONFileLoader.class.st
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,25 @@ | ||
Class { | ||
#name : #OTelSTONFileLoader, | ||
#superclass : #OTelAbstractLoader, | ||
#category : #'Famix-OpenTelemetry-Importer' | ||
} | ||
|
||
{ #category : #loading } | ||
OTelSTONFileLoader >> load: rawTraces [ | ||
|
||
rawTraces do: [ :rawSpan | | ||
| span | | ||
span := self loadSpan: rawSpan ]. | ||
^ self model | ||
] | ||
|
||
{ #category : #'private - loading' } | ||
OTelSTONFileLoader >> loadSpan: anOTSpan [ | ||
|
||
^ self model newSpan | ||
id: anOTSpan spanId; | ||
name: anOTSpan name; | ||
tags: anOTSpan attributes; | ||
timestamp: anOTSpan startTime; | ||
duration: anOTSpan endTime - anOTSpan startTime | ||
] |