You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#!/usr/local/bin/python
# coding: utf-8
from prometheus_client import start_http_server, Summary
import random
import time
# Create a metric to track time spent and requests made.
REQUEST_TIME = Summary('request_processing_seconds', 'Time spent processing request')
# Decorate function with metric.
@REQUEST_TIME.time()
def process_request(t):
"""A dummy function that takes some time."""
time.sleep(t)
if __name__ == '__main__':
# Start up the server to expose the metrics.
start_http_server(8000)
# Generate some requests.
while True:
process_request(random.random())
tried to exceute on Windows Server 2008, with python 3.7 and returned error
Traceback (most recent call last):
File "c:/Reposiroties/projects/um_open/templates/Test/Prometheus_Client.py", line 4, in <module>
from prometheus_client import start_http_server, Summary
File "C:\Software\Python37\lib\site-packages\prometheus_client\__init__.py", line 4, in <module>
from . import exposition
File "C:\Software\Python37\lib\site-packages\prometheus_client\exposition.py", line 31, in <module>
PYTHON26_OR_OLDER = tuple(int(val) for val in sys.version.split()[0].split('.')) < (2, 7, 0)
File "C:\Software\Python37\lib\site-packages\prometheus_client\exposition.py", line 31, in <genexpr>
PYTHON26_OR_OLDER = tuple(int(val) for val in sys.version.split()[0].split('.')) < (2, 7, 0)
ValueError: invalid literal for int() with base 10: '0a2'
Prometheus_client can be used on OS windows and python version higher 3.5?
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
Hello,
try to wrote prometheus_client
took simple code,
tried to exceute on Windows Server 2008, with python 3.7 and returned error
Prometheus_client can be used on OS windows and python version higher 3.5?
The text was updated successfully, but these errors were encountered: