Sha256: c847aeb08451dd0df9b2a74262f473e644da93fbb53870662d8082836c248620

Contents?: true

Size: 729 Bytes

Versions: 2

Compression:

Stored size: 729 Bytes

Contents

module Flows
  module Plugin
    module Profiler
      class Report
        class Tree < Report
          # @api private
          class Node
            attr_reader :subject
            attr_reader :executions

            def initialize(subject:)
              @subject = subject
              @children = {}
              @cache = {}

              @executions = []
            end

            def [](subject)
              @children[subject] ||= Node.new(subject: subject)
            end

            def children
              @children.values
            end

            def register_execution(microseconds)
              @executions << microseconds
            end
          end
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
flows-0.5.1 lib/flows/plugin/profiler/report/tree/node.rb
flows-0.5.0 lib/flows/plugin/profiler/report/tree/node.rb