Sign inSign up

beetaone/fluctuation-filter

By beetaone

Updated almost 2 years ago

Image
0

155

beetaone/fluctuation-filter repository overview

Fluctuation Filter Module

nameFluctuation Filter
versionv1.0.1
GitHubbeetaone/fluctuation-filter
authorsMithila Ghuge, Paul Gaiduk

Table of Content


Description

This is a Python Fluctuation Filter module and it is used to eliminate unwanted spikes from input data and provide stable output. It will delay the change of the value filtering out specific amount (instances) of different, non-persisting value.

Module Variables

There are 5 module variables that are required by each module to correctly function within beetaone ecosystem. In development, these variables can overridden for testing purposes. In production, these variables are set by beetaone Agent.

Environment VariablestypeDescription
INPUT_LABELstringThe input label on which anomaly is detected
WINDOW_SIZEintegerThe stable instance count which need to be consider
SEND_ON_CHANGEbooleanSet true to Output data only when stable value changes
MODULE_NAMEstringName of the module
MODULE_TYPEstringType of the module (Input, Processing, Output)
LOG_LEVELstringAllowed log levels: DEBUG, INFO, WARNING, ERROR, CRITICAL. Refer to logging package documentation.
INGRESS_HOSTstringHost to which data will be received
INGRESS_PORTstringPort to which data will be received
EGRESS_URLSstringHTTP ReST endpoint for the next module

Module Testing

To test module navigate to test directory. In test/assets edit both .json file to provide input for the module and expected output. During a test, data received from the listeners are compared against expected output data. You can run tests with make run_test.

Dependencies

The following are module dependencies:

  • bottle
  • requests

The following are developer dependencies:

  • pytest
  • flake8
  • black

Input

Input to this module is JSON body single object or array of objects:

Example:

{
  "temperature": 15
}
[
  {
    "temperature": 15
  },
  {
    "temperature": 21
  },
  {
    "temperature": 25
  }
]

Output

Output of this module is JSON body:

{
    "<INPUT_LABEL>": <Processed data>,
    "<MODULE_NAME>Time": timestamp
}
Example
Input data : (23,23,24,24,24,22,21,21,21,23,24,25,25,25)
Window_Size : 3
Assume previous_stable_value = x

If Send_on_change == True then 
Expected Output : (24,21,25)

If Send_on_change == False then
Expected Output :(x,x,x,x,24,24,24,24,21,21,21,21,21,25)

Tag summary

Content type

Image

Digest

sha256:a01d9ebe1

Size

49.1 MB

Last updated

almost 2 years ago

docker pull beetaone/fluctuation-filter:v1.0.1