@@ -17,7 +17,7 @@ defmodule NervesHub.Insights do
1717 @ doc """
1818 Count of currently connected Devices, scoped to an individual Product.
1919 """
20- @ spec connected_count ( product :: NervesHub.Products. Product. t ( ) ) :: integer ( )
20+ @ spec connected_count ( product :: Product . t ( ) ) :: number ( )
2121 def connected_count ( product ) do
2222 Device
2323 |> join ( :left , [ d ] , lc in assoc ( d , :latest_connection ) , as: :latest_connection )
@@ -85,7 +85,7 @@ defmodule NervesHub.Insights do
8585 @ doc """
8686 Count of devices where the health status isn't 'healthy' or 'unknown', scoped to an individual Product.
8787 """
88- @ spec not_healthy_devices_count ( product :: NervesHub.Products. Product. t ( ) ) :: integer ( )
88+ @ spec not_healthy_devices_count ( product :: Product . t ( ) ) :: number ( )
8989 def not_healthy_devices_count ( product ) do
9090 Device
9191 |> join ( :left , [ d ] , lc in assoc ( d , :latest_health ) , as: :latest_health )
@@ -97,7 +97,7 @@ defmodule NervesHub.Insights do
9797 @ doc """
9898 Count of devices which haven't connected in the last 24 hours, scoped to an individual Product.
9999 """
100- @ spec not_recently_seen_count ( product :: NervesHub.Products. Product. t ( ) ) :: integer ( )
100+ @ spec not_recently_seen_count ( product :: Product . t ( ) ) :: number ( )
101101 def not_recently_seen_count ( product ) do
102102 Device
103103 |> join ( :left , [ d ] , lc in assoc ( d , :latest_connection ) , as: :latest_connection )
@@ -110,7 +110,7 @@ defmodule NervesHub.Insights do
110110 @ doc """
111111 Count of different firmware versions run on connected devices, scoped to an individual Product.
112112 """
113- @ spec active_firmware_versions_count ( product :: NervesHub.Products. Product. t ( ) ) :: integer ( )
113+ @ spec active_firmware_versions_count ( product :: Product . t ( ) ) :: number ( )
114114 def active_firmware_versions_count ( product ) do
115115 Device
116116 |> select ( [ d ] , % { version: d . firmware_metadata [ "uuid" ] } )
@@ -122,7 +122,7 @@ defmodule NervesHub.Insights do
122122 @ doc """
123123 List of unique firmware versions run on connected devices, scoped to an individual Product.
124124 """
125- @ spec active_firmware_versions ( product :: NervesHub.Products. Product. t ( ) ) :: integer ( )
125+ @ spec active_firmware_versions ( product :: Product . t ( ) ) :: list ( )
126126 def active_firmware_versions ( product ) do
127127 Device
128128 |> select ( [ d ] , % { version: d . firmware_metadata [ "uuid" ] } )
@@ -134,7 +134,7 @@ defmodule NervesHub.Insights do
134134 @ doc """
135135 Count of devices which have reconnected more than 5 times in the last 24 hours, scoped to an individual Product.
136136 """
137- @ spec high_reconnect_count ( product :: NervesHub.Products. Product. t ( ) ) :: integer ( )
137+ @ spec high_reconnect_count ( product :: Product . t ( ) ) :: number ( )
138138 def high_reconnect_count ( product ) do
139139 Device
140140 |> join ( :left , [ d ] , lc in assoc ( d , :device_connections ) , as: :device_connections )
0 commit comments