Git Product home page Git Product logo

snap-plugin-processor-movingaverage's Introduction

DISCONTINUATION OF PROJECT.

This project will no longer be maintained by Intel.

This project has been identified as having known security escapes.

Intel has ceased development and contributions including, but not limited to, maintenance, bug fixes, new releases, or updates, to this project.

Intel no longer accepts patches to this project.

DISCONTINUATION OF PROJECT

This project will no longer be maintained by Intel. Intel will not provide or guarantee development of or support for this project, including but not limited to, maintenance, bug fixes, new releases or updates. Patches to this project are no longer accepted by Intel. If you have an ongoing need to use this project, are interested in independently developing it, or would like to maintain patches for the community, please create your own fork of the project.

Snap plugin processor - movingaverage

Snap plugin intended to process data and return a moving average of the data

  1. Getting Started
  1. Documentation
  1. Community Support
  2. Contributing
  3. License
  4. Acknowledgements

System Requirements

  • Plugin supports only Linux systems

Installation

Download movingaverage plugin binary:

You can get the pre-built binaries for your OS and architecture from the plugin's GitHub Releases page. Download the plugin from the latest release and load it into snapteld (/opt/snap/plugins is the default location for Snap packages).

To build the plugin binary:

Fork https://github.com/intelsdi-x/snap-plugin-processor-movingaverage

Clone repo into $GOPATH/src/github/intelsdi-x/:

$ git clone https://github.com/<yourGithubID>/snap-plugin-processor-movingaverage

Build the plugin by running make in repo:

$ make

This builds the plugin in ./build

Configuration and Usage

Documentation

Moving Average

Examples

Example running psutil plugin, movingaverage processor, and writing data into a file.

Documentation for Snap collector psutil plugin can be found here

In one terminal window, open the Snap daemon :

$ snapteld -t 0 -l 1

The option "-l 1" it is for setting the debugging log level and "-t 0" is for disabling plugin signing.

In another terminal window:

Download and load collector, processor and publisher plugins

$ wget http://snap.ci.snap-telemetry.io/plugins/snap-plugin-collector-psutil/latest/linux/x86_64/snap-plugin-collector-psutil
$ wget http://snap.ci.snap-telemetry.io/plugins/snap-plugin-processor-movingaverage/latest/linux/x86_64/snap-plugin-processor-movingaverage
$ wget http://snap.ci.snap-telemetry.io/plugins/snap-plugin-publisher-file/latest/linux/x86_64/snap-plugin-publisher-file
$ chmod 755 snap-plugin-*
$ snaptel plugin load snap-plugin-collector-psutil
$ snaptel plugin load snap-plugin-publisher-file
$ snaptel plugin load snap-plugin-processor-movingaverage

See available metrics for your system

$ snaptel metric list

Create a task file. For example, psutil-movingaverage-file.json:

{
  "version": 1,
  "schedule": {
    "type": "simple",
    "interval": "1s"
  },
  "workflow": {
    "collect": {
      "metrics": {
        "/intel/psutil/load/load1": {},
        "/intel/psutil/load/load5": {},
        "/intel/psutil/load/load15": {},
        "/intel/psutil/vm/free": {},
        "/intel/psutil/vm/used": {}
      },
      "process": [
        {
          "plugin_name": "movingaverage",
          "config": {
            "MovingAvgBufLength": 5
          },
          "process": null,
          "publish": [
            {
              "plugin_name": "file",
              "config": {
                "file": "/tmp/published_movingaverage.log"
              }
            }
          ]
        }
      ]
    }
  }
}

Start task:

$ snaptel task create -t psutil-movingaverage-file.json
Using task manifest to create task
Task created
ID: 02dd7ff4-8106-47e9-8b86-70067cd0a850
Name: Task-02dd7ff4-8106-47e9-8b86-70067cd0a850
State: Running

See realtime output from snaptel task watch <task_id> (CTRL+C to exit)

snaptel task watch 02dd7ff4-8106-47e9-8b86-70067cd0a850

This data is published to a file /tmp/published_movingaverage.log per task specification

Stop task:

$ snaptel task stop 02dd7ff4-8106-47e9-8b86-70067cd0a850
Task stopped:
ID: 02dd7ff4-8106-47e9-8b86-70067cd0a850

Roadmap

