Method GetTableUsageAsync
GetTableUsageAsync(String, GetTableUsageOptions, CancellationToken)
Declaration
public Task<TableUsageResult> GetTableUsageAsync(string tableName, GetTableUsageOptions options = null, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
String | tableName | Name of the table. |
GetTableUsageOptions | options | (Optional) Options for this operation, which
allow specify a time range for usage records, limit on the number
usage records returned and other parameters. If not specified
or null , appropriate defaults will be used.
|
CancellationToken | cancellationToken | (Optional) Cancellation token. |
Returns
Type | Description |
---|---|
Task<TableUsageResult> | Task returning TableUsageResult. |
Remarks
This information includes a time series of usage snapshots, each indicating data such as read and write throughput, throttling events, etc, as found in TableUsageRecord.
Note: this method is supported with the Cloud Service and Cloud Simulator but is not supported with on-premise NoSQL database (see KVStore), where it will result in exception.
Usage information is collected in time slices and returned in individual usage records. It is possible to return a range of usage records within a given time period. Unless the time period is specified, only one most recent usage record is returned. Usage records are created on a regular basis and maintained for a period of time. Only records for time periods that have completed are returned so that a user never sees changing data for a specific range.
The usage record time slices are short (1 minute) and TableUsageResult will contain one TableUsageRecord per each time slice in a specified time range, regardless of whether the table was used at that time or was idle. Thus, care needs to be taken when specifying the time range (see StartTime and EndTime) to avoid returning excessive number of table usage records. Another way is to specify Limit option to limit the number of usage records returned. See GetTableUsageOptions.
Exceptions
Type | Condition |
---|---|
ArgumentException | If
tableName is null or invalid
or options contains invalid values. |
TimeoutException | Operation has timed out. |
InvalidOperationException | The table or service is not in a valid state to perform this operation. |
NotSupportedException | If this operation is invoked on on-premise NoSQL database (see KVStore). |
NoSQLException | NoSQLException or one of its subclasses is thrown if operation cannot be performed for any other reason. See documentation for corresponding subclass of NoSQLException. |