aggregate

package
v0.5.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 26, 2018 License: BSD-3-Clause Imports: 6 Imported by: 0

README


title: Aggregate weight: 4603

Aggregate

This activity allows you to aggregate data and calculate an average or sliding average.

Installation

Flogo Web

This activity comes out of the box with the Flogo Web UI

Flogo CLI

flogo install github.com/TIBCOSoftware/flogo-contrib/activity/aggregate

Schema

Inputs and Outputs:

{
  "input":[
    {
      "name": "function",
      "type": "string",
      "required": true,
      "allowed" : ["block_avg", "moving_avg", "timeblockavg"]
    },
    {
      "name": "windowSize",
      "type": "integer",
      "required": true
    },
    {
      "name": "value",
      "type": "number"
    }
  ],
  "output": [
    {
      "name": "result",
      "type": "number"
    },
    {
      "name": "report",
      "type": "boolean"
    }
  ]
}

Settings

Setting Required Description
function True The aggregate fuction, currently only average is supported
windowSize True The window size of the values to aggregate
value False The value to aggregate

Example

The below example aggregates a 'temperature' attribute with a moving window of size 5:

"id": "aggregate_4",
"name": "Aggregate",
"description": "Simple Aggregator Activity",
"activity": {
  "ref": "github.com/TIBCOSoftware/flogo-contrib/activity/aggregate",
  "input": {
    "function": "average",
    "windowSize": "5"
  },
  "mappings": {
    "input": [
      {
        "type": "assign",
        "value": "temperature",
        "mapTo": "value"
      }
    ]
  }

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewActivity

func NewActivity(metadata *activity.Metadata) activity.Activity

NewActivity creates a new AppActivity

Types

type AggregateActivity

type AggregateActivity struct {
	// contains filtered or unexported fields
}

AggregateActivity is an Activity that is used to Aggregate a message to the console inputs : {function, windowSize, autoRest, value} outputs: {result, report}

func (*AggregateActivity) Eval

func (a *AggregateActivity) Eval(context activity.Context) (done bool, err error)

Eval implements api.Activity.Eval - Aggregates the Message

func (*AggregateActivity) Metadata

func (a *AggregateActivity) Metadata() *activity.Metadata

Metadata returns the activity's metadata

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL