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

Added gapit status. #2552

Merged
merged 1 commit into from
Jan 21, 2019
Merged

Added gapit status. #2552

merged 1 commit into from
Jan 21, 2019

Conversation

AWoloszyn
Copy link
Contributor

This will allow gapit to attach to a running server and
provides a status update in your terminal window.

@AWoloszyn AWoloszyn force-pushed the gapit-status branch 2 times, most recently from 4eadf77 to 2e7545e Compare January 17, 2019 18:08

var findTask func(*map[uint64]*tsk, []uint64) *tsk

findTask = func(base *map[uint64]*tsk, indices []uint64) *tsk {
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

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)
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

}

var print func(*map[uint64]*tsk, int, bool)
print = func(m *map[uint64]*tsk, d int, background bool) {
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

return PutTask(ctx, t)
}

// Start returns a new context for a long running task.
Copy link
Contributor

Choose a reason for hiding this comment

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

Update the comment here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@@ -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.
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

This will allow gapit to attach to a running server and
provides a status update in your terminal window.
@AWoloszyn AWoloszyn merged commit 3553f32 into google:master Jan 21, 2019
@AWoloszyn AWoloszyn deleted the gapit-status branch January 21, 2019 18:31
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