edgent-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dale LaBossiere (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (EDGENT-246) Aggregate Function and Console
Date Tue, 06 Sep 2016 17:52:20 GMT

    [ https://issues.apache.org/jira/browse/EDGENT-246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15467923#comment-15467923
] 

Dale LaBossiere edited comment on EDGENT-246 at 9/6/16 5:52 PM:
----------------------------------------------------------------

Please use the edgent developers list for general questions: dev@edgent.apache.org

Have you looked at the SensorsAggregates sample?  Use of the Edgent Console only requires
using the DevelopmentProvider.

Not sure why that use of aggregate() might cause a compile error - assuming you did the static
imports for MIN,...

[Edited, mispoke wrt the meaning of the 2nd and 3rd args]
Note JsonAggregates.aggregate() only aggregates a single property in a JsonObject tuple. 
Its 2nd arg is the name of the property to store the partition key for the aggregated tuples
in the returned stream, and the 3rd arg is the name of the property whose value to aggregate
in the input stream and the name of the property containing the aggregated results in the
output stream.  aggregate()'s javadoc has a clarifying example.

It seems you're trying to aggregate two properties: temp and voltage?



was (Author: dlaboss):
Please use the edgent developers list for general questions: dev@edgent.apache.org

Have you looked at the SensorsAggregates sample?  Use of the Edgent Console only requires
using the DevelopmentProvider.

Not sure why that use of aggregate() might cause a compile error - assuming you did the static
imports for MIN,...

Note JsonAggregates.aggregate() only aggregates a single property in a JsonObject tuple. 
Its 2nd and 3rd arguments are the property name to contain the aggregated **results** and
the name of the property to aggregate respectively.

It seems you're trying to aggregate two properties: temp and voltage?


> Aggregate Function and Console
> ------------------------------
>
>                 Key: EDGENT-246
>                 URL: https://issues.apache.org/jira/browse/EDGENT-246
>             Project: Edgent
>          Issue Type: Task
>          Components: Analytics
>    Affects Versions: 0.4.0
>         Environment: Demonstration (Meetup)
>            Reporter: Brandon Swink
>             Fix For: 0.4.0
>
>
> I would like to use this function in a demo for my meetup in the next few weeks and my
modification seems to have a compile error on the aggregate.  I would also like to couple
it with the Edgent Console.  Do I need to modify this code to include the console or do I
need to trigger using another component? 
> //*****CODE
>         // Create a window on the stream of the last 50 readings partitioned
>         //TWindow<JsonObject,JsonElement> sensorWindow = sensors.last(50, j ->
j.get("ts"));
>         TWindow<JsonObject,Integer> sensorWindow = sensors.last(50, unpartitioned());
>         
>         // Aggregate the windows calculating the min, max, mean standard deviation and
Slope across each window independently.
>        sensors = JsonAnalytics.aggregate(sensorWindow,"cpuTemperature","cpuVoltage",
MIN, MAX, MEAN, STDDEV, SLOPE);



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message