computation 0.0.6 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,15 +1,15 @@
|
|
1
1
|
Feature: Computation Committee Calculations
|
2
2
|
The computation model should generate correct committee calculations
|
3
3
|
|
4
|
-
Scenario:
|
4
|
+
Scenario: EC2 compute units committee from default
|
5
5
|
Given a computation emitter
|
6
|
-
When the "
|
6
|
+
When the "ec2_compute_units" committee is calculated
|
7
7
|
Then the committee should have used quorum "default"
|
8
8
|
And the conclusion of the committee should be "1"
|
9
9
|
|
10
|
-
Scenario:
|
10
|
+
Scenario: Duration commitee from default
|
11
11
|
Given a computation emitter
|
12
|
-
When the "
|
12
|
+
When the "duration" committee is calculated
|
13
13
|
Then the committee should have used quorum "default"
|
14
14
|
And the conclusion of the committee should be "1.0"
|
15
15
|
|
@@ -41,9 +41,9 @@ Feature: Computation Committee Calculations
|
|
41
41
|
Then the committee should have used quorum "from eGRID subregion"
|
42
42
|
And the conclusion of the committee should have "name" of "W"
|
43
43
|
|
44
|
-
Scenario:
|
44
|
+
Scenario: Electricity intensity commtitee from default
|
45
45
|
Given a computation emitter
|
46
|
-
When the "
|
46
|
+
When the "electricity_intensity" committee is calculated
|
47
47
|
Then the committee should have used quorum "default"
|
48
48
|
And the conclusion of the committee should be "0.075"
|
49
49
|
|
@@ -53,24 +53,24 @@ Feature: Computation Committee Calculations
|
|
53
53
|
Then the committee should have used quorum "default"
|
54
54
|
And the conclusion of the committee should be "1.5"
|
55
55
|
|
56
|
-
Scenario: Electricity use commitee from default compute units,
|
56
|
+
Scenario: Electricity use commitee from default EC2 compute units, duration, electricity intensity, zip code, and PUE
|
57
57
|
Given a computation emitter
|
58
|
-
When the "
|
59
|
-
And the "
|
58
|
+
When the "ec2_compute_units" committee is calculated
|
59
|
+
And the "duration" committee is calculated
|
60
60
|
And the "egrid_subregion" committee is calculated
|
61
61
|
And the "egrid_region" committee is calculated
|
62
|
-
And the "
|
62
|
+
And the "electricity_intensity" committee is calculated
|
63
63
|
And the "power_usage_effectiveness" committee is calculated
|
64
64
|
And the "electricity_use" committee is calculated
|
65
65
|
Then the committee should have used quorum "from compute units, time, electricity intensity, PUE, and eGRID region"
|
66
66
|
And the conclusion of the committee should be "0.14063"
|
67
67
|
|
68
|
-
Scenario: Electricity use commitee from compute units,
|
68
|
+
Scenario: Electricity use commitee from EC2 compute units, duration, electricity intensity, zip code, and PUE
|
69
69
|
Given a computation emitter
|
70
|
-
And a characteristic "
|
71
|
-
And a characteristic "
|
70
|
+
And a characteristic "ec2_compute_units" of "10"
|
71
|
+
And a characteristic "duration" of "10"
|
72
72
|
And a characteristic "zip_code.name" of "94122"
|
73
|
-
And a characteristic "
|
73
|
+
And a characteristic "electricity_intensity" of "1.0"
|
74
74
|
And a characteristic "power_usage_effectiveness" of "2.0"
|
75
75
|
And the "egrid_subregion" committee is calculated
|
76
76
|
And the "egrid_region" committee is calculated
|
@@ -6,13 +6,13 @@ Feature: Computation Emissions Calculations
|
|
6
6
|
When emissions are calculated
|
7
7
|
Then the emission value should be within "0.01" kgs of "0.28"
|
8
8
|
|
9
|
-
Scenario: Calculations starting from compute units
|
10
|
-
Given a computation has "
|
9
|
+
Scenario: Calculations starting from EC2 compute units
|
10
|
+
Given a computation has "ec2_compute_units" of "10"
|
11
11
|
When emissions are calculated
|
12
12
|
Then the emission value should be within "0.01" kgs of "2.81"
|
13
13
|
|
14
|
-
Scenario: Calculations starting from
|
15
|
-
Given a computation has "
|
14
|
+
Scenario: Calculations starting from duration
|
15
|
+
Given a computation has "duration" of "10"
|
16
16
|
When emissions are calculated
|
17
17
|
Then the emission value should be within "0.01" kgs of "2.81"
|
18
18
|
|
@@ -21,8 +21,8 @@ Feature: Computation Emissions Calculations
|
|
21
21
|
When emissions are calculated
|
22
22
|
Then the emission value should be within "0.01" kgs of "0.13"
|
23
23
|
|
24
|
-
Scenario: Calculations starting from
|
25
|
-
Given a computation has "
|
24
|
+
Scenario: Calculations starting from electricity intensity
|
25
|
+
Given a computation has "electricity_intensity" of "1.0"
|
26
26
|
When emissions are calculated
|
27
27
|
Then the emission value should be within "0.01" kgs of "3.75"
|
28
28
|
|
@@ -31,11 +31,11 @@ Feature: Computation Emissions Calculations
|
|
31
31
|
When emissions are calculated
|
32
32
|
Then the emission value should be within "0.01" kgs of "0.38"
|
33
33
|
|
34
|
-
Scenario: Calculations starting from compute units,
|
35
|
-
Given a computation has "
|
36
|
-
And it has "
|
34
|
+
Scenario: Calculations starting from EC2 compute units, duration, electricity intensity, zip code, and PUE
|
35
|
+
Given a computation has "ec2_compute_units" of "10"
|
36
|
+
And it has "duration" of "10"
|
37
37
|
And it has "zip_code.name" of "94122"
|
38
|
-
And it has "
|
38
|
+
And it has "electricity_intensity" of "1.0"
|
39
39
|
And it has "power_usage_effectiveness" of "2.0"
|
40
40
|
When emissions are calculated
|
41
41
|
Then the emission value should be within "0.01" kgs of "222.22"
|
@@ -20,8 +20,8 @@ module BrighterPlanet
|
|
20
20
|
end
|
21
21
|
|
22
22
|
committee :electricity_use do # returns kWh including distribution losses
|
23
|
-
quorum 'from compute units, time, electricity intensity, PUE, and eGRID region', :needs => [:
|
24
|
-
(characteristics[:
|
23
|
+
quorum 'from compute units, time, electricity intensity, PUE, and eGRID region', :needs => [:ec2_compute_units, :duration, :electricity_intensity, :power_usage_effectiveness, :egrid_region] do |characteristics|
|
24
|
+
(characteristics[:ec2_compute_units] * characteristics[:duration] * characteristics[:electricity_intensity] * characteristics[:power_usage_effectiveness]) / (1 - characteristics[:egrid_region].loss_factor)
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
@@ -31,9 +31,9 @@ module BrighterPlanet
|
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
34
|
-
committee :
|
34
|
+
committee :electricity_intensity do # returns kW (average load of IT infrastructure)
|
35
35
|
quorum 'default' do
|
36
|
-
base.fallback.
|
36
|
+
base.fallback.electricity_intensity
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
@@ -53,15 +53,15 @@ module BrighterPlanet
|
|
53
53
|
end
|
54
54
|
end
|
55
55
|
|
56
|
-
committee :
|
56
|
+
committee :duration do # returns hours
|
57
57
|
quorum 'default' do
|
58
|
-
base.fallback.
|
58
|
+
base.fallback.duration
|
59
59
|
end
|
60
60
|
end
|
61
61
|
|
62
|
-
committee :
|
62
|
+
committee :ec2_compute_units do # returns compute units (EC2 instances)
|
63
63
|
quorum 'default' do
|
64
|
-
base.fallback.
|
64
|
+
base.fallback.ec2_compute_units
|
65
65
|
end
|
66
66
|
end
|
67
67
|
end
|
@@ -5,10 +5,10 @@ module BrighterPlanet
|
|
5
5
|
module Characterization
|
6
6
|
def self.included(base)
|
7
7
|
base.characterize do
|
8
|
-
has :
|
9
|
-
has :
|
8
|
+
has :duration
|
9
|
+
has :ec2_compute_units
|
10
10
|
has :zip_code
|
11
|
-
has :
|
11
|
+
has :electricity_intensity
|
12
12
|
has :power_usage_effectiveness
|
13
13
|
end
|
14
14
|
end
|
data/lib/computation/data.rb
CHANGED
@@ -4,10 +4,10 @@ module BrighterPlanet
|
|
4
4
|
def self.included(base)
|
5
5
|
base.data_miner do
|
6
6
|
schema do
|
7
|
-
float '
|
8
|
-
integer '
|
7
|
+
float 'duration'
|
8
|
+
integer 'ec2_compute_units'
|
9
9
|
string 'zip_code_name'
|
10
|
-
float '
|
10
|
+
float 'electricity_intensity'
|
11
11
|
float 'power_usage_effectiveness'
|
12
12
|
end
|
13
13
|
|
data/lib/computation/fallback.rb
CHANGED
@@ -2,10 +2,10 @@ module BrighterPlanet
|
|
2
2
|
module Computation
|
3
3
|
module Fallback
|
4
4
|
def self.included(base)
|
5
|
-
base.falls_back_on :
|
6
|
-
|
7
|
-
|
8
|
-
|
5
|
+
base.falls_back_on :duration => 1.0, # assume 1 hour
|
6
|
+
:ec2_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
|
+
: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
9
|
end
|
10
10
|
end
|
11
11
|
end
|
metadata
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: computation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
hash: 17
|
4
5
|
prerelease: false
|
5
6
|
segments:
|
6
7
|
- 0
|
7
8
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
9
|
+
- 7
|
10
|
+
version: 0.0.7
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
13
|
- Andy Rossmeissl
|
@@ -18,102 +19,108 @@ autorequire:
|
|
18
19
|
bindir: bin
|
19
20
|
cert_chain: []
|
20
21
|
|
21
|
-
date: 2010-10-
|
22
|
+
date: 2010-10-25 00:00:00 -07:00
|
22
23
|
default_executable:
|
23
24
|
dependencies:
|
24
25
|
- !ruby/object:Gem::Dependency
|
25
26
|
name: activerecord
|
27
|
+
prerelease: false
|
26
28
|
requirement: &id001 !ruby/object:Gem::Requirement
|
27
29
|
none: false
|
28
30
|
requirements:
|
29
31
|
- - ~>
|
30
32
|
- !ruby/object:Gem::Version
|
33
|
+
hash: 7
|
31
34
|
segments:
|
32
35
|
- 3
|
33
36
|
- 0
|
34
37
|
- 0
|
35
38
|
version: 3.0.0
|
36
39
|
type: :development
|
37
|
-
prerelease: false
|
38
40
|
version_requirements: *id001
|
39
41
|
- !ruby/object:Gem::Dependency
|
40
42
|
name: bundler
|
43
|
+
prerelease: false
|
41
44
|
requirement: &id002 !ruby/object:Gem::Requirement
|
42
45
|
none: false
|
43
46
|
requirements:
|
44
47
|
- - ~>
|
45
48
|
- !ruby/object:Gem::Version
|
49
|
+
hash: 23
|
46
50
|
segments:
|
47
51
|
- 1
|
48
52
|
- 0
|
49
53
|
- 0
|
50
54
|
version: 1.0.0
|
51
55
|
type: :development
|
52
|
-
prerelease: false
|
53
56
|
version_requirements: *id002
|
54
57
|
- !ruby/object:Gem::Dependency
|
55
58
|
name: cucumber
|
59
|
+
prerelease: false
|
56
60
|
requirement: &id003 !ruby/object:Gem::Requirement
|
57
61
|
none: false
|
58
62
|
requirements:
|
59
|
-
- -
|
63
|
+
- - ">="
|
60
64
|
- !ruby/object:Gem::Version
|
65
|
+
hash: 3
|
61
66
|
segments:
|
62
67
|
- 0
|
63
|
-
|
64
|
-
- 3
|
65
|
-
version: 0.8.3
|
68
|
+
version: "0"
|
66
69
|
type: :development
|
67
|
-
prerelease: false
|
68
70
|
version_requirements: *id003
|
69
71
|
- !ruby/object:Gem::Dependency
|
70
72
|
name: jeweler
|
73
|
+
prerelease: false
|
71
74
|
requirement: &id004 !ruby/object:Gem::Requirement
|
72
75
|
none: false
|
73
76
|
requirements:
|
74
77
|
- - ~>
|
75
78
|
- !ruby/object:Gem::Version
|
79
|
+
hash: 7
|
76
80
|
segments:
|
77
81
|
- 1
|
78
82
|
- 4
|
79
83
|
- 0
|
80
84
|
version: 1.4.0
|
81
85
|
type: :development
|
82
|
-
prerelease: false
|
83
86
|
version_requirements: *id004
|
84
87
|
- !ruby/object:Gem::Dependency
|
85
88
|
name: rake
|
89
|
+
prerelease: false
|
86
90
|
requirement: &id005 !ruby/object:Gem::Requirement
|
87
91
|
none: false
|
88
92
|
requirements:
|
89
93
|
- - ">="
|
90
94
|
- !ruby/object:Gem::Version
|
95
|
+
hash: 3
|
91
96
|
segments:
|
92
97
|
- 0
|
93
98
|
version: "0"
|
94
99
|
type: :development
|
95
|
-
prerelease: false
|
96
100
|
version_requirements: *id005
|
97
101
|
- !ruby/object:Gem::Dependency
|
98
102
|
name: rdoc
|
103
|
+
prerelease: false
|
99
104
|
requirement: &id006 !ruby/object:Gem::Requirement
|
100
105
|
none: false
|
101
106
|
requirements:
|
102
107
|
- - ">="
|
103
108
|
- !ruby/object:Gem::Version
|
109
|
+
hash: 3
|
104
110
|
segments:
|
105
111
|
- 0
|
106
112
|
version: "0"
|
107
113
|
type: :development
|
108
|
-
prerelease: false
|
109
114
|
version_requirements: *id006
|
110
115
|
- !ruby/object:Gem::Dependency
|
111
116
|
name: rspec
|
117
|
+
prerelease: false
|
112
118
|
requirement: &id007 !ruby/object:Gem::Requirement
|
113
119
|
none: false
|
114
120
|
requirements:
|
115
121
|
- - ~>
|
116
122
|
- !ruby/object:Gem::Version
|
123
|
+
hash: 62196417
|
117
124
|
segments:
|
118
125
|
- 2
|
119
126
|
- 0
|
@@ -122,37 +129,38 @@ dependencies:
|
|
122
129
|
- 17
|
123
130
|
version: 2.0.0.beta.17
|
124
131
|
type: :development
|
125
|
-
prerelease: false
|
126
132
|
version_requirements: *id007
|
127
133
|
- !ruby/object:Gem::Dependency
|
128
134
|
name: sniff
|
135
|
+
prerelease: false
|
129
136
|
requirement: &id008 !ruby/object:Gem::Requirement
|
130
137
|
none: false
|
131
138
|
requirements:
|
132
139
|
- - ~>
|
133
140
|
- !ruby/object:Gem::Version
|
141
|
+
hash: 17
|
134
142
|
segments:
|
135
143
|
- 0
|
136
144
|
- 2
|
137
145
|
- 3
|
138
146
|
version: 0.2.3
|
139
147
|
type: :development
|
140
|
-
prerelease: false
|
141
148
|
version_requirements: *id008
|
142
149
|
- !ruby/object:Gem::Dependency
|
143
150
|
name: emitter
|
151
|
+
prerelease: false
|
144
152
|
requirement: &id009 !ruby/object:Gem::Requirement
|
145
153
|
none: false
|
146
154
|
requirements:
|
147
155
|
- - ~>
|
148
156
|
- !ruby/object:Gem::Version
|
157
|
+
hash: 21
|
149
158
|
segments:
|
150
159
|
- 0
|
151
160
|
- 1
|
152
161
|
- 7
|
153
162
|
version: 0.1.7
|
154
163
|
type: :runtime
|
155
|
-
prerelease: false
|
156
164
|
version_requirements: *id009
|
157
165
|
description: A software model in Ruby for the greenhouse gas emissions of a computer's computations
|
158
166
|
email: andy@rossmeissl.net
|
@@ -191,7 +199,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
191
199
|
requirements:
|
192
200
|
- - ">="
|
193
201
|
- !ruby/object:Gem::Version
|
194
|
-
hash:
|
202
|
+
hash: 3
|
195
203
|
segments:
|
196
204
|
- 0
|
197
205
|
version: "0"
|
@@ -200,6 +208,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
200
208
|
requirements:
|
201
209
|
- - ">="
|
202
210
|
- !ruby/object:Gem::Version
|
211
|
+
hash: 3
|
203
212
|
segments:
|
204
213
|
- 0
|
205
214
|
version: "0"
|