我已经编写了一个独立的代码来获取 Azure 存储 Blob 服务的指标,但我只想获得最后 5 分钟的指标,如何从 $MetricsMinutePrimaryTransactionsBlob 获取它请建议
CloudTable cloudMetric = tableClient.getTableReference(cloud
.getHourMetricsTable(StorageService.BLOB).getName());
String partitionFilter2 = TableQuery.generateFilterCondition(
"PartitionKey", QueryComparisons.EQUAL, "20170602T1400");
String rowFilter3 = TableQuery.generateFilterCondition("RowKey",
QueryComparisons.EQUAL, "user;All");
String combinedFilter = TableQuery.combineFilters(partitionFilter2,
Operators.AND, rowFilter3);
TableQuery<MetricsPojo> partitionQuery2 = TableQuery.from(
MetricsPojo.class).where(combinedFilter);
for (MetricsPojo capacityMetrics2 : cloudMetric
.execute(partitionQuery2)) {
System.out.println(capacityMetrics2);
System.out.println(capacityMetrics2.getPartitionKey() + "\n"
+ capacityMetrics2.getRowKey() + "\n"
+ capacityMetrics2.getTimestamp());