Skip to content

Commit

Permalink
skip goroutines for initial version
Browse files Browse the repository at this point in the history
  • Loading branch information
Zylphrex committed Sep 26, 2023
1 parent c609910 commit 35b4a21
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
18 changes: 11 additions & 7 deletions cmd/vroom/regressed.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,17 @@ func (env *environment) postRegressed(w http.ResponseWriter, r *http.Request) {
return
}

occurrences := occurrence.ProcessRegressedFunctions(
ctx,
hub,
env.storage,
regressedFunctions,
10,
)
occurrences := []*occurrence.Occurrence{}
for _, regressedFunction := range regressedFunctions {
occurrence, err := occurrence.ProcessRegressedFunction(ctx, env.storage, regressedFunction)
if err != nil {
hub.CaptureException(err)
continue
} else if occurrence == nil {
continue
}
occurrences = append(occurrences, occurrence)
}

s := sentry.StartSpan(ctx, "json.marshal")
data := struct {
Expand Down
4 changes: 2 additions & 2 deletions internal/occurrence/regressed_frame.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ type RegressedFunction struct {
UnweightedTValue float64 `json:"unweighted_t_value"`
}

func processRegressedFunction(
func ProcessRegressedFunction(
ctx context.Context,
profilesBucket *blob.Bucket,
regressedFunction RegressedFunction,
Expand Down Expand Up @@ -93,7 +93,7 @@ func ProcessRegressedFunctions(
go func() {
defer wg.Done()
for regressedFunction := range regressedChan {
occurrence, err := processRegressedFunction(ctx, profilesBucket, regressedFunction)
occurrence, err := ProcessRegressedFunction(ctx, profilesBucket, regressedFunction)
if err != nil {
hub.CaptureException(err)
continue
Expand Down

0 comments on commit 35b4a21

Please sign in to comment.