Sha256: 7e0c5aeec2af8146ac97ec27a7d5412bee7a3feb7cb9013c14d89e20699eef37
Contents?: true
Size: 698 Bytes
Versions: 24
Compression:
Stored size: 698 Bytes
Contents
#encoding: utf-8 module Riemann module Babbler module Plugins module Helpers RIEMANN_RESERVED_FIELDS = [ :time, :state, :service, :host, :description, :metric, :tags, :ttl ] def event_from_hash(hash=nil) if hash new_hash = Hash.new RIEMANN_RESERVED_FIELDS.each do |key| new_hash[key] = hash[key] || hash[key.to_s] end new_hash else Hash.new end end def event_from_json(str) event_from_hash(JSON.parse(str)) end end end end end
Version data entries
24 entries across 24 versions & 1 rubygems