Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 23 lines (19 sloc) 671 Bytes
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.
def process_request(t):
"""A dummy function that takes some time."""
if __name__ == '__main__':
# Start up the server to expose the metrics.
# http://localhost:8000/metrics
# Generate some requests.
while True:
You can’t perform that action at this time.