Sha256: c4f6b53d0f90ad79d39d3dfc9dfb15bb05c8acd0387ab0af54bdac243cb91bcb

Contents?: true

Size: 447 Bytes

Versions: 10

Compression:

Stored size: 447 Bytes

Contents

# encoding: utf-8

module Hyperdrive
  module Instrumenters
    class Memory
      Event = Struct.new(:name, :payload, :result)

      attr_reader :events

      def initialize
        @events = []
      end

      def instrument(name, payload = {})
        result = if block_given?
          yield payload
        else
          payload
        end

        @events << Event.new(name, payload, result)

        result
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
hyperdrive-0.0.25 lib/hyperdrive/instrumenters/memory.rb
hyperdrive-0.0.24 lib/hyperdrive/instrumenters/memory.rb
hyperdrive-0.0.23 lib/hyperdrive/instrumenters/memory.rb
hyperdrive-0.0.22 lib/hyperdrive/instrumenters/memory.rb
hyperdrive-0.0.21 lib/hyperdrive/instrumenters/memory.rb
hyperdrive-0.0.20 lib/hyperdrive/instrumenters/memory.rb
hyperdrive-0.0.19 lib/hyperdrive/instrumenters/memory.rb
hyperdrive-0.0.18 lib/hyperdrive/instrumenters/memory.rb
hyperdrive-0.0.17 lib/hyperdrive/instrumenters/memory.rb
hyperdrive-0.0.16 lib/hyperdrive/instrumenters/memory.rb