Sha256: 58e779ec80eac508679f0516278a81ddd046f9137898e8ce48e78de799d4e574
Contents?: true
Size: 559 Bytes
Versions: 8
Compression:
Stored size: 559 Bytes
Contents
module Metriksd class Timeslice attr_reader :time def initialize(time) @time = time @mutex = Mutex.new @dirty = false @records = {} end def dirty? @mutex.synchronize do @dirty end end def flush @mutex.synchronize do @dirty = false @records.values end end def push(data) @mutex.synchronize do @records["#{data.client_id}/#{data.name}"] = data @dirty = true end end alias_method :<<, :push end end
Version data entries
8 entries across 8 versions & 1 rubygems