Class: DataStore::Configuration
- Inherits:
-
Object
- Object
- DataStore::Configuration
- Defined in:
- lib/data_store/configuration.rb
Overview
Used to set up and modify settings for the data store.
Instance Attribute Summary collapse
-
#compression_schema ⇒ Object
The schema is the way avarages of the datapoints is calculated/ Default: [6,5,3,4,4,3].
-
#data_type ⇒ Object
The data type in which the value is stored Default: double.
-
#database ⇒ Object
The database used for storing the data.
-
#database_config_file ⇒ Object
The location of the database.yml file.
-
#enable_logging ⇒ Object
Enable logging.
-
#frequency ⇒ Object
The frequency tells how often data entry is done.
-
#frequency_tolerance ⇒ Object
Tolerance of the frequency in which datapoints are added Default: 0.05 This means a 5% margin.
-
#log_file ⇒ Object
The location of the log file Default $stdout.
-
#log_level ⇒ Object
The level of logging Default: Logger::ERROR.
-
#maximum_datapoints ⇒ Object
The maximum datapoints is the maximum number of datapoint within a given timeframe Default: 800.
-
#prefix ⇒ Object
The prefix is used as a prefix for the database table name.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/data_store/configuration.rb', line 50 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.('../../../config/database.yml', __FILE__) @log_file = $stdout @log_level = Logger::ERROR @enable_logging = true @frequency_tolerance = 0.05 end |
Instance Attribute Details
#compression_schema ⇒ Object
The schema is the way avarages of the datapoints is calculated/
Default: [6,5,3,4,4,3]
14 15 16 |
# File 'lib/data_store/configuration.rb', line 14 def compression_schema @compression_schema end |
#data_type ⇒ Object
The data type in which the value is stored
Default: double
33 34 35 |
# File 'lib/data_store/configuration.rb', line 33 def data_type @data_type end |
#database ⇒ Object
The database used for storing the data.
10 11 12 |
# File 'lib/data_store/configuration.rb', line 10 def database @database end |
#database_config_file ⇒ Object
The location of the database.yml file
36 37 38 |
# File 'lib/data_store/configuration.rb', line 36 def database_config_file @database_config_file end |
#enable_logging ⇒ Object
Enable logging.
Default: true
40 41 42 |
# File 'lib/data_store/configuration.rb', line 40 def enable_logging @enable_logging end |
#frequency ⇒ Object
The frequency tells how often data entry is done. A frequency of 10 means a data entry once every 10 seconds.
Default: 10 sec
19 20 21 |
# File 'lib/data_store/configuration.rb', line 19 def frequency @frequency end |
#frequency_tolerance ⇒ Object
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
25 26 27 |
# File 'lib/data_store/configuration.rb', line 25 def frequency_tolerance @frequency_tolerance end |
#log_file ⇒ Object
The location of the log file
Default $stdout
44 45 46 |
# File 'lib/data_store/configuration.rb', line 44 def log_file @log_file end |
#log_level ⇒ Object
The level of logging
Default: Logger::ERROR
48 49 50 |
# File 'lib/data_store/configuration.rb', line 48 def log_level @log_level end |
#maximum_datapoints ⇒ Object
The maximum datapoints is the maximum number of datapoint within a given timeframe
Default: 800
29 30 31 |
# File 'lib/data_store/configuration.rb', line 29 def maximum_datapoints @maximum_datapoints end |
#prefix ⇒ Object
The prefix is used as a prefix for the database table name.
7 8 9 |
# File 'lib/data_store/configuration.rb', line 7 def prefix @prefix end |