Isn't this the same thing as:

    val ctx = new TimedFlowContext
    val startWithTime = _flow.transform(new StartTimedFlowContextTransformer(ctx)).asInstanceOf[Flow[O]]
    val userFlow = measuredOps(startWithTime)
    val done = userFlow.transform(new StopTimedFlowContextTransformer(ctx, onComplete))
    done.asInstanceOf[Flow[O]]

and then you don't need to hook into the AST level at all?