implementation is slightly different but the instrument(name, payload, &optional_block) interface is the same.
can be configured with the DSL:
ruby hyperdrive do instrumenter MyInstrumenter.new end
the configured instrumenter be called anywhere with hyperdrive.instrument
can be called inside before callbacks and request handlers with the shorter instrument method, which is just a wrapper around hyperdrive.instrument
ships with the default Hyperdrive::Instrumenter::Noop class which just returns the given payload (modified by the optional block or not) and a Hyperdrive::Instrumenter::Memory which can be used by library users in tests (and is being used in hyperdrive's own specs).
This pull request does not add any instrumentation to hyperdrive itself, but that is on the road map in the near term.
hyperdrive
, with the interface proposed by @jnunemaker in this blog post: http://www.railstips.org/blog/archives/2013/01/23/an-instrumented-library-in-30-lines/instrument(name, payload, &optional_block)
interface is the same.ruby hyperdrive do instrumenter MyInstrumenter.new end
hyperdrive.instrument
before
callbacks andrequest
handlers with the shorterinstrument
method, which is just a wrapper aroundhyperdrive.instrument
Hyperdrive::Instrumenter::Noop
class which just returns the given payload (modified by the optional block or not) and aHyperdrive::Instrumenter::Memory
which can be used by library users in tests (and is being used in hyperdrive's own specs).This pull request does not add any instrumentation to hyperdrive itself, but that is on the road map in the near term.
refs #17