Sha256: 5ea5facb7b7d7c13dc4d0775ab224a30ec1d4182882e46f39be045c02bc52c05

Contents?: true

Size: 1.25 KB

Versions: 6

Compression:

Stored size: 1.25 KB

Contents

module Rhcf
  module Timeseries
    EVENT_SET_TOKEN   = 'ES'
    EVENT_POINT_TOKEN = 'P'
    DEFAULT_PREFIX    = 'TS'

    DEFAULT_RESOLUTIONS_MAP={
      :ever => {span:Float::INFINITY, formatter: "ever", ttl: (2 * 366).days},
      :year => {span: 365.days,formatter: "%Y", ttl: (2 * 366).days},
      :week => {span: 1.week, formatter: "%Y-CW%w", ttl: 90.days},
      :month => {span: 30.days, formatter: "%Y-%m", ttl: 366.days},
      :day => {span: 1.day, formatter: "%Y-%m-%d", ttl: 30.days},
      :hour => {span: 1.hour, formatter: "%Y-%m-%dT%H", ttl: 24.hours},
      :minute => {span: 1.minute, formatter: "%Y-%m-%dT%H:%M", ttl: 120.minutes},
      :second => {span: 1, formatter: "%Y-%m-%dT%H:%M:%S", ttl: 1.hour},
      :"5seconds" => {span: 5.seconds, formatter: ->(time){ [time.strftime("%Y-%m-%dT%H:%M:") ,  time.to_i % 60/5, '*',5].join('') }, ttl: 1.hour},
      :"5minutes" => {span: 5.minutes, formatter: ->(time){ [time.strftime("%Y-%m-%dT%H:") ,  (time.to_i/60) % 60/5, '*',5].join('') }, ttl: 3.hour},
      :"15minutes" => {span: 15.minutes, formatter: ->(time){ [time.strftime("%Y-%m-%dT%H:") ,  (time.to_i/60) % 60/15, '*',15].join('') }, ttl: 24.hours}

    }

    DEFAULT_RESOLUTIONS = DEFAULT_RESOLUTIONS_MAP.keys
    NAMESPACE_SEPARATOR = '|'
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rhcf-timeseries-2.0.1pre lib/rhcf/timeseries/constants.rb
rhcf-timeseries-2.0.0pre lib/rhcf/timeseries/constants.rb
rhcf-timeseries-1.0.3 lib/rhcf/timeseries/constants.rb
rhcf-timeseries-1.0.2 lib/rhcf/timeseries/constants.rb
rhcf-timeseries-1.0.1 lib/rhcf/timeseries/constants.rb
rhcf-timeseries-1.0.0 lib/rhcf/timeseries/constants.rb