我已经测试了在新的Azure门户中创建经典存储帐户(manage.windowsazure.com)和"new"存储帐户 . 将它们设置为相似并运行相同的代码以创建和配置队列 . 但指标仅显示门户网站中的经典存储帐户(能够在新门户网站中查看这两个帐户)
我已经设置了这样的ServiceProperties,并且可以在获取服务属性或查看Azure门户时成功查看这些更改 .
CloudStorageAccount storageAccount =
CloudStorageAccount.parse(storageConnectionString);
CloudQueueClient queueClient = storageAccount.createCloudQueueClient();
MetricsProperties metricsProperties = new MetricsProperties();
metricsProperties.setMetricsLevel(MetricsLevel.SERVICE_AND_API);
metricsProperties.setRetentionIntervalInDays(2);
LoggingProperties loggingProperties = new LoggingProperties();
loggingProperties.setRetentionIntervalInDays(10);
loggingProperties.setLogOperationTypes(EnumSet.of(LoggingOperations.READ, LoggingOperations.WRITE, LoggingOperations.DELETE));
ServiceProperties serviceProperties = new ServiceProperties();
serviceProperties.setHourMetrics(metricsProperties);
serviceProperties.setMinuteMetrics(metricsProperties);
serviceProperties.setLogging(loggingProperties);
queueClient.uploadServiceProperties(serviceProperties);
当我使用Microsoft Azure存储资源管理器时,两个帐户都有用于度量和日志记录设置的表,因此两者都看起来像这样,并且表包含数据 . 所以从这里看起来很相似 . 但度量标准图和选项仅适用于Azure门户中的Classic Storage帐户 . 对于“新”存储帐户,它仅显示“无可用数据” .
这是一个错误吗?或者是一个经典的存储帐户默认配置了一些属性我手动需要应用于新的存储帐户,使其行为相似?
1 回答
根据您的代码设置,我利用WindowsAzure.Storage(版本7.2.1)在经典存储帐户和新存储帐户上配置我的存储帐户指标,如下所示:
在代码段中,您可以配置Blob存储的分钟/小时指标 .
由于您已确认相关表包含度量标准记录,因此您可以尝试登录Azure门户,选择存储帐户,单击“队列服务”>“度量标准”,单击“编辑图表”并更改“时间范围”,如下所示:
Note: 如果存在任何度量标准记录,则默认情况下将时间范围设置为今天 . 可能存在数据延迟,您可以尝试指定时间范围,并确定是否可以按预期检索指标数据 .