public async Task GetTableServiceStatsReturnsStats() { // Get statistics TableServiceStats stats = await service.GetTableServiceStatsAsync().ConfigureAwait(false); // Test that the secondary location is live Assert.AreEqual(new GeoReplicationStatusType("live"), stats.GeoReplication.Status); }
public async Task GetTableServiceStatsReturnsStats() { if (_endpointType == TableEndpointType.CosmosTable) { Assert.Ignore("GetProperties is currently not supported by Cosmos endpoints."); } // Get statistics TableServiceStats stats = await service.GetTableServiceStatsAsync().ConfigureAwait(false); // Test that the secondary location is live Assert.AreEqual(new GeoReplicationStatusType("live"), stats.GeoReplication.Status); }
public ResponseWithHeaders <TableServiceStats, ServiceGetStatisticsHeaders> GetStatistics(int?timeout = null, string requestId = null, CancellationToken cancellationToken = default) { using var message = CreateGetStatisticsRequest(timeout, requestId); _pipeline.Send(message, cancellationToken); var headers = new ServiceGetStatisticsHeaders(message.Response); switch (message.Response.Status) { case 200: { TableServiceStats value = default; var document = XDocument.Load(message.Response.ContentStream, LoadOptions.PreserveWhitespace); if (document.Element("TableServiceStats") is XElement tableServiceStatsElement) { value = TableServiceStats.DeserializeTableServiceStats(tableServiceStatsElement); } return(ResponseWithHeaders.FromValue(value, headers, message.Response)); } default: throw _clientDiagnostics.CreateRequestFailedException(message.Response); } }