Class: RSpecTelemetry::FactoryAggregation::Stat

Inherits:
Struct
  • Object
show all
Defined in:
lib/rspec_telemetry/factory_aggregation.rb

Overview

Shared by live summaries, CLI reports, and the viewer so ranking rules stay identical. A Struct (not Data) so collection runs on Ruby 3.1, where this is on the require path via summary.rb.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#countObject

Returns the value of attribute count

Returns:

  • (Object)

    the current value of count



8
9
10
# File 'lib/rspec_telemetry/factory_aggregation.rb', line 8

def count
  @count
end

#factoryObject

Returns the value of attribute factory

Returns:

  • (Object)

    the current value of factory



8
9
10
# File 'lib/rspec_telemetry/factory_aggregation.rb', line 8

def factory
  @factory
end

#keyObject

Returns the value of attribute key

Returns:

  • (Object)

    the current value of key



8
9
10
# File 'lib/rspec_telemetry/factory_aggregation.rb', line 8

def key
  @key
end

#max_msObject

Returns the value of attribute max_ms

Returns:

  • (Object)

    the current value of max_ms



8
9
10
# File 'lib/rspec_telemetry/factory_aggregation.rb', line 8

def max_ms
  @max_ms
end

#self_total_msObject

Returns the value of attribute self_total_ms

Returns:

  • (Object)

    the current value of self_total_ms



8
9
10
# File 'lib/rspec_telemetry/factory_aggregation.rb', line 8

def self_total_ms
  @self_total_ms
end

#strategyObject

Returns the value of attribute strategy

Returns:

  • (Object)

    the current value of strategy



8
9
10
# File 'lib/rspec_telemetry/factory_aggregation.rb', line 8

def strategy
  @strategy
end

#total_msObject

Returns the value of attribute total_ms

Returns:

  • (Object)

    the current value of total_ms



8
9
10
# File 'lib/rspec_telemetry/factory_aggregation.rb', line 8

def total_ms
  @total_ms
end

Instance Method Details

#avg_msObject



9
# File 'lib/rspec_telemetry/factory_aggregation.rb', line 9

def avg_ms = count.zero? ? 0.0 : total_ms / count