Revert "add shoddy statsd support"
This reverts commit 8c0c521f6f
.
yea this is useless and a waste of time
This commit is contained in:
parent
81409673f3
commit
d2c3f7025c
3
app.py
3
app.py
|
@ -9,7 +9,6 @@ from flask_limiter import Limiter
|
||||||
from flask_limiter.util import get_remote_address
|
from flask_limiter.util import get_remote_address
|
||||||
from lib import get_viewer
|
from lib import get_viewer
|
||||||
import os
|
import os
|
||||||
from lib.statsd import StatsdMiddleware
|
|
||||||
|
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
|
|
||||||
|
@ -90,5 +89,3 @@ def install_security_headers(resp):
|
||||||
resp.headers.set('x-xss-protection', '1')
|
resp.headers.set('x-xss-protection', '1')
|
||||||
|
|
||||||
return resp
|
return resp
|
||||||
|
|
||||||
app.wsgi_app = StatsdMiddleware(app.wsgi_app)
|
|
||||||
|
|
|
@ -1,16 +0,0 @@
|
||||||
import time
|
|
||||||
from statsd.defaults.env import statsd
|
|
||||||
|
|
||||||
class StatsdMiddleware(object):
|
|
||||||
def __init__(self, app):
|
|
||||||
self.app = app
|
|
||||||
|
|
||||||
def __call__(self, environ, start_response):
|
|
||||||
timer_name = 'forget.http.{}.{}'.format(
|
|
||||||
environ.get('PATH_INFO').replace('/', '.').strip('.') or 'index',
|
|
||||||
environ.get('REQUEST_METHOD'))
|
|
||||||
with statsd.timer(timer_name):
|
|
||||||
response = self.app(environ, start_response)
|
|
||||||
|
|
||||||
return response
|
|
||||||
|
|
|
@ -42,4 +42,3 @@ urllib3==1.22
|
||||||
vine==1.1.4
|
vine==1.1.4
|
||||||
Werkzeug==0.12.2
|
Werkzeug==0.12.2
|
||||||
git+https://github.com/codl/Mastodon.py.git@forget
|
git+https://github.com/codl/Mastodon.py.git@forget
|
||||||
statsd==3.2.1
|
|
||||||
|
|
Loading…
Reference in New Issue