Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master

This branch is 0 commits ahead and 0 commits behind master

etc/ doesn't work reliably on all versions of distribute

At least on distribute 0.6.24, it can't find etc/ with the error message:

warning: no directories found matching 'etc/'

Without the trailing / all versions of distribute I tested work
latest commit 9f35936166
Johannes Erdfelt jerdfelt authored November 07, 2013
Octocat-spinner-32 bin
Octocat-spinner-32 etc whoops April 10, 2012
Octocat-spinner-32 other Added actual configs for the examples and moved the example directory… January 31, 2012
Octocat-spinner-32 tach Merge pull request #10 from bdelliott/env_setup April 30, 2013
Octocat-spinner-32 tests
Octocat-spinner-32 .gitignore Ignore *.pyc files January 31, 2012
Octocat-spinner-32 MANIFEST.in
Octocat-spinner-32 README.md The installation mechanics prevented you from instrumenting the same … February 18, 2012
Octocat-spinner-32 setup.py Adding MANIFEST.in September 11, 2013
README.md

Tach

Example instrumentation:

For the NovaAPI, using the OpenstackAPI, created in tach-api.conf

[global]
# also accepts a full path to the file, instead of a python module path
app_helper = tach_helper

[notifier:statsd]
driver = tach.notifiers.StatsDNotifier
host = <Your statsd host>
port = <Your statsd port, probably 8125>

[nova.api.openstack.api]
module = nova.api.openstack.wsgi.Resource
method = _process_stack
metric = tach.metrics.ExecTime
notifier = statsd
app_path = tach_helper
app = process_stack

Set up the helper script, created in tach_helper.py

This is where things get a little messy, but that's the catch with trying to instrument something you don't want to modify directly...

# create this in a file called tach_helper.py in the same directory as the conf
def queue_receive(*args, **kwargs):
    method = args[2]
    return args, kwargs, "nova.compute.%s" % method

def network_queue_receive(*args, **kwargs):
    method = args[2]
    return args, kwargs, "nova.network.%s" % method

def scheduler_queue_receive(*args, **kwargs):
    method = args[2]
    return args, kwargs, "nova.scheduler.%s" % method

def process_stack(*args, **kwargs):
    resource = args[0]
    req = args[1].__dict__
    method = ".%s" % req['environ']['REQUEST_METHOD']
    path = '.%s' % req['environ']['PATH_INFO'].split('/')[2]
    action = ".%s" % req['environ']['wsgiorg.routing_args'][1]['action']
    if action:
        key = 'nova.api%s%s%s' % (path, action, method)
    else:
        key = 'nova.api%s%s%s' % (path, method)
    return args, kwargs, key

Finally, launch the above

# Assumes you're in the nova dir already
tach tach-api.conf ./bin/nova-api
tach tach-compute.conf ./bin/nova-compute
tach tach-scheduler.conf ./bin/nova-scheduler
tach tach-network.conf ./bin/nova-network
Something went wrong with that request. Please try again.