metrics.py 883 B

123456789101112131415161718192021222324252627282930
  1. from core.constants import *
  2. import config
  3. def percent_change(start, end):
  4. difference = end - start
  5. change = (difference / start) * 100 if start!=0 else 0
  6. return change
  7. #def slot_number_at_target(count, supply, target_reached):
  8. # if target_reached == False:
  9. # if supply > target:
  10. # target_reached = True
  11. # get_slot_time(count)
  12. # return target_reached
  13. #
  14. #target = ERC20DRK * config.exchange_rate
  15. #
  16. #def get_slot_time(count):
  17. # # @ 90 seconds per slot
  18. # slots_per_day = 960
  19. # slots_per_month = 28800
  20. # slots_per_year = slots_per_month * 12
  21. #
  22. # days = count / slots_per_day
  23. # months = count / slots_per_month
  24. # years = count / slots_per_year
  25. #
  26. # print("Target supply of", str(target), "DRK was achieved after: ",
  27. # str(count), "slots", str(days), "(D)", str(months), "(M)",
  28. # str(years), "(Y)")