Class: SolidObserver::Services::CacheStats::StabilityData

Inherits:
Object
  • Object
show all
Defined in:
lib/solid_observer/services/cache_stats.rb

Defined Under Namespace

Classes: EventCounts

Instance Method Summary collapse

Constructor Details

#initialize(window:, current_time:) ⇒ StabilityData

Returns a new instance of StabilityData.



168
169
170
171
# File 'lib/solid_observer/services/cache_stats.rb', line 168

def initialize(window:, current_time:)
  @window = window
  @current_time = current_time
end

Instance Method Details

#to_hObject



173
174
175
176
177
# File 'lib/solid_observer/services/cache_stats.rb', line 173

def to_h
  event_counts.to_h
rescue ActiveRecord::StatementInvalid
  CacheStats::STABILITY_EMPTY.dup
end