Method GetReplicaStatsAsync
GetReplicaStatsAsync(String, GetReplicaStatsOptions, CancellationToken)
Declaration
public Task<ReplicaStatsResult> GetReplicaStatsAsync(string tableName, GetReplicaStatsOptions options = null, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
String | tableName | Name of the table. |
GetReplicaStatsOptions | options | (Optional) Options for the operation. |
CancellationToken | cancellationToken | (Optional) Cancellation token. |
Returns
Type | Description |
---|---|
Task<ReplicaStatsResult> | Task returning ReplicaStatsResult. |
Remarks
This operation retrieves stats information for the replicas of a Global Active table.This information includes a time series of replica stats, as found in ReplicaStatsRecord. For more information on Global Active tables, see Global Active Tables in NDCS .
It is possible to return a range of stats records or, by default, only the most recent stats records (up to the limit) for each replica if StartTime is not specified. Replica stats 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.
This API returns stats for all replicas as a dictionary keyed by region id of each replica and values being a list of ReplicaStatsRecord instances for that replica (see StatsRecords). You may limit the result to the stats of only one replica by using an overload that takes a region parameter (see GetReplicaStatsAsync(String, Region, GetReplicaStatsOptions, CancellationToken) and GetReplicaStatsAsync(String, String, GetReplicaStatsOptions, CancellationToken)).
Because the number of replica stats records can be very large, each call to GetReplicaStatsAsync returns a limited number of records (the default limit is 1000). You can customize this limit via Limit option. You can retrieve large number of replica stats records over multiple calls to GetReplicaStatsAsync by setting StartTime on each subsequent call to the value of NextStartTime returned by a previous call.
Exceptions
Type | Condition |
---|---|
TimeoutException | Operation has timed out. |
InvalidOperationException | The table or the service is not in a valid state to perform this operation. |
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. |
See Also
GetReplicaStatsAsync(String, Region, GetReplicaStatsOptions, CancellationToken)
Declaration
public Task<ReplicaStatsResult> GetReplicaStatsAsync(string tableName, Region region, GetReplicaStatsOptions options = null, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
String | tableName | Name of the table. |
Region | region | Region from which to query replica stats information. |
GetReplicaStatsOptions | options | (Optional) Options for the operation. |
CancellationToken | cancellationToken | (Optional) Cancellation token. |
Returns
Type | Description |
---|---|
Task<ReplicaStatsResult> | Task returning ReplicaStatsResult. |
Remarks
This API is similar to
GetReplicaStatsAsync(String, GetReplicaStatsOptions, CancellationToken)
but allows to pass a region
parameter to only
get replica stats for that region.
Note that the stats are returned in the same format as for
GetReplicaStatsAsync(String, GetReplicaStatsOptions, CancellationToken),
in this case StatsRecords being a
dictionary with one key for the specified region. If
region
is null
, this API will behave
identically to
GetReplicaStatsAsync(String, GetReplicaStatsOptions, CancellationToken)
and stats for all regions will be returned.
Exceptions
Type | Condition |
---|---|
TimeoutException | Operation has timed out. |
InvalidOperationException | The table or the service is not in a valid state to perform this operation. |
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. |
See Also
GetReplicaStatsAsync(String, String, GetReplicaStatsOptions, CancellationToken)
Declaration
public Task<ReplicaStatsResult> GetReplicaStatsAsync(string tableName, string regionId, GetReplicaStatsOptions options = null, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
String | tableName | Name of the table. |
String | regionId | Region id of the region from which to query replica stats. |
GetReplicaStatsOptions | options | (Optional) Options for the operation. |
CancellationToken | cancellationToken | (Optional) Cancellation token. |
Returns
Type | Description |
---|---|
Task<ReplicaStatsResult> | Task returning ReplicaStatsResult. |
Remarks
This API is similar to
GetReplicaStatsAsync(String, GetReplicaStatsOptions, CancellationToken)
but allows to pass a regionId
parameter to only
get replica stats for that region.
Note that the stats are returned in the same format as for
GetReplicaStatsAsync(String, GetReplicaStatsOptions, CancellationToken),
in this case StatsRecords being a
dictionary with one key for the specified region. If
regionId
is null
, this API will behave
identically to
GetReplicaStatsAsync(String, GetReplicaStatsOptions, CancellationToken)
and stats for all regions will be returned.
Exceptions
Type | Condition |
---|---|
TimeoutException | Operation has timed out. |
InvalidOperationException | The table or the service is not in a valid state to perform this operation. |
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. |