There isn't a current roadmap for this plugin, but it is in active development. As we launch this plugin, we do not have any outstanding requirements for the next release.

If you have a feature request, please add it as an issue and/or submit a pull request.

Community Support

This repository is one of many plugins in Snap, a powerful telemetry framework. See the full project at http://github.com/intelsdi-x/snap To reach out to other users, head to the main framework

Contributing

We love contributions!

There's more than one way to give back, from examples to blogs to code updates. See our recommended process in CONTRIBUTING.md.

License

Snap, along with this plugin, is an Open Source software released under the Apache 2.0 License.

Acknowledgements

And thank you! Your contribution, through code and participation, is incredibly important to us.

snap-plugin-processor-movingaverage's People

Contributors

andrzej-k avatar candysmurf avatar geauxvirtual avatar ircody avatar katarzyna-z avatar kdembler avatar kindermoumoute avatar marcin-krolik avatar nanliu avatar nguyenddn avatar patrykmatyjasek avatar rashmigottipati avatar rdower avatar taotod avatar tiffanyfay avatar zhengqingyuan avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

snap-plugin-processor-movingaverage's Issues

Not able to use movingaverage processor

when using "movingaverage" plugin, the following error occurred.

From Shirley Avishour

ERRO[2016-08-29T09:45:01+03:00] error with processor job                      _module=scheduler-job block=run content-type=snap.gob error=unexpected EOF job-type=processor plugin-config=map[MovingAvgBufLength:{Value:5}] plugin-name=movingaverage plugin-version=-1
...
experiencing the following error for moving average: ERRO[2016-08-29T08:45:58+03:00] error with processor job                      _module=scheduler-job block=run content-type=snap.gob error=could not select a plugin job-type=processor plugin-config=map[MovingAvgBufLength:{Value:5}] plugin-name=movingaverage plugin-version=-1

I tried it myself. I got the following:

>>>2016/08/29 10:36:02 Heartbeat timeout reset
>>>2016/08/29 10:36:02 Ping received
>>>2016/08/29 10:36:03 Recover from panic: runtime error: index out of range
>>>2016/08/29 10:36:03 Stack of 4096 bytes: goroutine 41 [running]:
github.com/intelsdi-x/snap/control/plugin.catchPluginPanic(0x8208343c0)
        /Users/egu/.gvm/pkgsets/go1.6.2/snap-2016-06/src/github.com/intelsdi-x/snap/control/plugin/plugin.go:436 +0xa9
panic(0x47ae60, 0x8208360b0)
        /Users/egu/.gvm/gos/go1.6.2/src/runtime/panic.go:443 +0x4e9
github.com/intelsdi-x/snap-plugin-processor-movingaverage/movingaverage.(*movingAverageProcessor).calculateMovingAverage(0x820836560, 0x820b9fe00, 0x4, 0x4, 0xecf566983, 0x1607a7f5, 0x780220, 0x2, 0x0, 0x3b3de0, ...)
        /Users/egu/.gvm/pkgsets/go1.6.2/snap-2016-06/src/github.com/intelsdi-x/snap-plugin-processor-movingaverage/movingaverage/movingaverage.go:143 +0x6e9b
github.com/intelsdi-x/snap-plugin-processor-movingaverage/movingaverage.(*movingAverageProcessor).Process(0x820836560, 0x820c722d8, 0x8, 0x820c78000, 0x8e6, 0x8e6, 0x820c47890, 0x0, 0x0, 0x0, ...)
        /Users/egu/.gvm/pkgsets/go1.6.2/snap-2016-06/src/github.com/intelsdi-x/snap-plugin-processor-movingaverage/movingaverage/movingaverage.go:317 +0xc03
github.com/intelsdi-x/snap/control/plugin.(*processorPluginProxy).Process(0x820ac4820, 0x820c55400, 0x9ba, 0x9ba, 0x820c4d980, 0x0, 0x0)
        /Users/egu/.gvm/pkgsets/go1.6.2/snap-2016-06/src/github.com/intelsdi-x/snap/control/plugin/processor_proxy.go:57 +0x251
reflect.Value.call(0x43ef40, 0x458f78, 0x13, 0x50f750, 0x4, 0x820bafed8, 0x3, 0x3, 0x0, 0x0, ...)
        /Users/egu/.gvm/gos/go1.6.2/src/reflect/value.go:435 +0x120d
