Giter VIP home page Giter VIP logo

gce_resource_grapher's Introduction

GCE Resource Usage Grapher

GCERUG allows visualization of Google Compute Engine instance usage. It currently graphs instance, CPU, memory and disk space count with options for filtering by region or total summary.

Total Resource Counts

Resource Counts by Region

Available Regions Listing

Getting started

Requirements

GCERUG was written in python2.7 and requires the following modules

  • pygal
  • flask
  • google-api-python-client
  • oauth2client

The script will attempt to load GCE's service file using the GOOGLE_APPLICATION_CREDENTIALS enviromnent variable. More information on configuring the GCE environment can be found on https://cloud.google.com/compute/docs/access/create-enable-service-accounts-for-instances,

Authentication

If you have the json service file available, you can export the GOOGLE_APPLICATION_CREDENTIALS environment variable by pointing it to your service file

export GOOGLE_APPLICATION_CREDENTIALS=/path/to/gce_service_file.json

Running the script

GCERUG will attempt to open a new tab on your default webbrowser.

python2.7 gce_resource_grapher.py

Note for Windows Users This script works under Windows WLS but you'll need some additional enviornment variables configured.

The example assumes firefox should be configured as the default browser; edit accordingly.

export DISPLAY=:0.0
export BROWSER='/mnt/c/Program Files/Firefox/firefox.exe'

Example Execution

bruno@boxee ~/gce_resource_grapher $ python2.7 gce_resource_grapher.py 
 * Serving Flask app "gce_resource_grapher" (lazy loading)
 * Environment: production
   WARNING: Do not use the development server in a production environment.
   Use a production WSGI server instead.
 * Debug mode: off
 * Running on http://127.0.0.1:5940/ (Press CTRL+C to quit)
Created new window in existing browser session.
127.0.0.1 - - [05/May/2018 15:39:10] "GET /summary HTTP/1.1" 200 -
127.0.0.1 - - [05/May/2018 15:39:10] "GET /static/styles/style.css HTTP/1.1" 200 -
127.0.0.1 - - [05/May/2018 15:39:10] "GET /favicon.ico HTTP/1.1" 302 -
127.0.0.1 - - [05/May/2018 15:39:10] "GET /summary HTTP/1.1" 200 -

At this point your browser should be open to the graphs summary page. If not, you can still navigate directly to URL listed in your terminal output.

Configuration

Custom Instance Sizes

GCERUG will query the GCE API to build a map of image sizes. If you build instances with non-default sizes, you'll need to add the custom size mapping to the custom_sizes.dict file.

Custom size should be a dictionary data type

{u'custom-1-2560': (1, 2560)}
{u'custom-1-6656': (1, 6656)}
{u'custom-2-10240': (2, 10240)}
{u'custom-4-10240': (4, 10240)}

gce_resource_grapher's People

Contributors

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