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 #31 from nanliu/pluginsync
Browse files Browse the repository at this point in the history
Update from Intelsdi-x pluginsync 0.1.6
  • Loading branch information
nanliu authored Sep 22, 2016
2 parents 68b1dc0 + 29ba80b commit 05d0f4a
Show file tree
Hide file tree
Showing 18 changed files with 597 additions and 222 deletions.
67 changes: 26 additions & 41 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,49 +1,34 @@
<!--- Verify first that your issue/request is not already reported in GitHub -->

##### ISSUE TYPE
<!--- Pick one below and delete the rest: -->
- Bug Report
- Feature Idea
- Documentation Report


##### SNAP VERSION
```
<!--- Paste verbatim output from “snapd --version” between quotes -->
```
##### SNAP PLUGIN VERSION
```
<!--- Paste verbatim output from “snapctl plugin list” between quotes -->
```

##### CONFIGURATION
<!---
Mention any settings you have changed/added/removed in task description or snapd configuration
-->
<!--
Thanks for filing an issue! Before hitting the button, give this a read.
##### OS / ENVIRONMENT
<!---
Mention the OS you are running snap / for plugin libvirt version
-->
If you are reporting a new issue, make sure that we do not have any duplicates already open. You can ensure this by searching the issue list for this repository. If there is a duplicate, please close your issue and add a comment to the existing issue instead.
##### SUMMARY
<!--- Explain the problem briefly -->
If you suspect your issue is a bug, please add as much context as you can using the template below. If it is not a bug, remove any sections you don't need and explain how we can help.
##### STEPS TO REPRODUCE
<!---
For bugs, show exactly how to reproduce the problem.
For new features, show how the feature would be used.
As a basic rule, if you cannot provide enough information to continue addressing the issue within 7 days, a maintainer will close it. We will, however, reopen it if you later provide the information. Thanks again.
-->

<!--- You can also paste gist.github.com links for larger files -->
**Snap version** (use `snapctl -v`):

**Environment**:
- **Cloud provider or hardware configuration**:
- **OS** (e.g. from /etc/os-release):
- **Kernel** (e.g. `uname -a`):
- **Relevant tools** (e.g. plugins used with Snap):
- **Others** (e.g. deploying with Ansible):


**What happened**:


**What you expected to happen**:


**Steps to reproduce it** (as minimally and precisely as possible):

##### EXPECTED RESULTS
<!--- What did you expect to happen when running the steps above? -->
1.
2.
3.

##### ACTUAL RESULTS
<!--- What actually happened? If possible run snapd with debug log -->

```
<!--- Paste verbatim command output between quotes -->
```
@intelsdi-x/plugin-maintainers
**Anything else do we need to know** (e.g. issue happens only occasionally):
21 changes: 21 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!--
If this is a bug fix, make sure your description includes "fixes #xxxx", or
"closes #xxxx"
Please provide the following information:
-->
Fixes #

Summary of changes:
-
-
-

How to verify it:
-

Testing done:
-

A picture of a snapping turtle (not required but encouraged):
-
22 changes: 13 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# File managed by pluginsync
#
# NOTE: please commit OS/Editor specific settings in your .gitignore_global
# .idea
# .DS_Store
#
# Compiled Object files, Static and Dynamic libs (Shared Objects)
*.o
*.a
Expand All @@ -21,17 +27,15 @@ _testmain.go

*.exe
*.test
.idea
tmp/
*.tmp
scratch/
build/
*.swp
*.prof

# Output of the go coverage tool
*.out
profile.cov
gin-bin

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

