-
Notifications
You must be signed in to change notification settings - Fork 327
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
Added gapit status. #2552
Added gapit status. #2552
Conversation
4eadf77
to
2e7545e
Compare
cmd/gapit/status.go
Outdated
|
||
var findTask func(*map[uint64]*tsk, []uint64) *tsk | ||
|
||
findTask = func(base *map[uint64]*tsk, indices []uint64) *tsk { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably no need to make it a pointer to map?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair, I constantly get confused by golang semantics for maps, as they are non-obvious.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
2e7545e
to
c55ae3a
Compare
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
cmd/gapit/status.go
Outdated
} | ||
|
||
var print func(*map[uint64]*tsk, int, bool) | ||
print = func(m *map[uint64]*tsk, d int, background bool) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably no need to make m
a pointer? I remember all map
in golang are passed by reference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
core/app/status/task.go
Outdated
return PutTask(ctx, t) | ||
} | ||
|
||
// Start returns a new context for a long running task. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update the comment here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
gapis/service/service.go
Outdated
@@ -134,6 +135,9 @@ type Service interface { | |||
// 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment: m for every memory status update?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
c55ae3a
to
4dc4e15
Compare
This will allow gapit to attach to a running server and provides a status update in your terminal window.
4dc4e15
to
50cc7ab
Compare
This will allow gapit to attach to a running server and
provides a status update in your terminal window.