本文整理匯總了C#中Microsoft.WindowsAzure.Storage.Queue.CloudQueueClient.GetServiceStatsAsync方法的典型用法代碼示例。如果您正苦於以下問題:C# CloudQueueClient.GetServiceStatsAsync方法的具體用法?C# CloudQueueClient.GetServiceStatsAsync怎麽用?C# CloudQueueClient.GetServiceStatsAsync使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Microsoft.WindowsAzure.Storage.Queue.CloudQueueClient
的用法示例。
在下文中一共展示了CloudQueueClient.GetServiceStatsAsync方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: ServiceStatsSample
/// <summary>
/// Retrieve statistics related to replication for the Table service
/// </summary>
/// <param name="queueClient"></param>
private static async Task ServiceStatsSample(CloudQueueClient queueClient)
{
Console.WriteLine();
var originalLocation = queueClient.DefaultRequestOptions.LocationMode;
Console.WriteLine("Service stats:");
try
{
queueClient.DefaultRequestOptions.LocationMode = LocationMode.SecondaryOnly;
ServiceStats stats = await queueClient.GetServiceStatsAsync();
Console.WriteLine(" Last sync time: {0}", stats.GeoReplication.LastSyncTime);
Console.WriteLine(" Status: {0}", stats.GeoReplication.Status);
}
catch (StorageException)
{
// only works on RA-GRS (Read Access – Geo Redundant Storage)
}
finally
{
// Restore original value
queueClient.DefaultRequestOptions.LocationMode = originalLocation;
}
Console.WriteLine();
}