forked from community/device-mgt-plugins
parent
68270525ab
commit
779435a91d
@ -0,0 +1,22 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||||
|
<Analytics>
|
||||||
|
<Editable>true</Editable>
|
||||||
|
<Name>AndriodCallScript</Name>
|
||||||
|
<Script> CREATE TEMPORARY TABLE AndroidBatteryData USING CarbonAnalytics OPTIONS(tableName
|
||||||
|
"ORG_WSO2_IOT_ANDROID_BATTERY_STATS", incrementalParams "ORG_WSO2_IOT_ANDROID_BATTERY_STATS, DAY");
|
||||||
|
|
||||||
|
CREATE TEMPORARY TABLE Android_Battery_Stat_Per_Day USING CarbonAnalytics
|
||||||
|
OPTIONS (tableName "Android_Battery_Stat_Per_Day",
|
||||||
|
schema "owner STRING, deviceId STRING, type STRING, level INT -i, year INT -i, month INT -i, day INT -i,
|
||||||
|
timestamp STRING", primaryKeys "year, month, day, deviceId, owner, type", mergeSchema "false");
|
||||||
|
|
||||||
|
INSERT INTO TABLE Android_Battery_Stat_Per_Day
|
||||||
|
SELECT meta_owner as owner, meta_deviceId as deviceId, type, avg(level) as level, year, month, day,
|
||||||
|
getDateStartingTime(year, month, day) as timestamp
|
||||||
|
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;
|
||||||
|
</Script>
|
||||||
|
<CronExpression>0 0/5 * * * ?</CronExpression>
|
||||||
|
</Analytics>
|
4
components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_level_chart_gadget/artifact.xml → components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_script/artifact.xml
4
components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_level_chart_gadget/artifact.xml → components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_battery_script/artifact.xml
@ -0,0 +1,24 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!--
|
||||||
|
~ Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||||
|
~
|
||||||
|
~ WSO2 Inc. licenses this file to you under the Apache License,
|
||||||
|
~ Version 2.0 (the "License"); you may not use this file except
|
||||||
|
~ in compliance with the License.
|
||||||
|
~ You may obtain a copy of the License at
|
||||||
|
~
|
||||||
|
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
~
|
||||||
|
~ Unless required by applicable law or agreed to in writing,
|
||||||
|
~ software distributed under the License is distributed on an
|
||||||
|
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
~ KIND, either express or implied. See the License for the
|
||||||
|
~ specific language governing permissions and limitations
|
||||||
|
~ under the License.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<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>
|
||||||
|
</artifact>
|
||||||
|
|
@ -0,0 +1,106 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||||
|
<EventStoreConfiguration>
|
||||||
|
<TableSchema>
|
||||||
|
<ColumnDefinition>
|
||||||
|
<Name>meta_owner</Name>
|
||||||
|
<IsFacet>false</IsFacet>
|
||||||
|
<EnableIndexing>false</EnableIndexing>
|
||||||
|
<IsPrimaryKey>false</IsPrimaryKey>
|
||||||
|
<EnableScoreParam>false</EnableScoreParam>
|
||||||
|
<Type>STRING</Type>
|
||||||
|
</ColumnDefinition>
|
||||||
|
<ColumnDefinition>
|
||||||
|
<Name>meta_deviceId</Name>
|
||||||
|
<IsFacet>false</IsFacet>
|
||||||
|
<EnableIndexing>false</EnableIndexing>
|
||||||
|
<IsPrimaryKey>false</IsPrimaryKey>
|
||||||
|
<EnableScoreParam>false</EnableScoreParam>
|
||||||
|
<Type>STRING</Type>
|
||||||
|
</ColumnDefinition>
|
||||||
|
<ColumnDefinition>
|
||||||
|
<Name>meta_timestamp</Name>
|
||||||
|
<IsFacet>false</IsFacet>
|
||||||
|
<EnableIndexing>false</EnableIndexing>
|
||||||
|
<IsPrimaryKey>false</IsPrimaryKey>
|
||||||
|
<EnableScoreParam>false</EnableScoreParam>
|
||||||
|
<Type>LONG</Type>
|
||||||
|
</ColumnDefinition>
|
||||||
|
<ColumnDefinition>
|
||||||
|
<Name>level</Name>
|
||||||
|
<IsFacet>false</IsFacet>
|
||||||
|
<EnableIndexing>false</EnableIndexing>
|
||||||
|
<IsPrimaryKey>false</IsPrimaryKey>
|
||||||
|
<EnableScoreParam>false</EnableScoreParam>
|
||||||
|
<Type>INTEGER</Type>
|
||||||
|
</ColumnDefinition>
|
||||||
|
<ColumnDefinition>
|
||||||
|
<Name>state</Name>
|
||||||
|
<IsFacet>false</IsFacet>
|
||||||
|
<EnableIndexing>false</EnableIndexing>
|
||||||
|
<IsPrimaryKey>false</IsPrimaryKey>
|
||||||
|
<EnableScoreParam>false</EnableScoreParam>
|
||||||
|
<Type>STRING</Type>
|
||||||
|
</ColumnDefinition>
|
||||||
|
<ColumnDefinition>
|
||||||
|
<Name>status</Name>
|
||||||
|
<IsFacet>false</IsFacet>
|
||||||
|
<EnableIndexing>false</EnableIndexing>
|
||||||
|
<IsPrimaryKey>false</IsPrimaryKey>
|
||||||
|
<EnableScoreParam>false</EnableScoreParam>
|
||||||
|
<Type>LONG</Type>
|
||||||
|
</ColumnDefinition>
|
||||||
|
<ColumnDefinition>
|
||||||
|
<Name>temperature</Name>
|
||||||
|
<IsFacet>false</IsFacet>
|
||||||
|
<EnableIndexing>false</EnableIndexing>
|
||||||
|
<IsPrimaryKey>false</IsPrimaryKey>
|
||||||
|
<EnableScoreParam>false</EnableScoreParam>
|
||||||
|
<Type>INTEGER</Type>
|
||||||
|
</ColumnDefinition>
|
||||||
|
<ColumnDefinition>
|
||||||
|
<Name>year</Name>
|
||||||
|
<IsFacet>false</IsFacet>
|
||||||
|
<EnableIndexing>false</EnableIndexing>
|
||||||
|
<IsPrimaryKey>false</IsPrimaryKey>
|
||||||
|
<EnableScoreParam>false</EnableScoreParam>
|
||||||
|
<Type>INTEGER</Type>
|
||||||
|
</ColumnDefinition>
|
||||||
|
<ColumnDefinition>
|
||||||
|
<Name>month</Name>
|
||||||
|
<IsFacet>false</IsFacet>
|
||||||
|
<EnableIndexing>false</EnableIndexing>
|
||||||
|
<IsPrimaryKey>false</IsPrimaryKey>
|
||||||
|
<EnableScoreParam>false</EnableScoreParam>
|
||||||
|
<Type>INTEGER</Type>
|
||||||
|
</ColumnDefinition>
|
||||||
|
<ColumnDefinition>
|
||||||
|
<Name>day</Name>
|
||||||
|
<IsFacet>false</IsFacet>
|
||||||
|
<EnableIndexing>false</EnableIndexing>
|
||||||
|
<IsPrimaryKey>false</IsPrimaryKey>
|
||||||
|
<EnableScoreParam>false</EnableScoreParam>
|
||||||
|
<Type>INTEGER</Type>
|
||||||
|
</ColumnDefinition>
|
||||||
|
<ColumnDefinition>
|
||||||
|
<Name>hour</Name>
|
||||||
|
<IsFacet>false</IsFacet>
|
||||||
|
<EnableIndexing>false</EnableIndexing>
|
||||||
|
<IsPrimaryKey>false</IsPrimaryKey>
|
||||||
|
<EnableScoreParam>false</EnableScoreParam>
|
||||||
|
<Type>INTEGER</Type>
|
||||||
|
</ColumnDefinition>
|
||||||
|
<ColumnDefinition>
|
||||||
|
<Name>minute</Name>
|
||||||
|
<IsFacet>false</IsFacet>
|
||||||
|
<EnableIndexing>false</EnableIndexing>
|
||||||
|
<IsPrimaryKey>false</IsPrimaryKey>
|
||||||
|
<EnableScoreParam>false</EnableScoreParam>
|
||||||
|
<Type>INTEGER</Type>
|
||||||
|
</ColumnDefinition>
|
||||||
|
</TableSchema>
|
||||||
|
<Source>
|
||||||
|
<StreamId>org.wso2.iot.android.battery.stats:1.0.0</StreamId>
|
||||||
|
</Source>
|
||||||
|
<MergeSchema>false</MergeSchema>
|
||||||
|
<RecordStoreName>PROCESSED_DATA_STORE</RecordStoreName>
|
||||||
|
</EventStoreConfiguration>
|
@ -0,0 +1,23 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!--
|
||||||
|
~ Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||||
|
~
|
||||||
|
~ WSO2 Inc. licenses this file to you under the Apache License,
|
||||||
|
~ Version 2.0 (the "License"); you may not use this file except
|
||||||
|
~ in compliance with the License.
|
||||||
|
~ You may obtain a copy of the License at
|
||||||
|
~
|
||||||
|
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
~
|
||||||
|
~ Unless required by applicable law or agreed to in writing,
|
||||||
|
~ software distributed under the License is distributed on an
|
||||||
|
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
~ KIND, either express or implied. See the License for the
|
||||||
|
~ specific language governing permissions and limitations
|
||||||
|
~ under the License.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<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>
|
||||||
|
</artifact>
|
||||||
|
|
@ -0,0 +1,58 @@
|
|||||||
|
{
|
||||||
|
"name": "org.wso2.iot.android.battery.stats",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"nickName": "",
|
||||||
|
"description": "",
|
||||||
|
"metaData": [
|
||||||
|
{
|
||||||
|
"name": "owner",
|
||||||
|
"type": "STRING"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "deviceId",
|
||||||
|
"type": "STRING"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "timestamp",
|
||||||
|
"type": "LONG"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"payloadData": [
|
||||||
|
{
|
||||||
|
"name": "level",
|
||||||
|
"type": "INT"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "state",
|
||||||
|
"type": "STRING"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "status",
|
||||||
|
"type": "STRING"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "temperature",
|
||||||
|
"type": "INT"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "year",
|
||||||
|
"type": "INT"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "month",
|
||||||
|
"type": "INT"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "day",
|
||||||
|
"type": "INT"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "hour",
|
||||||
|
"type": "INT"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "minute",
|
||||||
|
"type": "INT"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@ -0,0 +1,24 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!--
|
||||||
|
~ Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
||||||
|
~
|
||||||
|
~ WSO2 Inc. licenses this file to you under the Apache License,
|
||||||
|
~ Version 2.0 (the "License"); you may not use this file except
|
||||||
|
~ in compliance with the License.
|
||||||
|
~ You may obtain a copy of the License at
|
||||||
|
~
|
||||||
|
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
~
|
||||||
|
~ Unless required by applicable law or agreed to in writing,
|
||||||
|
~ software distributed under the License is distributed on an
|
||||||
|
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
~ KIND, either express or implied. See the License for the
|
||||||
|
~ specific language governing permissions and limitations
|
||||||
|
~ under the License.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<artifact name= "android_battery_stats_ui_event_publisher" version="1.0.0" type="event/publisher"
|
||||||
|
serverRole="DataAnalyticsServer">
|
||||||
|
<file>org.wso2.iot.android.battery.stats.ui.publisher.xml</file>
|
||||||
|
</artifact>
|
||||||
|
|
@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<eventPublisher name="org.wso2.iot.android.battery.stats.ui.publisher"
|
||||||
|
processing="enable" statistics="disable" trace="disable" xmlns="http://wso2.org/carbon/eventpublisher">
|
||||||
|
<from streamName="org.wso2.iot.android.battery.stats" version="1.0.0"/>
|
||||||
|
<mapping customMapping="disable" type="wso2event"/>
|
||||||
|
<to eventAdapterType="ui"/>
|
||||||
|
</eventPublisher>
|
||||||
|
|
||||||
|
|
Loading…
Reference in new issue