Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Commit

Permalink
Merge pull request #20 from marcin-krolik/update/docs
Browse files Browse the repository at this point in the history
Updated documentation
  • Loading branch information
marcin-krolik authored Nov 18, 2016
2 parents e36de70 + 86fed52 commit ec04753
Showing 1 changed file with 67 additions and 19 deletions.
86 changes: 67 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# snap plugin processor - movingaverage
snap plugin intended to process data and return a moving average of the data
# Snap plugin processor - movingaverage
Snap plugin intended to process data and return a moving average of the data

1. [Getting Started](#getting-started)
* [System Requirements](#system-requirements)
Expand All @@ -18,7 +18,7 @@ snap plugin intended to process data and return a moving average of the data

### Installation
#### Download movingaverage plugin binary:
You can get the pre-built binaries for your OS and architecture at snap's [Github Releases](https://github.com/intelsdi-x/snap/releases) page.
You can get the pre-built binaries for your OS and architecture from the plugin's [GitHub Releases](https://github.com/intelsdi-x/snap-plugin-processor-movingaverage/releases) page. Download the plugin from the latest release and load it into `snapd` (`/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
Expand All @@ -31,17 +31,45 @@ Build the plugin by running make in repo:
```
$ make
```
This builds the plugin in `/build/rootfs`
This builds the plugin in `./build`

### Configuration and Usage
* Set up the [snap framework](https://github.com/intelsdi-x/snap/blob/master/README.md#getting-started)
* Ensure `$SNAP_PATH` is exported
`export SNAP_PATH=$GOPATH/src/github.com/intelsdi-x/snap/build`
* Set up the [Snap framework](https://github.com/intelsdi-x/snap#getting-started)

## Documentation
[Moving Average](https://en.wikipedia.org/wiki/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](https://github.com/intelsdi-x/snap-plugin-collector-psutil)

In one terminal window, open the Snap daemon :
```
$ snapd -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-*
$ snapctl plugin load snap-plugin-collector-psutil
$ snapctl plugin load snap-plugin-publisher-file
$ snapctl plugin load snap-plugin-processor-movingaverage
```

See available metrics for your system
```
$ snapctl metric list
```

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

```
{
"version": 1,
Expand All @@ -52,16 +80,12 @@ This builds the plugin in `/build/rootfs`
"workflow": {
"collect": {
"metrics": {
"/intel/mock/foo": {},
"/intel/mock/bar": {},
"/intel/mock/*/baz": {}
},
"config": {
"/intel/mock": {
"user": "root",
"password": "secret"
}
},
"/intel/psutil/load/load1": {},
"/intel/psutil/load/load5": {},
"/intel/psutil/load/load15": {},
"/intel/psutil/vm/free": {},
"/intel/psutil/vm/used": {}
},
"process": [
{
"plugin_name": "movingaverage",
Expand All @@ -85,21 +109,45 @@ This builds the plugin in `/build/rootfs`
}
```

Start task:
```
$ snapctl task create -t sample-psutil-movingavg-task.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 `snapctl task watch <task_id>` (CTRL+C to exit)
```
snapctl task watch 02dd7ff4-8106-47e9-8b86-70067cd0a850
```

This data is published to a file `/tmp/published` per task specification

Stop task:
```
$ snapctl 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](https://github.com/intelsdi-x/snap-plugin-processor-movingaverage/issues/new) and/or submit a [pull request](https://github.com/intelsdi-x/snap-plugin-processor-movingaverage/pulls).

## 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](https://github.com/intelsdi-x/snap#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](https://github.com/intelsdi-x/snap#community-support)

## 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](CONTRIBUTING.md).

## License
[snap](http://github.com:intelsdi-x/snap), along with this plugin, is an Open Source software released under the Apache 2.0 [License](LICENSE).
[Snap](http://github.com:intelsdi-x/snap), along with this plugin, is an Open Source software released under the Apache 2.0 [License](LICENSE).

## Acknowledgements

Expand Down

0 comments on commit ec04753

Please sign in to comment.