You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/batch/batch-get-resource-counts.md
+6-10Lines changed: 6 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,13 +7,13 @@ manager: jeconnoc
7
7
8
8
ms.service: batch
9
9
ms.topic: article
10
-
ms.date: 06/29/2018
10
+
ms.date: 08/23/2018
11
11
ms.author: danlep
12
12
13
13
---
14
14
# Monitor Batch solutions by counting tasks and nodes by state
15
15
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.
17
17
18
18
*[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.
19
19
@@ -46,19 +46,15 @@ Console.WriteLine("Task count in preparing or running state: {0}", taskCounts.Ru
46
46
Console.WriteLine("Task count in completed state: {0}", taskCounts.Completed);
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
56
52
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
58
54
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.
60
56
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.
62
58
63
59
## Node state counts
64
60
@@ -98,7 +94,7 @@ foreach (var nodeCounts in batchClient.PoolOperations.ListPoolNodeCounts())
98
94
Console.WriteLine("Low-priority node count in Preempted state: {0}", nodeCounts.LowPriority.Preempted);
99
95
}
100
96
```
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.
0 commit comments