Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tagshow/taghide commands to select a subset of tags in a profile #33

Merged
merged 3 commits into from
Aug 23, 2016

Conversation

rauls5382
Copy link
Contributor

No description provided.

// FilterTagsByName filters the tags in a profile and only keeps
// tags that match show and not hide.
func (p *Profile) FilterTagsByName(show, hide *regexp.Regexp) (sm, hm bool) {
matchShow := func(name string) bool {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a bit difficult to read code with two matchShow variables with different meanings next to each other.
Maybe in this case, I would choose matchRemove for the function, then return !matchShow || matchHide and change later 2x if matchRemove(lab) { ... } so there are less negations to think in.

@josef-jelinek josef-jelinek merged commit 7dfb5e8 into google:master Aug 23, 2016
@rauls5382 rauls5382 deleted the tagshow branch October 7, 2016 18:26
lannadorai pushed a commit to lannadorai/pprof that referenced this pull request Mar 1, 2018
* Add dependency on googlemock to enable EXPECT_THAT(<container>, Contains(...));

This should allow simplified tests that are more readable and easier to add.

(also clean up an attempt to LOG() a streamstream that failed to compile.)

PiperOrigin-RevId: 174061634

* Store perf-version in profile.proto comment.

PiperOrigin-RevId: 174094448
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants