Skip to content

Commit b593136

Browse files
authored
Merge pull request #49904 from dlepow/taskcounts
Batch: taskcounts API update
2 parents 81f0f04 + ea3f622 commit b593136

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

articles/batch/batch-get-resource-counts.md

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ manager: jeconnoc
77

88
ms.service: batch
99
ms.topic: article
10-
ms.date: 06/29/2018
10+
ms.date: 08/23/2018
1111
ms.author: danlep
1212

1313
---
1414
# Monitor Batch solutions by counting tasks and nodes by state
1515

16-
To monitor and manage large-scale Azure Batch solutions, you need accurate counts of resources in various states. Azure Batch provides efficient operations to get these counts for Batch *tasks* and *compute nodes*. Use these operations instead of potentially time-consuming API calls to return detailed information about large collections of tasks or nodes.
16+
To monitor and manage large-scale Azure Batch solutions, you need accurate counts of resources in various states. Azure Batch provides efficient operations to get these counts for Batch *tasks* and *compute nodes*. Use these operations instead of potentially time-consuming list queries that return detailed information about large collections of tasks or nodes.
1717

1818
* [Get Task Counts][rest_get_task_counts] gets an aggregate count of active, running, and completed tasks in a job, and of tasks that succeeded or failed.
1919

@@ -46,19 +46,15 @@ Console.WriteLine("Task count in preparing or running state: {0}", taskCounts.Ru
4646
Console.WriteLine("Task count in completed state: {0}", taskCounts.Completed);
4747
Console.WriteLine("Succeeded task count: {0}", taskCounts.Succeeded);
4848
Console.WriteLine("Failed task count: {0}", taskCounts.Failed);
49-
Console.WriteLine("ValidationStatus: {0}", taskCounts.ValidationStatus);
5049
```
5150

5251
You can use a similar pattern for REST and other supported languages to get task counts for a job.
53-
54-
55-
### Consistency checking for task counts
5652

57-
Batch provides additional validation for task state counts by performing consistency checks against multiple components of the system. In the unlikely event that the consistency check finds errors, Batch corrects the result of the Get Tasks Counts operation based on the results of the consistency check.
53+
### Counts for large numbers of tasks
5854

59-
The `validationStatus` property in the response indicates whether Batch performed the consistency check. If Batch hasn't checked state counts against the actual states held in the system, then the `validationStatus` property is set to `unvalidated`. For performance reasons, Batch doesn't perform the consistency check if the job includes more than 200,000 tasks, so the `validationStatus` property is set to `unvalidated` in this case. (The task count is not necessarily wrong in this case, as even a limited data loss is unlikely.)
55+
The Get Task Counts operation returns counts of task states in the system at a point in time. When your job has a large number of tasks, the counts returned by Get Task Counts can lag the actual task states by up to a few seconds. Batch ensures eventual consistency between the results of Get Task Counts and the actual task states (which you can query via the List Tasks API). However, if your job has a very large number of tasks (>200,000), we recommend that you use the List Tasks API and a [filtered query](batch-efficient-list-queries.md) instead, which provides more up-to-date information.
6056

61-
When a task changes state, the aggregation pipeline processes the change within a few seconds. The Get Task Counts operation reflects the updated task counts within that period. However, if the aggregation pipeline misses a change in a task state, then that change is not registered until the next validation pass. During this time, task counts may be slightly inaccurate due to the missed event, but they are corrected on the next validation pass.
57+
Batch Service API versions before 2018-08-01.7.0 also return a `validationStatus` property in the Get Task Counts response. This property indicates whether Batch checked the state counts for consistency with the states reported in the List Tasks API. A value of `validated` indicates only that Batch checked for consistency at least once for the job. The value of the `validationStatus` property does not indicate whether the counts that Get Task Counts returns are currently up-to-date.
6258

6359
## Node state counts
6460

@@ -98,7 +94,7 @@ foreach (var nodeCounts in batchClient.PoolOperations.ListPoolNodeCounts())
9894
Console.WriteLine("Low-priority node count in Preempted state: {0}", nodeCounts.LowPriority.Preempted);
9995
}
10096
```
101-
The following C# snippet shows how to list node counts for a given pool in the current account.
97+
The following C# snippet shows how to list node counts for a given pool in the current account.
10298

10399
```csharp
104100
foreach (var nodeCounts in batchClient.PoolOperations.ListPoolNodeCounts(new ODATADetailLevel(filterClause: "poolId eq 'testpool'")))

0 commit comments

Comments
 (0)