Merge pull request #5018 from hashicorp/f-executor-stats

executor: streaming stats api
This commit is contained in:
Nick Ethier
2019-01-14 15:02:35 -05:00
committed by GitHub
36 changed files with 1145 additions and 662 deletions

View File

@@ -497,13 +497,13 @@ func (d *Driver) InspectTask(taskID string) (*drivers.TaskStatus, error) {
return handle.TaskStatus(), nil
}
func (d *Driver) TaskStats(taskID string) (*drivers.TaskResourceUsage, error) {
func (d *Driver) TaskStats(ctx context.Context, taskID string, interval time.Duration) (<-chan *drivers.TaskResourceUsage, error) {
handle, ok := d.tasks.Get(taskID)
if !ok {
return nil, drivers.ErrTaskNotFound
}
return handle.exec.Stats()
return handle.exec.Stats(ctx, interval)
}
func (d *Driver) TaskEvents(ctx context.Context) (<-chan *drivers.TaskEvent, error) {