# OSX stuff
.DS_Store
# ignore build artifacts
build/
17 changes: 17 additions & 0 deletions .pluginsync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
pluginsync_config: '0.1.6'
managed_files:
- .github
- .github/ISSUE_TEMPLATE.md
- .github/PULL_REQUEST_TEMPLATE.md
- .gitignore
- .pluginsync.yml
- .travis.yml
- CONTRIBUTING.md
- LICENSE
- Makefile
- scripts
- scripts/build.sh
- scripts/common.sh
- scripts/deps.sh
- scripts/pre_deploy.sh
- scripts/test.sh
20 changes: 20 additions & 0 deletions .sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.travis.yml:
sudo: true
dist: trusty
addons:
apt:
packages:
- libvirt-bin
- libvirt-dev
deploy:
access_key_id: AKIAINMB43VSSPFZISAA
secret_access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X70vth/sAqEF+jU8DPv4xFt27zUbqbxJkJbbeeRQI9o424k88r8sjKTdVNOqHDguwCGRHds0BMK4gR0/Nm/EJudqfM13eiX6TtjAfCfwTgc6emhAdgB1D5CncjzOuI/9BrH/wd07+5Aojaist1V2OwA9rw3Bm2FoPZ4qo2+UvN9UZQtLYtH8IBuqucTTSh4RKVPPLZ03wjDg+QqVFZvbxbG4biXCFZPmT2R809EVUacTqNcCjZfwEQvpf9aLLRiALrdcKREPSZx2IylicLzXy02vQEGBZetLK9Cot6xfZaWzg+aCExE=
scripts/build.sh:
cgo_enabled: true
scripts/deps.sh:
packages:
- github.com/smartystreets/goconvey # NOTE: this should be moved to godep/glide
- github.com/stretchr/testify/mock
76 changes: 63 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,75 @@
sudo: required
language: go
# File managed by pluginsync
sudo: true
dist: trusty
language: go
go:
- 1.7
- 1.6.3
- 1.7.1
addons:
apt:
packages:
- libvirt-bin
- libvirt-dev
env:
global:
- SNAP_PLUGIN_SOURCE=/home/travis/gopath/src/github.com/intelsdi-x/snap-plugin-collector-libvirt
- ORG_PATH=/home/travis/gopath/src/github.com/intelsdi-x
- SNAP_PLUGIN_SOURCE=/home/travis/gopath/src/github.com/${TRAVIS_REPO_SLUG}
matrix:
- TEST=unit
- TEST_TYPE=small
- TEST_TYPE=build
matrix:
exclude:
- go: 1.6.3
env: TEST_TYPE=build
before_install:
- sudo apt-get update -y
- sudo apt-get install libvirt-bin libvirt-dev -y
- go get github.com/tools/godep
- if [ ! -d $SNAP_PLUGIN_SOURCE ]; then mkdir -p $HOME/gopath/src/github.com/intelsdi-x; ln -s $TRAVIS_BUILD_DIR $SNAP_PLUGIN_SOURCE; fi # CI for forks not from intelsdi-x
- "[[ -d $SNAP_PLUGIN_SOURCE ]] || mkdir -p $ORG_PATH && ln -s $TRAVIS_BUILD_DIR $SNAP_PLUGIN_SOURCE"
install:
- export TMPDIR=$HOME/tmp
- mkdir -p $TMPDIR
- cd $SNAP_PLUGIN_SOURCE # change dir into source
- cd $SNAP_PLUGIN_SOURCE
- make deps
script:
- make check TEST=$TEST 2>&1 # Run test suite
- make check 2>&1
notifications:
email: false
slack:
secure: VkbZLIc2RH8yf3PtIAxUNPdAu3rQQ7yQx0GcK124JhbEnZGaHyK615V0rbG7HcVmYKGPdB0cXqZiLBDKGqGKb2zR1NepOe1nF03jxGSpPq8jIFeEXSJGEYGL34ScDzZZGuG6qwbjFcXiW5lqn6t8igzp7v2+URYBaZo5ktCS2xY=
before_deploy:
- "./scripts/pre_deploy.sh"
deploy:
- provider: s3
access_key_id: AKIAINMB43VSSPFZISAA
secret_access_key:
secure: RJR915t6OO3m/Gk1eMok3nB2J4xsNohNQxNc3sOGJ6KtcEn0MdRxzhXSklcMaA5U6RfQzQ6X58PKmj2rKenYK9yrboM3Ms7O+9wIpxgS/tLVrow/oCeHFjbgSuNZUgJoL2LX9FjtnlBXvV6RDnBJC2XXkzEgjsyRioFN+sk0jaDUAepZPKqKHTPXH/OVXUwPRwaBcL3824wejocEMVemfLP92fpbNXd1Hiq6y3R8E8js6r1gTqKpdjoPgCkIw1EYgo+bAPGQQFx1M+0OMKHMexeTWcXBO4hrZ1LuDrqA4suaT42ikelwdNgWxgUc2kgIJx42DTW+4JwPxr9wfWy+Ozgyy8o0vy0tdQWSXtY4atSAO613pNM3hciRi4CCte6J7QFzzrUzyijK4vvis3ZFIMessFoU4tb78//JomJ3G/Tu8XVpjhJoE1HmlEngyTCgO7mswQcTEuArOg17sLY1T7xPY9rwB4SVrhLfeymDL7saJclN65qcUresHBxQOXQaKPfR7g3YpKd0SjNflZAYBxnBsYwHPjmaaWxHBpiZSJ3e/4fOW/I9KpUi8ByesDFOTyJKyZdatX4A8HfWHwc0Eu3Ce9Wk7GQqshA1scZA/vywcTpEaYQD8jnW4mfqHnT6kQAzUntqzBtRMyxsFJ5ZkeSDliNXidVqWJvXGUk7Ygk=
bucket: snap.ci.snap-telemetry.io
region: us-west-2
skip_cleanup: true
local-dir: s3
upload-dir: plugins
acl: public_read
on:
repo: intelsdi-x/snap-plugin-collector-libvirt
branch: master
condition: $TEST_TYPE = "build" && $TRAVIS_GO_VERSION = "1.7.1"
- provider: s3
access_key_id: AKIAINMB43VSSPFZISAA
secret_access_key:
secure: RJR915t6OO3m/Gk1eMok3nB2J4xsNohNQxNc3sOGJ6KtcEn0MdRxzhXSklcMaA5U6RfQzQ6X58PKmj2rKenYK9yrboM3Ms7O+9wIpxgS/tLVrow/oCeHFjbgSuNZUgJoL2LX9FjtnlBXvV6RDnBJC2XXkzEgjsyRioFN+sk0jaDUAepZPKqKHTPXH/OVXUwPRwaBcL3824wejocEMVemfLP92fpbNXd1Hiq6y3R8E8js6r1gTqKpdjoPgCkIw1EYgo+bAPGQQFx1M+0OMKHMexeTWcXBO4hrZ1LuDrqA4suaT42ikelwdNgWxgUc2kgIJx42DTW+4JwPxr9wfWy+Ozgyy8o0vy0tdQWSXtY4atSAO613pNM3hciRi4CCte6J7QFzzrUzyijK4vvis3ZFIMessFoU4tb78//JomJ3G/Tu8XVpjhJoE1HmlEngyTCgO7mswQcTEuArOg17sLY1T7xPY9rwB4SVrhLfeymDL7saJclN65qcUresHBxQOXQaKPfR7g3YpKd0SjNflZAYBxnBsYwHPjmaaWxHBpiZSJ3e/4fOW/I9KpUi8ByesDFOTyJKyZdatX4A8HfWHwc0Eu3Ce9Wk7GQqshA1scZA/vywcTpEaYQD8jnW4mfqHnT6kQAzUntqzBtRMyxsFJ5ZkeSDliNXidVqWJvXGUk7Ygk=
bucket: snap.ci.snap-telemetry.io
region: us-west-2
skip_cleanup: true
local-dir: s3
upload-dir: plugins
acl: public_read
on:
repo: intelsdi-x/snap-plugin-collector-libvirt
tags: true
condition: $TEST_TYPE = "build" && $TRAVIS_GO_VERSION = "1.7.1"
- provider: releases
api_key:
secure: EkgF7P/f0/OIfaw3XvA7I1nEuA8/ia/Tm0Yy+NYZQaioGIsGRxhCJ4OLJutwHOMxWZj6A4Yz9gvpcMh3lI6i0ZOxb2eFFU4MbNhAPm8qPjSD4sWmxt5DFojx5t53cvcb8WvE72LooceY9P1k58DsonMhB5Nz+DYR+ubZUD6tdYEE9UKEqepR9GCAEg6OZ773kRdmCXMz0jXxsZ7ki8eiQ5HqdFQq/3yPxA+hbn5NWaurcvdMiBAq6mCJVgoVeLWMmIQCvMEA33VING5h/kIfelpFEYX+kBEOzIk2S61YBSpu3DGLRBfock3A3wOGEAgXrpfSH220djqaO99P9ck7vh08Zxfc/PhIuCgRpVff7Ss+T/3DuG1aXGqzX70vth/sAqEF+jU8DPv4xFt27zUbqbxJkJbbeeRQI9o424k88r8sjKTdVNOqHDguwCGRHds0BMK4gR0/Nm/EJudqfM13eiX6TtjAfCfwTgc6emhAdgB1D5CncjzOuI/9BrH/wd07+5Aojaist1V2OwA9rw3Bm2FoPZ4qo2+UvN9UZQtLYtH8IBuqucTTSh4RKVPPLZ03wjDg+QqVFZvbxbG4biXCFZPmT2R809EVUacTqNcCjZfwEQvpf9aLLRiALrdcKREPSZx2IylicLzXy02vQEGBZetLK9Cot6xfZaWzg+aCExE=
file:
- release/snap-plugin-collector-libvirt_linux_x86_64
skip_cleanup: true
on:
repo: intelsdi-x/snap-plugin-collector-libvirt
tags: true
condition: $TEST_TYPE = "build" && $TRAVIS_GO_VERSION = "1.7.1"
47 changes: 24 additions & 23 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,46 @@
# snap collector plugin - libvirt
# snap plugin collector libvirt

