@@ -58,6 +58,8 @@ class ComputeEngineGenerator(GCPGenerator):
58
58
59
59
LABELS = (([{"key" : "vm_key_proj2" , "value" : "vm_label_proj2" }]), ([]))
60
60
61
+ EFFECTIVE_PRICE = ("0.0114" , "0.0417" , "0.1922" , "0.0452" )
62
+
61
63
def __init__ (self , start_date , end_date , currency , project , attributes = None ): # noqa: C901
62
64
"""Initialize the cloud storage generator."""
63
65
super ().__init__ (start_date , end_date , currency , project , attributes )
@@ -123,6 +125,9 @@ def _update_data(self, row): # noqa: C901
123
125
row ["currency" ] = self ._currency
124
126
row ["labels" ] = self .determine_labels (self .LABELS )
125
127
row ["system_labels" ] = self .determine_system_labels (sku [3 ])
128
+ row ["price.effective_price" ] = choice (self .EFFECTIVE_PRICE )
129
+ row ["disk_size" ] = self ._generate_disk_size (row ["cost" ], row ["price.effective_price" ])
130
+
126
131
if self .resource_level :
127
132
resource = self ._generate_resource (
128
133
self ._resource_name , self ._resource_global_name , self .project .get ("region" )
@@ -183,6 +188,10 @@ def _update_data(self, row): # noqa: C901
183
188
month = datetime .strptime (row .get ("usage_start_time" )[:7 ], "%Y-%m" ).month
184
189
invoice ["month" ] = f"{ year } { month :02d} "
185
190
row ["invoice" ] = invoice
191
+ effective_price = choice (self .EFFECTIVE_PRICE )
192
+ row ["price" ] = {"effective_price" : effective_price }
193
+ row ["disk_size" ] = self ._generate_disk_size (row ["cost" ], row ["price" ]["effective_price" ])
194
+
186
195
if self .resource_level :
187
196
resource = self ._generate_resource ()
188
197
row ["resource" ] = resource
0 commit comments