Compare commits

..

2 Commits

Author SHA1 Message Date
Simple_Not
8d684856c9 more metrics
All checks were successful
continuous-integration/drone/push Build is passing
2023-06-21 12:33:09 +10:00
Simple_Not
ae21a176f7 more metrics 2023-06-21 12:30:26 +10:00

View File

@ -44,6 +44,8 @@ def get_top_dicks():
return top
@app.route('/metrics')
def metrics():
metrics = ""
@ -53,7 +55,7 @@ def metrics():
# текущий размер пипис
for dick in docks:
metrics += 'pipisio{user="%s", user_id="%s", chat_id="%s"} %s\n' % (dick[0], dick[2], dick[3], dick[1])
# расстояние до следующего впереди
for k in range(len(docks)):
@ -68,12 +70,9 @@ def metrics():
while i > 0 and upper_dick_size == docks[k][1]:
i -= 1
upper_dick_size = docks[i][1]
if i == 0:
metrics += 'pipisio_topdick_distanso{user="%s", user_id="%s", chat_id="%s"} %s\n' % (docks[k][0], docks[k][2], docks[k][3], 0)
else:
metrics += 'pipisio_topdick_distanso{user="%s", user_id="%s", chat_id="%s"} %s\n' % (docks[k][0], docks[k][2], docks[k][3], (upper_dick_size - docks[k][1]))
metrics += 'pipisio_topdick_distanso{user="%s", user_id="%s", chat_id="%s"} %s\n' % (docks[k][0], docks[k][2], docks[k][3], (upper_dick_size - docks[k][1]))
return metrics
if __name__ == '__main__':