简体   繁体   English

Azure IoT中心Java获取设备的流量统计信息

[英]Azure IoT Hub Java get traffic statistics for a device

I have an Azure Iot Hub setup with a few devices and a Java service connected. 我有一个连接了一些设备和Java服务的Azure Iot Hub设置。 I would like to be able to retrieve the traffic statistics (ie number of device to cloud messages in a particular time window). 我希望能够检索流量统计信息(即在特定时间窗口内设备到云消息的数量)。

The Azure portal is able to display the overall traffic data (but not on a per device basis), but I haven't found any way of accessing that data, nor seeing a breakdown of the traffic for each device on the portal. Azure门户能够显示总体流量数据(但不能显示每个设备的数据),但是我没有找到任何访问该数据的方法,也没有看到门户上每个设备的流量明细。

I've looked into the REST API that Azure supports, including the Java Azure SDK, but couldn't find anything relating to IoT network traffic. 我已经研究了Azure支持的REST API,包括Java Azure SDK,但是找不到与IoT网络流量相关的任何内容。

Azure IoT Hub's metrics (the data you see on the portal) cannot be broken down to a device level directly. 无法将Azure IoT中心的指标 (您在门户上看到的数据)直接细分为设备级别。 To get traffic statistics for a device or a set of devices, you would need to set up an additional service to consume and count the messages. 要获取一个设备或一组设备的流量统计信息,您将需要设置其他服务来使用和计数消息。 One way to do it is to use Azure Stream Analytics and count up the messages using the IoTHub.ConnectionDeviceId field. 一种方法是使用Azure流分析并使用IoTHub.ConnectionDeviceId字段对消息进行计数。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM