Skip to content

Commit

Permalink
ref: add android chunk calltree implementation (#536)
Browse files Browse the repository at this point in the history
* add android chunk calltree implementation
  • Loading branch information
viglia authored Dec 3, 2024
1 parent 918cd87 commit a52c931
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
- Add utility to merge a list of android chunks and generate a speedscope result ([#531](https://github.com/getsentry/vroom/pull/531))
- Remove unused legacy flamegraph code path. ([#533](https://github.com/getsentry/vroom/pull/533))
- Remove generic metrics ingestion ([#534](https://github.com/getsentry/vroom/pull/534))
- Add android chunk calltree implementation and signature definition to the chunk interface ([#536](https://github.com/getsentry/vroom/pull/536))
- Update sentry-go dependency to v0.29.1 ([#535](https://github.com/getsentry/vroom/pull/535))
- Lower number of concurrent reads ([#537](https://github.com/getsentry/vroom/pull/537))
- Remove unused metrics summary kafka writer ([#538](https://github.com/getsentry/vroom/pull/538))
Expand Down
11 changes: 9 additions & 2 deletions internal/chunk/android.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package chunk

import (
"encoding/json"
"strconv"
"time"

"github.com/getsentry/vroom/internal/clientsdk"
Expand Down Expand Up @@ -53,8 +54,14 @@ 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) CallTrees(_ *string) (map[string][]*nodetree.Node, error) {
callTrees := c.Profile.CallTrees()
stringThreadCallTrees := make(map[string][]*nodetree.Node)
for tid, callTree := range callTrees {
threadID := strconv.FormatUint(tid, 10)
stringThreadCallTrees[threadID] = callTree
}
return stringThreadCallTrees, nil
}

func (c AndroidChunk) SDKName() string {
Expand Down
2 changes: 2 additions & 0 deletions internal/chunk/chunk.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"fmt"

"github.com/getsentry/vroom/internal/frame"
"github.com/getsentry/vroom/internal/nodetree"
"github.com/getsentry/vroom/internal/platform"
"github.com/getsentry/vroom/internal/utils"
)
Expand All @@ -21,6 +22,7 @@ type (
GetRetentionDays() int
GetOptions() utils.Options
GetFrameWithFingerprint(uint32) (frame.Frame, error)
CallTrees(activeThreadID *string) (map[string][]*nodetree.Node, error)

DurationMS() uint64
EndTimestamp() float64
Expand Down

0 comments on commit a52c931

Please sign in to comment.