This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import requests | |
| from random import randint | |
| from time import sleep | |
| from urllib.parse import urljoin | |
| val = randint(1, 100) | |
| requests.post( | |
| urljoin(host, '/api/v1/import/prometheus'), | |
| data=f'requests_per_second{{method="post"}} {val}' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Author: aurzenligl (https://stackoverflow.com/users/7249587/aurzenligl) | |
| # see https://stackoverflow.com/a/48836522/704244 | |
| from functools import wraps | |
| def _declassify(fun, args): | |
| if len(args): | |
| met = getattr(args[0], fun.__name__, None) | |
| if met: | |
| wrap = getattr(met, '__func__', None) | |
| if getattr(wrap, 'original', None) is fun: |