cloudfoundry/uptimer

Name: uptimer

Owner: Cloud Foundry

Description: A Cloud Foundry availability measurement tool for eventful times

Created: 2017-07-03 23:56:06.0

Updated: 2018-05-13 03:59:20.0

Pushed: 2018-05-11 11:45:35.0

Homepage:

Size: 1271

Language: Go

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Uptimer

Uptimer is a tool for measuring CF availability during an arbitrary operation of interest.

It measures:

The CF Release Integration team uses it to monitor availability during migrations from cf-release to cf-deployment, and during upgrade deployments.

Installation
et github.com/cloudfoundry/uptimer
Usage

uptimer -configFile config.json.

Uptimer needs configuration to run. It reads a json file specified with the -configFile flag. The config describes how to target the CF you wish to measure, and commands to run while measuring uptime.

Config

Here is an example config json:


"while": [
    {
        "command": "bosh",
        "command_args": ["deploy", "-d", "cf", "interpolated-cf-deployment.yml", "-n"]
    },
    {
        "command": "bosh",
        "command_args": ["delete-deployment", "-d", "cf", "-n"]
    }
],
"cf": {
    "api": "api.my-cf.com",
    "app_domain": "my-cf.com",
    "admin_user": "admin",
    "admin_password": "PASS",
    "tcp_domain": "tcp.my-cf.com",
    "available_port": 1025
},
"optional_tests": {
  "run_app_syslog_availability": true
},
"allowed_failures": {
    "app_pushability": 2,
    "http_availability": 5,
    "recent_logs": 2,
    "streaming_logs": 2,
    "app_syslog_availability": 2
}

While (required)

The while section is an array of commands. These are executed in order while the measurement is run. When the last while command exits, uptimer will conclude its measurements and print a summary of results. If a while command exits with a non-zero exit code, uptimer won't run subsequent while commands. It will conclude its measurements and report, then exit with exit code 64.

A single-command while array is fine, and you can use sleep to just run up-timer for some period:

le": [{
"command": "sleep",
"command_args": ["600"]

Cf (mostly required)

The cf section contains information necessary to perform the cf auth and cf login commands on the target environment.

Uptimer requires an admin user because it creates and configures an org and space during test setup.

The tcp_domain and available_port values are not required unless you elect to run the app_syslog_availability test.

Optional tests (optional)

The optional_tests section is optional, as are each entry in the section. If these values are omitted, they are assumed to be false.

For the run_app_syslog_availability test, TCP routing is required, and you must specify the tcp_domain and available_port values in the Cf section of the configuration.

Allowed Failures (optional)

The allowed_failures section contains failure thresholds, expressed as integers. In the example above, the app_pushability measurement can fail at most two times before the measurement is marked as failed.

This allows users to tolerate variance in downtime to suit their needs.

If this config section is not specified, the default threshold will be 0 for each measurement.

CI

If you wish to run uptimer in CI during bosh deployments specifically, the deploy tasks in cf-deployment-concourse-tasks explicitly support this as an option. If you wish to use it some other way, said tasks may nonetheless be a useful example.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.