Giter VIP home page Giter VIP logo

smart-gateway's Introduction

smart-gateway build status Go Report Card Coverage Status Docker Repository on Quay

Smart gateway for service assurance. Includes applications for both metrics and events gathering.

Provides middleware that connects to an AMQP 1.0 message bus, pulling data off the bus and exposing it as a scrape target for Prometheus. Metrics are provided via the OPNFV Barometer project (collectd). Events are provided by the various event plugins for collectd, including connectivity, procevent and sysevent.

Dependencies

Dependencies are managed using dep. Clone this project, then obtain the dependencies with the following commands. Example below is built on CentOS 7.

go get -u github.com/redhat-service-assurance/smart-gateway
go get -u github.com/golang/dep/...
yum install -y epel-release
yum install -y golang qpid-proton-c-devel iproute
cd $GOPATH/src/github.com/redhat-service-assurance/smart-gateway
dep ensure -v -vendor-only

Building Smart Gateway

Building with Golang

Build the smart_gateway with Golang using the following command.

cd $GOPATH/src/github.com/redhat-service-assurance/smart-gateway
go build -o smart_gateway cmd/main.go

Building with Docker

Building the smart-gateway with docker using the following commands.

git clone --depth=1 --branch=master https://github.com/redhat-service-assurance/smart-gateway.git smart-gateway; rm -rf ./smart-gateway/.git
cd smart-gateway
sudo docker build -t smart-gateway --file=build/Dockerfile .

Testing

The Smart Gateway ships with various unit tests located in the tests/ directory. To execute these unit tests, run the following command from the top-level directory.

go test -v ./...

A note about test layout in Smart Gateway

Generally tests are shipped in Golang directly within the packages as <implementation>_test.go, for example, alerts.go will have a corresponding alerts_test.go within the alerts package.

In the Smart Gateway, we've purposely taken a separate approach by moving the tests into their own package, located within the tests/ subdirectory. The reason for this is two-fold:

  1. It is the recommended workaround for avoiding falling into cyclic dependencies / ciclical import problems.
  2. Test implementer loses access to private logic, so has to think about the tested API more in depth. Also when the test of package A breaks, we can be sure that other packages are broken too. On the other side, when you have access to private logic, you can unintentionally workaround issues and hit the bugs in production deployments.

smart-gateway's People

Contributors

aneeshkp avatar atyronesmith avatar csibbitt avatar leifmadsen avatar mrunge avatar paramite avatar pleimer avatar

Watchers

 avatar

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.