Coder Social home page Coder Social logo

metrics-collector's Introduction

#Metrics-Collector

Metrics-Collector is one of the components of CF app-autoscaler. It is used to collect application metrics from CF loggretator. The current version only supports memory metrics, it will be extended to include other metrics like throughput and response time at a later time.

Getting started

System requirements:

  • Go 1.5 or above
  • Cloud Foundry relese 235 or later

Build and test

  1. clone app-autoscaler project: git clone https://github.com/cloudfoundry-incubator/app-autoscaler.git
  2. change directory to app-autoscaler
  3. pull the submodules : git submodule update --init --recursive
  4. add app-autoscaler directory to your $GOPATH
  5. change directory to src/metrics-collector
  6. build the project: go build -o out/mc
  7. test the project:
    1. install ginko: go install github.com/onsi/ginkgo/ginkgo
    2. run tests: ginkgo -r

Run the metrics-collector

Firstly a configuration file needs to be created. Examples can be found under example-config directory. Here is an example:

cf:
  api: "https://api.bosh-lite.com"
  grant_type: "password"
  user: "admin"
  pass: "admin"
server:
  port: 8080
logging:
  level: "info"

The config parameters are explained as below

  • cf : cloudfoundry config
  • api: API endpoint of cloudfoundry
  • grant_type: the grant type when you login into coud foundry, can be "password" or "client_credentials"
  • user: the user name when using password grant to login cloudfoundry
  • pass: the password when using password grant to login cloudfoundry
  • client_id: the client id when using client_credentials grant to login cloudfoundry
  • secret: the client secret when using client_credentials grant to login cloudfoundry
  • server: API sever config
  • port: the port API sever will listen to
  • logging: config for logging
  • level: the level of logging, can be 'debug', 'info', 'error' or 'fatal'

To run the metrics-collector, use `./out/mc -c config_file_name'

API

Metrics Collector exposes the following APIs for other CF App-Autoscaler components to retrieve metrics.

PATH METHOD Description
/v1/apps/{appid}/metrics/memory GET Get the latest memroy metric of an application

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.