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

Commit

Permalink
Migrating movingaverage plugin from Pulse repo.
Browse files Browse the repository at this point in the history
  • Loading branch information
geauxvirtual committed Oct 9, 2015
1 parent dd43195 commit 1052134
Show file tree
Hide file tree
Showing 12 changed files with 733 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Compiled Object files, Static and Dynamic libs (Shared Objects)
*.o
*.a
*.so

# Folders
_obj
_test

# Architecture specific extensions/prefixes
*.[568vq]
[568vq].out

*.cgo1.go
*.cgo2.c
_cgo_defun.c
_cgo_gotypes.go
_cgo_export.*

_testmain.go

*.exe
*.test
.idea
tmp/
*.tmp
scratch/
build/
*.swp
profile.cov
gin-bin

# we don't vendor godep _workspace
**/Godeps/_workspace/**

# OSX stuff
.DS_Store
3 changes: 3 additions & 0 deletions .netrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
machine github.com
login intelsdibot
password 0f60cedb3c004ae0a79c24e6b30ce416ab4fcc49
27 changes: 27 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
sudo: required
services:
- docker
language: go
go:
- 1.4.2
- 1.5
before_install:
- cp .netrc ~
- chmod 600 .netrc
- go get github.com/tools/godep
- if [ ! -d $PULSE_PLUGIN_SOURCE ]; then mkdir -p $HOME/gopath/src/github.com/intelsdi-x; ln -s $TRAVIS_BUILD_DIR $PULSE_PLUGIN_SOURCE; fi # CI for forks not from intelsdi-x
env:
global:
- PULSE_PLUGIN_SOURCE=/home/travis/gopath/src/github.com/intelsdi-x/pulse-plugin-processor-movingaverage
matrix:
- TEST=unit
install:
- export TMPDIR=$HOME/tmp
- mkdir -p $TMPDIR
- cd $PULSE_PLUGIN_SOURCE # change dir into source
- make deps
script:
- make check TEST=$TEST 2>&1 # Run test suite
notifications:
slack:
secure: VkbZLIc2RH8yf3PtIAxUNPdAu3rQQ7yQx0GcK124JhbEnZGaHyK615V0rbG7HcVmYKGPdB0cXqZiLBDKGqGKb2zR1NepOe1nF03jxGSpPq8jIFeEXSJGEYGL34ScDzZZGuG6qwbjFcXiW5lqn6t8igzp7v2+URYBaZo5ktCS2xY=
25 changes: 25 additions & 0 deletions Godeps/Godeps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions Godeps/Readme

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
default:
$(MAKE) deps
$(MAKE) all
deps:
bash -c "godep restore"
test:
bash -c "./scripts/test.sh $(TEST)"
check:
$(MAKE) test
all:
bash -c "./scripts/build.sh $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))"
13 changes: 13 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package main

import (
"os"

"github.com/intelsdi-x/pulse/control/plugin"
"github.com/intelsdi-x/pulse/plugin/processor/pulse-processor-movingaverage/movingaverage"
)

func main() {
meta := movingaverage.Meta()
plugin.Start(meta, movingaverage.NewMovingaverageProcessor(), os.Args[1])
}
18 changes: 18 additions & 0 deletions main_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//
// +build unit

package main

import (
"os"
"testing"

. "github.com/smartystreets/goconvey/convey"
)

func TestMain(t *testing.T) {
Convey("ensure plugin loads and responds", t, func() {
os.Args = []string{"", "{\"NoDaemon\": true}"}
So(func() { main() }, ShouldNotPanic)
})
}
Loading

0 comments on commit 1052134

Please sign in to comment.