Class: Fiveruns::Tuneup::Step

Inherits:
RootStep
  • Object
show all
Defined in:
lib/fiveruns/tuneup/step.rb

Defined Under Namespace

Classes: SQL

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from RootStep

#<<, #child_times_by_layer, #children, #children_with_disparity, #depth, framework_layers, layers, #leaf?, #leaves, #percentages_by_layer, #schemas

Constructor Details

#initialize(name, layer = nil, file = nil, line = nil, sql = nil) ⇒ Step

Returns a new instance of Step.



126
127
128
129
130
131
132
# File 'lib/fiveruns/tuneup/step.rb', line 126

def initialize(name, layer=nil, file=nil, line=nil, sql=nil)
  @name = name
  @layer = layer
  @file = file
  @line = line
  @sql = sql
end

Instance Attribute Details

#depth=(value) ⇒ Object (writeonly)

Sets the attribute depth

Parameters:

  • value

    the value to set the attribute depth to.



118
119
120
# File 'lib/fiveruns/tuneup/step.rb', line 118

def depth=(value)
  @depth = value
end

#fileObject (readonly)

Returns the value of attribute file.



116
117
118
# File 'lib/fiveruns/tuneup/step.rb', line 116

def file
  @file
end

#layerObject (readonly)

Returns the value of attribute layer.



116
117
118
# File 'lib/fiveruns/tuneup/step.rb', line 116

def layer
  @layer
end

#lineObject (readonly)

Returns the value of attribute line.



116
117
118
# File 'lib/fiveruns/tuneup/step.rb', line 116

def line
  @line
end

#nameObject (readonly)

Returns the value of attribute name.



116
117
118
# File 'lib/fiveruns/tuneup/step.rb', line 116

def name
  @name
end

#sqlObject (readonly)

Returns the value of attribute sql.



116
117
118
# File 'lib/fiveruns/tuneup/step.rb', line 116

def sql
  @sql
end

#table_nameObject

Returns the value of attribute table_name.



117
118
119
# File 'lib/fiveruns/tuneup/step.rb', line 117

def table_name
  @table_name
end

#timeObject



134
135
136
137
# File 'lib/fiveruns/tuneup/step.rb', line 134

def time
  # FIXME: rank hack to get around weird JRuby YAML bug
  @time.respond_to?(:value) ? @time.value.to_f : @time || 0
end

Class Method Details

.disparity(time, parent) ⇒ Object



120
121
122
123
124
# File 'lib/fiveruns/tuneup/step.rb', line 120

def self.disparity(time, parent)
  returning Step.new("Other", parent.layer) do |step|
    step.time = time
  end
end

Instance Method Details

#sizeObject



139
140
141
# File 'lib/fiveruns/tuneup/step.rb', line 139

def size
  children.map(&:size).sum + 1
end