Many times, the operation you want to measure is not block execution time. You may want to measure something that is already stored as a variable. This is a common pattern for us, and we commonly do this:
Right now, measure only reports execution time of the provided block. This PR proposes that the block becomes optional and if provided, the :value option takes precedence.
This should provide a symmetry between the two methods, e.g.:
Many times, the operation you want to measure is not block execution time. You may want to measure something that is already stored as a variable. This is a common pattern for us, and we commonly do this:
You can see here that we're leaning on l2met logging, but with the new pluggable metrics backends, it'd be much nicer to be able to do something like:
Right now,
measure
only reports execution time of the provided block. This PR proposes that the block becomes optional and if provided, the:value
option takes precedence.This should provide a symmetry between the two methods, e.g.:
But should also maintain the current API of: