computation 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/computation/fallback.rb +12 -0
- data/lib/computation/relationships.rb +9 -0
- data/lib/test_support/computation_record.rb +0 -7
- metadata +45 -43
@@ -0,0 +1,12 @@
|
|
1
|
+
module BrighterPlanet
|
2
|
+
module Computation
|
3
|
+
module Fallback
|
4
|
+
def self.included(base)
|
5
|
+
base.falls_back_on :compute_time => 1.0, # assume 1 hour
|
6
|
+
:compute_units => 1, # assume 1 EC2 Unit
|
7
|
+
:power_usage_effectiveness => 1.5, # based on Amazon's EC2 cost comparison calculator statement that most data centers have PUE of 1.3 - 3.0
|
8
|
+
:compute_electricity_intensity => 0.075 # kW based on Amazon's EC2 cost comparison calculator stating 150W for small compute instance equivalent server and 0.5 power conversion factor (to get average operating load from nameplate capacity) - EC2 probably has lower draw but higher power conversion factor
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -5,11 +5,4 @@ require 'sniff'
|
|
5
5
|
class ComputationRecord < ActiveRecord::Base
|
6
6
|
include Sniff::Emitter
|
7
7
|
include BrighterPlanet::Computation
|
8
|
-
|
9
|
-
belongs_to :zip_code, :foreign_key => 'zip_code_name'
|
10
|
-
|
11
|
-
falls_back_on :compute_time => 1.0, # assume 1 hour
|
12
|
-
:compute_units => 1, # assume 1 EC2 Unit
|
13
|
-
:power_usage_effectiveness => 1.5, # based on Amazon's EC2 cost comparison calculator statement that most data centers have PUE of 1.3 - 3.0
|
14
|
-
:compute_electricity_intensity => 0.075 # kW based on Amazon's EC2 cost comparison calculator stating 150W for small compute instance equivalent server and 0.5 power conversion factor (to get average operating load from nameplate capacity) - EC2 probably has lower draw but higher power conversion factor
|
15
8
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: computation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 5
|
10
|
+
version: 0.0.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Andy Rossmeissl
|
@@ -19,13 +19,14 @@ autorequire:
|
|
19
19
|
bindir: bin
|
20
20
|
cert_chain: []
|
21
21
|
|
22
|
-
date: 2010-09-
|
22
|
+
date: 2010-09-28 00:00:00 -04:00
|
23
23
|
default_executable:
|
24
24
|
dependencies:
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
|
-
|
26
|
+
type: :development
|
27
27
|
prerelease: false
|
28
|
-
|
28
|
+
name: activerecord
|
29
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
29
30
|
none: false
|
30
31
|
requirements:
|
31
32
|
- - ~>
|
@@ -36,12 +37,12 @@ dependencies:
|
|
36
37
|
- 0
|
37
38
|
- 0
|
38
39
|
version: 3.0.0
|
39
|
-
|
40
|
-
version_requirements: *id001
|
40
|
+
requirement: *id001
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
|
42
|
+
type: :development
|
43
43
|
prerelease: false
|
44
|
-
|
44
|
+
name: bundler
|
45
|
+
version_requirements: &id002 !ruby/object:Gem::Requirement
|
45
46
|
none: false
|
46
47
|
requirements:
|
47
48
|
- - ~>
|
@@ -52,12 +53,12 @@ dependencies:
|
|
52
53
|
- 0
|
53
54
|
- 0
|
54
55
|
version: 1.0.0
|
55
|
-
|
56
|
-
version_requirements: *id002
|
56
|
+
requirement: *id002
|
57
57
|
- !ruby/object:Gem::Dependency
|
58
|
-
|
58
|
+
type: :development
|
59
59
|
prerelease: false
|
60
|
-
|
60
|
+
name: cucumber
|
61
|
+
version_requirements: &id003 !ruby/object:Gem::Requirement
|
61
62
|
none: false
|
62
63
|
requirements:
|
63
64
|
- - ~>
|
@@ -68,12 +69,12 @@ dependencies:
|
|
68
69
|
- 8
|
69
70
|
- 3
|
70
71
|
version: 0.8.3
|
71
|
-
|
72
|
-
version_requirements: *id003
|
72
|
+
requirement: *id003
|
73
73
|
- !ruby/object:Gem::Dependency
|
74
|
-
|
74
|
+
type: :development
|
75
75
|
prerelease: false
|
76
|
-
|
76
|
+
name: jeweler
|
77
|
+
version_requirements: &id004 !ruby/object:Gem::Requirement
|
77
78
|
none: false
|
78
79
|
requirements:
|
79
80
|
- - ~>
|
@@ -84,12 +85,12 @@ dependencies:
|
|
84
85
|
- 4
|
85
86
|
- 0
|
86
87
|
version: 1.4.0
|
87
|
-
|
88
|
-
version_requirements: *id004
|
88
|
+
requirement: *id004
|
89
89
|
- !ruby/object:Gem::Dependency
|
90
|
-
|
90
|
+
type: :development
|
91
91
|
prerelease: false
|
92
|
-
|
92
|
+
name: rake
|
93
|
+
version_requirements: &id005 !ruby/object:Gem::Requirement
|
93
94
|
none: false
|
94
95
|
requirements:
|
95
96
|
- - ">="
|
@@ -98,12 +99,12 @@ dependencies:
|
|
98
99
|
segments:
|
99
100
|
- 0
|
100
101
|
version: "0"
|
101
|
-
|
102
|
-
version_requirements: *id005
|
102
|
+
requirement: *id005
|
103
103
|
- !ruby/object:Gem::Dependency
|
104
|
-
|
104
|
+
type: :development
|
105
105
|
prerelease: false
|
106
|
-
|
106
|
+
name: rdoc
|
107
|
+
version_requirements: &id006 !ruby/object:Gem::Requirement
|
107
108
|
none: false
|
108
109
|
requirements:
|
109
110
|
- - ">="
|
@@ -112,12 +113,12 @@ dependencies:
|
|
112
113
|
segments:
|
113
114
|
- 0
|
114
115
|
version: "0"
|
115
|
-
|
116
|
-
version_requirements: *id006
|
116
|
+
requirement: *id006
|
117
117
|
- !ruby/object:Gem::Dependency
|
118
|
-
|
118
|
+
type: :development
|
119
119
|
prerelease: false
|
120
|
-
|
120
|
+
name: rspec
|
121
|
+
version_requirements: &id007 !ruby/object:Gem::Requirement
|
121
122
|
none: false
|
122
123
|
requirements:
|
123
124
|
- - ~>
|
@@ -130,12 +131,12 @@ dependencies:
|
|
130
131
|
- beta
|
131
132
|
- 17
|
132
133
|
version: 2.0.0.beta.17
|
133
|
-
|
134
|
-
version_requirements: *id007
|
134
|
+
requirement: *id007
|
135
135
|
- !ruby/object:Gem::Dependency
|
136
|
-
|
136
|
+
type: :development
|
137
137
|
prerelease: false
|
138
|
-
|
138
|
+
name: sniff
|
139
|
+
version_requirements: &id008 !ruby/object:Gem::Requirement
|
139
140
|
none: false
|
140
141
|
requirements:
|
141
142
|
- - ~>
|
@@ -146,24 +147,23 @@ dependencies:
|
|
146
147
|
- 2
|
147
148
|
- 0
|
148
149
|
version: 0.2.0
|
149
|
-
|
150
|
-
version_requirements: *id008
|
150
|
+
requirement: *id008
|
151
151
|
- !ruby/object:Gem::Dependency
|
152
|
-
|
152
|
+
type: :runtime
|
153
153
|
prerelease: false
|
154
|
-
|
154
|
+
name: emitter
|
155
|
+
version_requirements: &id009 !ruby/object:Gem::Requirement
|
155
156
|
none: false
|
156
157
|
requirements:
|
157
158
|
- - ~>
|
158
159
|
- !ruby/object:Gem::Version
|
159
|
-
hash:
|
160
|
+
hash: 19
|
160
161
|
segments:
|
161
162
|
- 0
|
162
163
|
- 1
|
163
|
-
-
|
164
|
-
version: 0.1.
|
165
|
-
|
166
|
-
version_requirements: *id009
|
164
|
+
- 4
|
165
|
+
version: 0.1.4
|
166
|
+
requirement: *id009
|
167
167
|
description: A software model in Ruby for the greenhouse gas emissions of a computer's computations
|
168
168
|
email: andy@rossmeissl.net
|
169
169
|
executables: []
|
@@ -180,6 +180,8 @@ files:
|
|
180
180
|
- lib/computation/carbon_model.rb
|
181
181
|
- lib/computation/characterization.rb
|
182
182
|
- lib/computation/data.rb
|
183
|
+
- lib/computation/fallback.rb
|
184
|
+
- lib/computation/relationships.rb
|
183
185
|
- lib/computation/summarization.rb
|
184
186
|
- lib/test_support/computation_record.rb
|
185
187
|
- features/support/env.rb
|