Class: Google::Apis::ComputeAlpha::CapacityHistoryResponsePreemptionRecord

Inherits:
Object
  • Object
show all
Includes:
Google::Apis::Core::Hashable, Google::Apis::Core::JsonObjectSupport
Defined in:
lib/google/apis/compute_alpha/classes.rb,
lib/google/apis/compute_alpha/representations.rb,
lib/google/apis/compute_alpha/representations.rb

Overview

A record of Spot VM preemption history.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ CapacityHistoryResponsePreemptionRecord

Returns a new instance of CapacityHistoryResponsePreemptionRecord.



9219
9220
9221
# File 'lib/google/apis/compute_alpha/classes.rb', line 9219

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#intervalGoogle::Apis::ComputeAlpha::Interval

Represents a time interval, encoded as a Timestamp start (inclusive) and a Timestamp end (exclusive). The start must be less than or equal to the end. When the start equals the end, the interval is empty (matches no time). When both start and end are unspecified, the interval matches any time. Corresponds to the JSON property interval



9209
9210
9211
# File 'lib/google/apis/compute_alpha/classes.rb', line 9209

def interval
  @interval
end

#preemption_rateFloat

The preemption rate during the interval, representing the fraction of Spot VMs that were preempted. Range: 0.0 to 1.0. Preemption rate is calculated as (total preempted Spots) / (total Spots that stopped running). Corresponds to the JSON property preemptionRate

Returns:

  • (Float)


9217
9218
9219
# File 'lib/google/apis/compute_alpha/classes.rb', line 9217

def preemption_rate
  @preemption_rate
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



9224
9225
9226
9227
# File 'lib/google/apis/compute_alpha/classes.rb', line 9224

def update!(**args)
  @interval = args[:interval] if args.key?(:interval)
  @preemption_rate = args[:preemption_rate] if args.key?(:preemption_rate)
end