Giter VIP home page Giter VIP logo

archived-sloc_report's Introduction

Service Level Objectives Compliance Report

Build Status

Report on Service Level Objectives Compliance

Overview

You have a few dashboards in Librato that describe your Service Level Objectives. You want a report on SLO breaches over the past day/week.

Running

API

api = sloc_librato.LibratoApi(email=LIBRATO_EMAIL, token=LIBRATO_TOKEN)
charts = [{'threshold': 100, 'chart_name': 'Website Response Time Mean'}]
report.daily_report(api, 'SLO - Production Website', charts, 7)

Command Line

slocr daily --space 'SLO - Production Website' --chart 'Website Response Time Mean' --threshold 100 --chart 'Website Reponse Time  p95' --threshold 200 --num-days 7

Developing

Project Tooling

  • python-project-template - Project template and massive timesaver, with many of the below tools prconfigured
  • Paver for running miscellaneous tasks
  • Setuptools for distribution (Setuptools and Distribute_ have merged_)
  • Sphinx for documentation
  • flake8 for source code checking
  • pytest for unit testing
  • mock for mocking (not required by the template, but included anyway)
  • tox for testing on multiple Python versions

Setup with VirtualEnv Et Al

With pyenv and pyenv-virtualenv

pyenv virtualenv sloc_report
pyenv local sloc_report

With virtualenvwrapper

mkvirtualenv sloc_report

With plain virtualenv_::

virtualenv VENV
source VENV/bin/activate

Install the project's development and runtime requirements

pip install -r requirements-dev.txt

Run the unit tests

paver test

Run linting

paver lint

Run the integration tests

Integration tests require real librato credentials. Ideally this should be a read-only API token. The following environment variables are required:

  • LIBRATO_EMAIL - the primary email address associated with the account
  • LIBRATO_TOKEN - the API token
  • LIBRATO_TEST_SPACE - Name of a space that exists within the librato account and has at least one chart

To run the integration tests:

    paver test_integration

#. Run all the tests

paver test_all

You should see output similar to this:

$ paver test_all
---> pavement.test_all
No style errors
========================================= test session starts =========================================
platform darwin -- Python 2.7.3 -- pytest-2.3.4
collected 5 items

tests/test_main.py .....

====================================== 5 passed in 0.05 seconds =======================================
  ___  _   ___ ___ ___ ___
 | _ \/_\ / __/ __| __|   \
 |  _/ _ \\__ \__ \ _|| |) |
 |_|/_/ \_\___/___/___|___/

Supported Python Versions

  • CPython 2.7

Other Pythons may also work but are at this point unsupported.

Jython_ and IronPython_ may also work, but have not been tested. If there is interest in support for these alternative implementations, please open a feature request!

Issues

Please report any bugs or requests that you have using the GitHub issue tracker!

Authors

archived-sloc_report's People

Contributors

rdark avatar

Stargazers

 avatar

Watchers

 avatar  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.