Sha256: 5b261fd77476ce45d0d94f0ec5c12e28c4a69597d2673dfeef6f7ec15157fe39
Contents?: true
Size: 1.05 KB
Versions: 15
Compression:
Stored size: 1.05 KB
Contents
module Kurchatov module Riemann class Event include Beefcake::Message optional :time, :int64, 1 optional :state, :string, 2 required :service, :string, 3 required :host, :string, 4 optional :description, :string, 5 repeated :tags, :string, 7 optional :ttl, :float, 8 optional :metric_sint64, :sint64, 13 optional :metric_d, :double, 14 optional :metric_f, :float, 15 optional :tsdb_service, :string, 16 repeated :tsdb_tags, :string, 17 def initialize(hash = nil) if hash super(hash) self.metric = hash[:metric] if hash[:metric] else super end @time ||= Time.now.to_i end def metric metric_d || metric_sint64 || metric_f end def metric=(m) if Integer === m and (-(2**63)...2**63) === m self.metric_sint64 = m self.metric_f = m.to_f else self.metric_d = m.to_f self.metric_f = m.to_f end end end end end
Version data entries
15 entries across 15 versions & 1 rubygems