-
Notifications
You must be signed in to change notification settings - Fork 4
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
Showing
10 changed files
with
485 additions
and
259 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
package chunk | ||
|
||
import ( | ||
"encoding/json" | ||
"time" | ||
|
||
"github.com/getsentry/vroom/internal/clientsdk" | ||
"github.com/getsentry/vroom/internal/debugmeta" | ||
"github.com/getsentry/vroom/internal/nodetree" | ||
"github.com/getsentry/vroom/internal/platform" | ||
"github.com/getsentry/vroom/internal/profile" | ||
"github.com/getsentry/vroom/internal/utils" | ||
) | ||
|
||
type ( | ||
AndroidChunk struct { | ||
BuildID string `json:"build_id,omitempty"` | ||
ID string `json:"chunk_id"` | ||
ProfilerID string `json:"profiler_id"` | ||
|
||
DebugMeta debugmeta.DebugMeta `json:"debug_meta"` | ||
|
||
ClientSDK clientsdk.ClientSDK `json:"client_sdk"` | ||
DurationNS uint64 `json:"duration_ns"` | ||
Environment string `json:"environment"` | ||
Platform platform.Platform `json:"platform"` | ||
Release string `json:"release"` | ||
Timestamp float64 `json:"timestamp"` | ||
|
||
Profile profile.Android `json:"profile"` | ||
Measurements json.RawMessage `json:"measurements"` | ||
|
||
OrganizationID uint64 `json:"organization_id"` | ||
ProjectID uint64 `json:"project_id"` | ||
Received float64 `json:"received"` | ||
RetentionDays int `json:"retention_days"` | ||
|
||
Options utils.Options `json:"options,omitempty"` | ||
} | ||
) | ||
|
||
func (c AndroidChunk) StoragePath() string { | ||
return StoragePath( | ||
c.OrganizationID, | ||
c.ProjectID, | ||
c.ProfilerID, | ||
c.ID, | ||
) | ||
} | ||
|
||
func (c AndroidChunk) DurationMS() uint64 { | ||
return uint64(time.Duration(c.DurationNS).Milliseconds()) | ||
} | ||
|
||
func (c AndroidChunk) CallTrees() map[uint64][]*nodetree.Node { | ||
return c.Profile.CallTrees() | ||
} | ||
|
||
func (c AndroidChunk) SDKName() string { | ||
return c.ClientSDK.Name | ||
} | ||
|
||
func (c AndroidChunk) SDKVersion() string { | ||
return c.ClientSDK.Version | ||
} | ||
|
||
func (c AndroidChunk) EndTimestamp() float64 { | ||
return 0 | ||
} | ||
|
||
func (c AndroidChunk) GetEnvironment() string { | ||
return c.Environment | ||
} | ||
|
||
func (c AndroidChunk) GetID() string { | ||
return c.ID | ||
} | ||
|
||
func (c AndroidChunk) GetPlatform() platform.Platform { | ||
return c.Platform | ||
} | ||
|
||
func (c AndroidChunk) GetProfilerID() string { | ||
return c.ProfilerID | ||
} | ||
|
||
func (c AndroidChunk) GetProjectID() uint64 { | ||
return c.ProjectID | ||
} | ||
|
||
func (c AndroidChunk) GetReceived() float64 { | ||
return c.Received | ||
} | ||
|
||
func (c AndroidChunk) GetRelease() string { | ||
return c.Release | ||
} | ||
|
||
func (c AndroidChunk) GetRetentionDays() int { | ||
return c.RetentionDays | ||
} | ||
|
||
func (c AndroidChunk) StartTimestamp() float64 { | ||
return 0 | ||
} | ||
|
||
func (c AndroidChunk) GetOrganizationID() uint64 { | ||
return c.OrganizationID | ||
} | ||
|
||
func (c AndroidChunk) GetOptions() utils.Options { | ||
return c.Options | ||
} |
Oops, something went wrong.