1. [Contributing Code](#contributing-code)
2. [Contributing Examples](#contributing-examples)
3. [Contribute Elsewhere](#contribute-elsewhere)
4. [Thank You](#thank-you)


This repository has dedicated developers from Intel working on updates. The most helpful way to contribute is by reporting your experience through issues. Issues may not be updated while we review internally, but they're still incredibly appreciated.

## Contributing Code
**_IMPORTANT_**: We encourage contributions to the project from the community. We ask that you keep the following guidelines in mind when planning your contribution.

Whether your contribution is for a bug fix or a feature request, **create an [Issue](https://github.com/intelsdi-x/snap-plugin-collector-libvirt/issues)** and let us know what you are thinking

* **For feature requests**, we want to improve upon the library incrementally which means small changes at a time. In order ensure your PR can be reviewed in a timely manner, please keep PRs small, e.g. <10 files and <500 lines changed. If you think this is unrealistic, then mention that within the issue and we can discuss it
* Whether your contribution is for a bug fix or a feature request, **create an [Issue](https://github.com/intelsdi-x/snap-plugin-collector-libvirt/issues)** and let us know what you are thinking.
* **For bugs**, if you have already found a fix, feel free to submit a Pull Request referencing the Issue you created. Include the `Fixes #` syntax to link it to the issue you're addressing.
* **For feature requests**, we want to improve upon the library incrementally which means small changes at a time. In order to ensure your PR can be reviewed in a timely manner, please keep PRs small, e.g. <10 files and <500 lines changed. If you think this is unrealistic, then mention that within the issue and we can discuss it.

Once you're ready to contribute code back to this repo, start with these steps:

* Fork the appropriate sub-projects that are affected by your change
* Clone the fork to `$GOPATH/src/github.com/intelsdi-x/`
```
$ git clone https://github.com/<yourGithubID>/snap-plugin-collector-libvirt.git
```
* Create a topic branch for your change and checkout that branch
```
$ git checkout -b some-topic-branch
```
* Make your changes and run the test suite if one is provided (see below)
* Commit your changes and push them to your fork
* Open a pull request for the appropriate project
* Contributors will review your pull request, suggest changes, and merge it when it’s ready and/or offer feedback
* To report a bug or issue, please open a new issue against this repository

If you have questions feel free to contact the [maintainers](README.md#maintainers).
* Fork the appropriate sub-projects that are affected by your change.
* Clone the fork to `$GOPATH/src/github.com/intelsdi-x/`:

```
$ git clone https://github.com/<yourGithubID>/<project>.git
```
* Create a topic branch for your change and checkout that branch:
```
$ git checkout -b some-topic-branch
```
* Make your changes and run the test suite if one is provided.
* Commit your changes and push them to your fork.
* Open a pull request for the appropriate project.
* Contributors will review your pull request, suggest changes, and merge it when it’s ready and/or offer feedback.
If you have questions feel free to contact the [maintainers](https://github.com/intelsdi-x/snap/blob/master/README.md#maintainers) by tagging them: @intelsdi-x/plugin-maintainers.
## Contributing Examples
The most immediately helpful way you can benefit this project is by cloning the repository, adding some further examples and submitting a pull request.
Have you written a blog post about how you use [snap](http://github.com/intelsdi-x/snap) and/or this plugin? Send it to us!
Have you written a blog post about how you use [Snap](http://github.com/intelsdi-x/snap) and/or this plugin? Send it to us [on Slack](http://slack.snap-telemetry.io)!
## Contribute Elsewhere
This repository is one of **many** plugins in **snap**, a powerful telemetry framework. See the full project at http://github.com/intelsdi-x/snap
This repository is one of **many** plugins in **Snap**, a powerful telemetry framework. See the full project at http://snap-telemetry.io
## Thank You
And **thank you!** Your contribution, through code and participation, is incredibly important to us.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -199,4 +199,4 @@
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
35 changes: 22 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,27 +1,36 @@
#http://www.apache.org/licenses/LICENSE-2.0.txt
# File managed by pluginsync
# http://www.apache.org/licenses/LICENSE-2.0.txt
#
#
#Copyright 2015 Intel Corporation
# Copyright 2015 Intel Corporation
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, software
#distributed under the License is distributed on an "AS IS" BASIS,
#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#See the License for the specific language governing permissions and
#limitations under the License.
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

default:
$(MAKE) deps
$(MAKE) all
deps:
bash -c "godep restore"
bash -c "./scripts/deps.sh"
test:
bash -c "./scripts/test.sh $(TEST)"
bash -c "./scripts/test.sh $(TEST_TYPE)"
test-legacy:
bash -c "./scripts/test.sh legacy"
test-small:
bash -c "./scripts/test.sh small"
test-medium:
bash -c "./scripts/test.sh medium"
test-large:
bash -c "./scripts/test.sh large"
check:
$(MAKE) test
all:
Expand Down
2 changes: 1 addition & 1 deletion libvirt/cpu_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// +build unit
// +build small

/*
http://www.apache.org/licenses/LICENSE-2.0.txt
Expand Down
Loading

0 comments on commit 05d0f4a

Please sign in to comment.