-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(profiler): do not collect disabled profile types (#2836)
* fix(profiler): do not collect disabled profile types Fixes #2835
- Loading branch information
Showing
2 changed files
with
24 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -353,6 +353,19 @@ func (a *agent) profileAndUpload(ctx context.Context, p *pb.Profile) { | |
var prof bytes.Buffer | ||
pt := p.GetProfileType() | ||
|
||
ptEnabled := false | ||
for _, enabled := range a.profileTypes { | ||
if enabled == pt { | ||
ptEnabled = true | ||
break | ||
} | ||
} | ||
|
||
if !ptEnabled { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
aalexand
via email
Contributor
|
||
debugLog("skipping collection of disabled profile type: %v", pt) | ||
return | ||
} | ||
|
||
switch pt { | ||
case pb.ProfileType_CPU: | ||
duration, err := ptypes.Duration(p.Duration) | ||
|
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
Note that this change should become unnecessary once b/112391682 is fixed.
@wyk9787 FYI