Skip to content

Commit

Permalink
Merge pull request #542 from getsentry/txiao/fix/pass-readjob-result-…
Browse files Browse the repository at this point in the history
…as-pointer

fix(readjob): Pass readjob result as pointer
  • Loading branch information
Zylphrex authored Dec 6, 2024
2 parents dc73a44 + 13f6269 commit 4a38d5a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@
- 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))
- Remove unused chunks flamegraph endpoint ([#541](https://github.com/getsentry/vroom/pull/541))
- Pass readjob result as pointer ([#542](https://github.com/getsentry/vroom/pull/542))

## 23.12.0

Expand Down
2 changes: 1 addition & 1 deletion cmd/vroom/chunk.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ func (env *environment) postProfileFromChunkIDs(w http.ResponseWriter, r *http.R
// sense to have a final profile with missing chunks
continue
}
chunks = append(chunks, result.Chunk)
chunks = append(chunks, *result.Chunk)
}
s.Finish()
if err != nil {
Expand Down
8 changes: 4 additions & 4 deletions internal/chunk/sample_readjob.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ type (

ReadJobResult struct {
Err error
Chunk Chunk
Chunk *Chunk
TransactionID string
ThreadID *string
Start uint64
Expand All @@ -45,7 +45,7 @@ func (job ReadJob) Read() {

job.Result <- ReadJobResult{
Err: err,
Chunk: chunk,
Chunk: &chunk,
TransactionID: job.TransactionID,
ThreadID: job.ThreadID,
Start: job.Start,
Expand All @@ -63,7 +63,7 @@ type (
CallTreesReadJobResult struct {
Err error
CallTrees map[string][]*nodetree.Node
Chunk SampleChunk
Chunk *SampleChunk
TransactionID string
ThreadID *string
Start uint64
Expand All @@ -90,7 +90,7 @@ func (job CallTreesReadJob) Read() {
job.Result <- CallTreesReadJobResult{
Err: err,
CallTrees: callTrees,
Chunk: chunk,
Chunk: &chunk,
TransactionID: job.TransactionID,
ThreadID: job.ThreadID,
Start: job.Start,
Expand Down
8 changes: 4 additions & 4 deletions internal/profile/readjob.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type (

ReadJobResult struct {
Err error
Profile Profile
Profile *Profile
}
)

Expand All @@ -34,7 +34,7 @@ func (job ReadJob) Read() {
&profile,
)

job.Result <- ReadJobResult{Profile: profile, Err: err}
job.Result <- ReadJobResult{Profile: &profile, Err: err}
}

func (result ReadJobResult) Error() error {
Expand All @@ -47,7 +47,7 @@ type (
CallTreesReadJobResult struct {
Err error
CallTrees map[uint64][]*nodetree.Node
Profile Profile
Profile *Profile
}
)

Expand All @@ -70,7 +70,7 @@ func (job CallTreesReadJob) Read() {

job.Result <- CallTreesReadJobResult{
CallTrees: callTrees,
Profile: profile,
Profile: &profile,
Err: err,
}
}
Expand Down

0 comments on commit 4a38d5a

Please sign in to comment.