Sha256: e5a8de168e5344b0f9399042b29e76cd52c341d956e750b5ed26d82dcbdc70ca

Contents?: true

Size: 935 Bytes

Versions: 3

Compression:

Stored size: 935 Bytes

Contents

module Flows
  module Plugin
    module Profiler
      class Report
        # @api private
        Event = Struct.new(:method_class, :method_type, :method_name, :data) do
          def subject
            "#{method_class}#{delimeter}#{method_name}"
          end

          private

          def delimeter
            case method_type
            when :instance then '#'
            when :singleton then '.'
            end
          end
        end

        # @api private
        #
        # Method execution start event.
        class StartEvent < Event
          def to_s
            "start: #{subject}"
          end
        end

        # @api private
        #
        # Method execution finish event.
        #
        # Data is an execution time in microseconds.
        class FinishEvent < Event
          def to_s
            "finish(#{data} microseconds): #{subject}"
          end
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
flows-0.6.0 lib/flows/plugin/profiler/report/events.rb
flows-0.5.1 lib/flows/plugin/profiler/report/events.rb
flows-0.5.0 lib/flows/plugin/profiler/report/events.rb