Sha256: 5e200460b0fe4858db1b2bbeff7988ecab7bb3284a0e9cfd3dcb7f4c98ea01fa
Contents?: true
Size: 1.26 KB
Versions: 22
Compression:
Stored size: 1.26 KB
Contents
module Mongo module ServerSelection module RTT # Represents a specification. # # @since 2.0.0 class Spec # @return [ String ] description The spec description. attr_reader :description # @return [ Float ] average_rtt The starting average round trip time, in seconds. attr_reader :average_rtt # @return [ Float ] new_rtt The new round trip time for ismaster, in seconds. attr_reader :new_rtt # @return [ Float ] new_average_rtt The newly calculated moving average round trip time, in seconds. attr_reader :new_average_rtt # Instantiate the new spec. # # @param [ String ] test_path The path to the file. # # @since 2.0.0 def initialize(test_path) @test = YAML.load(File.read(test_path)) @description = "#{File.basename(test_path)}: avg_rtt_ms: #{@test['avg_rtt_ms']}, new_rtt_ms: #{@test['new_rtt_ms']}," + " new_avg_rtt: #{@test['new_avg_rtt']}" @average_rtt = @test['avg_rtt_ms'] == 'NULL' ? nil : @test['avg_rtt_ms'].to_f / 1000 @new_rtt = @test['new_rtt_ms'].to_f / 1000 @new_average_rtt = @test['new_avg_rtt'].to_f / 1000 end end end end end
Version data entries
22 entries across 22 versions & 1 rubygems