class DataStore::Configuration

Used to set up and modify settings for the data store.

Attributes

compression_schema[RW]

The compression schema defines the compression of the data, i.e how the averages of the datapoints are calculated. Default: ‘[6,5,3,4,4,3]’ With the default settings: from every 6 datapoints an average value is calculated. From those calculated average values from every five values a new average value is created (The compression is now 6 * 5 = 30).

data_type[RW]

The data type in which the value is stored

Default: double
database[RW]

The database used for storing the data.

database_config_file[RW]

The location of the database.yml file

enable_logging[RW]

Enable logging.

Default: true
frequency[RW]

The frequency tells how often data entry is done. A frequency of 10 means a data entry once every 10 seconds.

Default: 10 sec
frequency_tolerance[RW]

Tolerance of the frequency in which datapoints are added

Default: 0.05

This means a 5% margin. So with a frequency of 10s, the next datapoint within 9.95 - 10.5 is considered the next datapoint

log_file[RW]

The location of the log file

Default $stdout
log_level[RW]

The level of logging

Default: Logger::ERROR
maximum_datapoints[RW]

The maximum datapoints is the maximum number of datapoint within a given timeframe

Default: 800
prefix[RW]

The prefix is used as a prefix for the database table name.

Public Class Methods

new() click to toggle source
# File lib/data_store/configuration.rb, line 52
def initialize
  @prefix                      = 'ds_'
  @database                    = :postgres
  @compression_schema          = '[6,5,3,4,4,3]'
  @frequency                   = 10
  @maximum_datapoints          = 800
  @data_type                   = :double
  @database_config_file        = File.expand_path('../../../config/database.yml', __FILE__)
  @log_file                    = $stdout
  @log_level                   = Logger::ERROR
  @enable_logging              = true
  @frequency_tolerance         = 0.05
end