Refactored Android battery artifacts

merge-requests/1/head
lasantha 8 years ago
parent 4e15337655
commit b64e47a26a

@ -3,13 +3,13 @@
@Plan:description('Find the battery status of the android device.')
@Import('org.wso2.iot.android.battery:1.0.0')
define stream BatteryStream (meta_owner string, meta_deviceId string, meta_timestamp long, level int, state string, status string, temperature int);
@Import('iot.per.device.stream.android.battery:1.0.0')
define stream BatteryStream (meta_owner string, meta_deviceId string, meta_timestamp long, level int, state string, status int, temperature int);
@Export('org.wso2.iot.android.battery.stats:1.0.0')
@Export('iot.per.device.stream.android.battery.stats:1.0.0')
define stream BatteryStatsStream (meta_owner string, meta_deviceId string, meta_timestamp long, level int, state
string, status string, temperature int, year int, month int, day int, hour int, minute int);
string, status int, temperature int, year int, month int, day int, hour int, minute int);
partition with (meta_deviceId of BatteryStream)
begin

@ -3,7 +3,7 @@
<Editable>true</Editable>
<Name>AndroidBatteryScript</Name>
<Script> CREATE TEMPORARY TABLE AndroidBatteryData USING CarbonAnalytics OPTIONS(tableName
"ORG_WSO2_IOT_ANDROID_BATTERY_STATS", incrementalParams "ORG_WSO2_IOT_ANDROID_BATTERY_STATS, DAY");
"IOT_PER_DEVICE_STREAM_ANDROID_BATTERY_STATS", incrementalParams "IOT_PER_DEVICE_STREAM_ANDROID_BATTERY_STATS, DAY");
CREATE TEMPORARY TABLE Android_Battery_Stat_Per_Day USING CarbonAnalytics
OPTIONS (tableName "Android_Battery_Stat_Per_Day",
@ -16,7 +16,7 @@
FROM AndroidBatteryData
GROUP BY year, month, day, meta_deviceId, meta_owner, type ORDER BY timestamp DESC;
INCREMENTAL_TABLE_COMMIT ORG_WSO2_IOT_ANDROID_BATTERY_STATS;
INCREMENTAL_TABLE_COMMIT IOT_PER_DEVICE_STREAM_ANDROID_BATTERY_STATS;
</Script>
<CronExpression>0 0/5 * * * ?</CronExpression>
</Analytics>

@ -19,6 +19,6 @@
<artifact name= "android_battery_stats_event_sink" version="1.0.0" type="analytics/eventstore"
serverRole="DataAnalyticsServer">
<file>org_wso2_iot_android_battery_stats.xml</file>
<file>iot_per_device_stream_android_battery_stats.xml</file>
</artifact>

@ -18,6 +18,6 @@
-->
<artifact name= "android_battery_stats_streams" version="1.0.0" type="event/stream" serverRole="DataAnalyticsServer">
<file>org.wso2.iot.android.battery.stats_1.0.0.json</file>
<file>iot.per.device.stream.android.battery.stats_1.0.0.json</file>
</artifact>

@ -18,6 +18,6 @@
-->
<artifact name= "android_battery_streams" version="1.0.0" type="event/stream" serverRole="DataAnalyticsServer">
<file>org.wso2.iot.android.battery_1.0.0.json</file>
<file>iot.per.device.stream.android.battery_1.0.0.json</file>
</artifact>

Loading…
Cancel
Save