コード例 #1
0
        /// <summary>
        /// Retrieve statistics related to replication for the Table service
        /// </summary>
        /// <param name="tableClient"></param>
        private static async Task ServiceStatsSample(CloudTableClient tableClient)
        {
            Console.WriteLine();

            var originalLocation = tableClient.DefaultRequestOptions.LocationMode;

            Console.WriteLine("Service stats:");
            try
            {
                tableClient.DefaultRequestOptions.LocationMode = LocationMode.SecondaryOnly;
                ServiceStats stats = await tableClient.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
                tableClient.DefaultRequestOptions.LocationMode = originalLocation;
            }

            Console.WriteLine();
        }
コード例 #2
0
 public Task <ServiceStats> GetServiceStatsAsync(TableRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)
 {
     return(cloudTableClientImplementation.GetServiceStatsAsync(options, operationContext, cancellationToken));
 }