Sha256: cef81bf81380fcbec4f7eafad6332fab06739fdab1a56b345cc8444819766eb9
Contents?: true
Size: 656 Bytes
Versions: 6
Compression:
Stored size: 656 Bytes
Contents
# frozen_string_literal: true require 'singleton' require 'rails_autoscale_agent/time_rounder' require 'rails_autoscale_agent/measurement' require 'rails_autoscale_agent/report' module RailsAutoscaleAgent class Store include Singleton attr_reader :measurements def initialize @measurements = [] end def push(value, time = Time.now, queue_name = nil, metric = nil) @measurements << Measurement.new(time, value, queue_name, metric) end def pop_report report = Report.new while measurement = @measurements.shift report.measurements << measurement end report end end end
Version data entries
6 entries across 6 versions & 1 rubygems