data_store 0.1.8 → 0.1.9

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ##0.1.9
2
+ * Very small fix, in order to trigger average calculator in case an extra compression is added in an already existing data store
3
+
1
4
  ##0.1.8
2
5
 
3
6
  * Added factor feature to multiply value before adding to the database
@@ -14,7 +14,7 @@ module DataStore
14
14
  end
15
15
 
16
16
  # Calculate average value if needed
17
- # Average value is store dthrough an add call by a Table object
17
+ # Average value is store through an add call by a Table object
18
18
  # So the average calculator is called again recursively
19
19
  def perform
20
20
  if calculation_needed?
@@ -36,7 +36,7 @@ module DataStore
36
36
  tolerance = DataStore.configuration.frequency_tolerance
37
37
  time_difference_since_last_calculation >= (time_resolution - (time_resolution * tolerance))
38
38
  else
39
- dataset.count == base.compression_schema[table_index]
39
+ dataset.count >= base.compression_schema[table_index]
40
40
  end
41
41
  end
42
42
 
@@ -1,3 +1,3 @@
1
1
  module DataStore
2
- VERSION = '0.1.8'
2
+ VERSION = '0.1.9'
3
3
  end
data/pry_config.rb ADDED
@@ -0,0 +1,70 @@
1
+ DataStore.configure do |config|
2
+ config.database = 'development'
3
+ config.enable_logging = false
4
+ config.database_config_file = '/Users/dovadi/rails/observi/config/database.yml'
5
+ end
6
+
7
+
8
+ DataStore::Base.db[:ds_316].where{created >= from}.where{created <= till}.order(:created)
9
+
10
+
11
+ table = DataStore::Table.new 316
12
+
13
+ from = (Date.today - 7.days).to_time.utc.to_i
14
+
15
+ table.differences(from, :day) #24 results
16
+
17
+ table.differences(from, :week) #7 results
18
+
19
+ table.differences(from, :month) #28 - 31 results depending on the month
20
+
21
+ table.differences(from, :year) #12 results
22
+
23
+
24
+ table.differences(from: from, timeslot: :day, offset: -5)
25
+
26
+
27
+ 2013-05-01 00:00:27 +0200,
28
+ 2013-05-01 01:00:28 +0200,
29
+ 2013-05-01 03:00:29 +0200,
30
+ 2013-05-01 06:00:20 +0200,
31
+ 2013-05-01 07:00:21 +0200,
32
+ 2013-05-01 08:00:21 +0200,
33
+ 2013-05-01 09:00:22 +0200,
34
+ 2013-05-01 10:00:23 +0200,
35
+ 2013-05-01 17:00:26 +0200,
36
+ 2013-05-01 19:00:27 +0200,
37
+ 2013-05-01 20:00:28 +0200,
38
+ 2013-05-01 21:00:28 +0200,
39
+ 2013-05-01 22:00:29 +0200,
40
+ 2013-05-01 23:00:28 +0200,
41
+ 2013-05-02 00:00:29 +0200,
42
+ 2013-05-02 01:00:29 +0200,
43
+ 2013-05-02 02:00:30 +0200,
44
+ 2013-05-02 07:00:22 +0200,
45
+ 2013-05-02 08:00:23 +0200,
46
+ 2013-05-02 09:00:24 +0200,
47
+ 2013-05-02 10:00:24 +0200,
48
+ 2013-05-02 11:00:25 +0200,
49
+ 2013-05-02 15:00:27 +0200,
50
+ 2013-05-02 16:00:27 +0200,
51
+ 2013-05-02 18:00:28 +0200,
52
+ 2013-05-02 19:00:29 +0200,
53
+ 2013-05-02 20:00:29 +0200,
54
+ 2013-05-02 21:00:30 +0200,
55
+ 2013-05-02 22:00:31 +0200,
56
+ 2013-05-03 07:07:04 +0200,
57
+ 2013-05-03 08:00:24 +0200,
58
+ 2013-05-03 09:00:25 +0200,
59
+ 2013-05-03 12:00:26 +0200,
60
+ 2013-05-03 13:00:27 +0200,
61
+ 2013-05-03 16:00:28 +0200,
62
+ 2013-05-03 19:00:29 +0200,
63
+ 2013-05-03 20:00:28 +0200,
64
+ 2013-05-03 21:00:29 +0200,
65
+ 2013-05-03 22:00:29 +0200,
66
+ 2013-05-04 00:00:30 +0200,
67
+ 2013-05-04 01:00:21 +0200,
68
+ 2013-05-04 02:00:22 +0200,
69
+ 2013-05-04 07:00:24 +0200,
70
+ 2013-05-04 08:00:25 +0200
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: data_store
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-04-25 00:00:00.000000000 Z
12
+ date: 2013-06-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sequel
@@ -56,6 +56,7 @@ files:
56
56
  - lib/data_store/definitions.rb
57
57
  - lib/data_store/table.rb
58
58
  - lib/data_store/version.rb
59
+ - pry_config.rb
59
60
  - test/average_calculator_test.rb
60
61
  - test/configuration_test.rb
61
62
  - test/connector_test.rb
@@ -78,7 +79,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
78
79
  version: '0'
79
80
  segments:
80
81
  - 0
81
- hash: -1364652122039742087
82
+ hash: -2498536008263531709
82
83
  required_rubygems_version: !ruby/object:Gem::Requirement
83
84
  none: false
84
85
  requirements:
@@ -87,7 +88,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
87
88
  version: '0'
88
89
  segments:
89
90
  - 0
90
- hash: -1364652122039742087
91
+ hash: -2498536008263531709
91
92
  requirements: []
92
93
  rubyforge_project:
93
94
  rubygems_version: 1.8.25