Skip to content

Commit

Permalink
add rate values
Browse files Browse the repository at this point in the history
  • Loading branch information
eumel8 committed Oct 30, 2023
1 parent 4182d21 commit 43fa107
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions flask/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,11 @@ def metrics():
result_b19=0
#######################################
# Summary Energy Generation
result_sum = int(result_b01) + int(result_b02) + int(result_b04) + int(result_b04) + int(result_b09) + int(result_b10) + int(result_b11) + int(result_b12) + int(result_b14) + int(result_b16) + int(result_b18) + int(result_b18) + int(result_b19)

result_sum = int(result_b01) + int(result_b02) + int(result_b04) + int(result_b05) + int(result_b09) + int(result_b10) + int(result_b11) + int(result_b12) + int(result_b14) + int(result_b16) + int(result_b17) + int(result_b18) + int(result_b19)
# Bio efficience
result_bio = int(result_b01) + int(result_b09) + int(result_b10) + int(result_b11) + int(result_b12) + int(result_b16) + int(result_b17) + int(result_b18) + int(result_b19) / int(result_sum)
# Fossil part
result_fos = int(result_b02) + int(result_b04) + int(result_b04) / int(result_sum)
# Print Out Metrics
counter = "# HELP entsoe_generation_b01 Current generation of energy with Biomass in MW" + "\n"
counter += "# TYPE entsoe_generation_b01 counter" + "\n"
Expand Down Expand Up @@ -174,6 +177,12 @@ def metrics():
counter += "# HELP entsoe_generation_sum Current generation of energy summary in MW" + "\n"
counter += "# TYPE entsoe_generation_sum counter" + "\n"
counter += "entsoe_generation_sum " + str(result_sum) + "\n"
counter += "# HELP entsoe_generation_bio Current generation of bio energy summary rate" + "\n"
counter += "# TYPE entsoe_generation_bio counter" + "\n"
counter += "entsoe_generation_bio " + str(result_bio) + "\n"
counter += "# HELP entsoe_generation_fos Current generation of fossil energy summary rate" + "\n"
counter += "# TYPE entsoe_generation_fos counter" + "\n"
counter += "entsoe_generation_fos " + str(result_fos) + "\n"

#json_data = json.dumps(data_dict)
#print(json_data,file=open('data.json','w'))
Expand Down

0 comments on commit 43fa107

Please sign in to comment.