Conversation
4eadf77 to
2e7545e
Compare
qining
reviewed
Jan 21, 2019
cmd/gapit/status.go
Outdated
|
|
||
| var findTask func(*map[uint64]*tsk, []uint64) *tsk | ||
|
|
||
| findTask = func(base *map[uint64]*tsk, indices []uint64) *tsk { |
Contributor
There was a problem hiding this comment.
Probably no need to make it a pointer to map?
Contributor
Author
There was a problem hiding this comment.
Fair, I constantly get confused by golang semantics for maps, as they are non-obvious.
2e7545e to
c55ae3a
Compare
qining
reviewed
Jan 21, 2019
cmd/gapit/status.go
Outdated
| var forAncestors func(*map[uint64]*tsk, []uint64, func(*tsk)) | ||
| forAncestors = func(base *map[uint64]*tsk, indices []uint64, f func(*tsk)) { | ||
| if next_tsk, ok := (*base)[indices[0]]; ok { | ||
| f(next_tsk) |
Contributor
There was a problem hiding this comment.
Looks like f is called for all the tasks specified with the indices, not only the ancestors. Probably change the name of forAncestors to something else?
cmd/gapit/status.go
Outdated
| } | ||
|
|
||
| var print func(*map[uint64]*tsk, int, bool) | ||
| print = func(m *map[uint64]*tsk, d int, background bool) { |
Contributor
There was a problem hiding this comment.
Probably no need to make m a pointer? I remember all map in golang are passed by reference.
core/app/status/task.go
Outdated
| return PutTask(ctx, t) | ||
| } | ||
|
|
||
| // Start returns a new context for a long running task. |
gapis/service/service.go
Outdated
| // This is a debug API, and may be removed in the future. | ||
| Profile(ctx context.Context, pprof, trace io.Writer, memorySnapshotInterval uint32) (stop func() error, err error) | ||
|
|
||
| // Status starts resolving status events. It calls f for every update and m for every status update. |
Contributor
There was a problem hiding this comment.
Comment: m for every memory status update?
c55ae3a to
4dc4e15
Compare
qining
approved these changes
Jan 21, 2019
This will allow gapit to attach to a running server and provides a status update in your terminal window.
4dc4e15 to
50cc7ab
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This will allow gapit to attach to a running server and
provides a status update in your terminal window.