mirror of
https://github.com/kemko/nomad.git
synced 2026-01-05 01:45:44 +03:00
Merge pull request #5018 from hashicorp/f-executor-stats
executor: streaming stats api
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user