Class: GroongaQueryLog::Command::CheckPerformanceRegression::OperationStatistic

Inherits:
Statistic
  • Object
show all
Defined in:
lib/groonga-query-log/command/check-performance-regression.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Statistic

#diff_elapsed_time, #new_elapsed_time, #old_elapsed_time, #ratio

Constructor Details

#initialize(operation, index, old, new, threshold) ⇒ OperationStatistic

Returns a new instance of OperationStatistic.



252
253
254
255
256
# File 'lib/groonga-query-log/command/check-performance-regression.rb', line 252

def initialize(operation, index, old, new, threshold)
  super(old, new, threshold)
  @operation = operation
  @index = index
end

Instance Attribute Details

#indexObject (readonly)

Returns the value of attribute index.



251
252
253
# File 'lib/groonga-query-log/command/check-performance-regression.rb', line 251

def index
  @index
end

Instance Method Details

#contextObject



262
263
264
# File 'lib/groonga-query-log/command/check-performance-regression.rb', line 262

def context
  @operation[:context]
end

#nameObject



258
259
260
# File 'lib/groonga-query-log/command/check-performance-regression.rb', line 258

def name
  @operation[:name]
end

#slow?Boolean

Returns:

  • (Boolean)


266
267
268
# File 'lib/groonga-query-log/command/check-performance-regression.rb', line 266

def slow?
  @threshold.slow_operation?(diff_elapsed_time, ratio)
end