reflect.Value.Call(0x43ef40, 0x458f78, 0x13, 0x820bafed8, 0x3, 0x3, 0x0, 0x0, 0x0)
        /Users/egu/.gvm/gos/go1.6.2/src/reflect/value.go:303 +0xb1
net/rpc.(*service).call(0x820ac6340, 0x820832300, 0x820af2020, 0x820ab4c00, 0x820ad66c0, 0x3a6c00, 0x820c4d940, 0x197, 0x38f680, 0x820c4d980, ...)
        /Users/egu/.gvm/gos/go1.6.2/src/net/rpc/server.go:383 +0x1c2
created by net/rpc.(*Server).ServeCodec
        /Users/egu/.gvm/gos/go1.6.2/src/net/rpc/server.go:477 +0x49d

goroutine 1 [chan receive]:
github.com/intelsdi-x/snap/control/plugin.Start(0x820842300, 0x8820876100, 0x820836560, 0x7fff5fbff33f, 0x72, 0x0, 0x0, 0x820836260)
        /Users/egu/.gvm/pkgsets/go1.6.2/snap-2016-06/src/github.com/intelsdi-x/snap/control/plugin/plugin.go:388 +0xa73
main.main()
        /Users/egu/.gvm/pkgsets/go1.6.2/snap-2016-06/src/github.com/intelsdi-x/snap-plugin-processor-movingaverage/main.go:30 +0xfd

goroutine 3 [IO wait]:
net.runtime_pollWait(0x882087b400, 0x72, 0x88208b6028)
        /Users/egu/.gvm/gos/go1.6.2/src/runtime/netpoll.go:160 +0x60
net.(*pollDesc).Wait(0x820ab8d80, 0x72, 0x0, 0x0)
        /Users/egu/.gvm/gos/go1.6.2/src/net/fd_poll_runtime.go:73 +0x3a
net.(*pollDesc).WaitRead(0x820ab8d80, 0x0, 0x0)
        /Users/egu/.gvm/gos/go1.6.2/src/net/fd_poll_runtime.go:78 +0x36
net.(*netFD).accept(0x820ab8d20, 0x0, 0x8820a56000, 0x820ad6060)
        /Users/egu/.gvm/gos/go1.6.2/src/net/fd_unix.go:426 +0x27c
net.(*TCPListener).AcceptTCP(0x820856068, 0x82084f770, 0x0, 0x0)
        /Users/egu/.gvm/gos/go1.6.2/src/net/tcpsock_posix.go:254 +0x4d
net.(*TCPListener).Accept(0x820856068, 0x0, 0x0, 0x0, 0x0)
        /Users/egu/.gvm/gos/go1.6.2/src/net/tcpsock_posix.go:264 +0x3d
github.com/intelsdi-x/snap/control/plugin.Start.func2(0x882087a458, 0x820856068)
        /Users/egu/.gvm/pkgsets/go1.6.2/snap-2016-06/src/github.com/intelsdi-x/snap/control/plugin/plugin.go:370 +0x2b
created by github.com/intelsdi-x/snap/control/plugin.Start
        /Users/egu/.gvm/pkgsets/go1.6.2/snap-2016-06/src/github.com/intelsdi-x/snap/control/plugin/plugin.go:376 +0x8ae

goroutine 4 [sleep]:
time.Sleep(0x59682f00)
        /Users/egu/.gvm/gos/go1.6.2/src/runtime/time.go:59 +0xf9
github.com/intelsdi-x/snap/control/plugin.(*SessionState).heartbeatWatch(0x8208442d0, 0x8208402a0)
        /Users/egu/.gvm/pkgsets/go1.6.2/snap-2016-06/src/github.com/intelsdi-x/snap/control/plugin/session.go:219 +0x4dd
created by github.com/intelsdi-x/snap/control/plugin.Start
        /Users/egu/.gvm/pkgsets/go1.6.2/snap-2016-06/src/github.com/intelsdi-x/snap/control/plugin/plugin.go:385 +0xa2b

goroutine 33 [IO wait]:
net.runtime_pollWait(0x882087b340, 0x72, 0x820aed000)
        /Users/egu/.gvm/gos/go1.6.2/src/runtime/netpoll.go:160 +0x60
net.(*pollDesc).Wait(0x820adc060, 0x72, 0x0, 0x0)
        /Users/egu

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.