Skip to content

Commit

Permalink
NBS-4789: [Disk Manager] adding lister metrics for TaskStatusReadyToC…
Browse files Browse the repository at this point in the history
…ancel and TaskStatusCancelling (#271)

* adding more lister metrics

* delete bad comment
  • Loading branch information
BarkovBG authored Jan 29, 2024
1 parent f8e5cf6 commit 9c51f27
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion cloud/tasks/collect_lister_metrics_task.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,25 @@ func (c collectListerMetricsTask) Run(
return err
}

err = c.collectTasksMetrics(
ctx,
func(context.Context) ([]storage.TaskInfo, error) {
return c.storage.ListTasksRunning(
ctx,
^uint64(0), // limit
)
},
storage.TaskStatusToString(storage.TaskStatusRunning),
)
if err != nil {
return err
}

err = c.collectTasksMetrics(
ctx,
func(context.Context) ([]storage.TaskInfo, error) {
return c.storage.ListTasksReadyToCancel(
ctx, // excludingHostname
ctx,
^uint64(0), // limit
nil,
)
Expand All @@ -64,6 +78,20 @@ func (c collectListerMetricsTask) Run(
if err != nil {
return err
}

err = c.collectTasksMetrics(
ctx,
func(context.Context) ([]storage.TaskInfo, error) {
return c.storage.ListTasksCancelling(
ctx,
^uint64(0), // limit
)
},
storage.TaskStatusToString(storage.TaskStatusCancelling),
)
if err != nil {
return err
}
}

return nil
Expand Down

0 comments on commit 9c51f27

Please sign in to comment.