Revert "add shoddy statsd support"

This reverts commit 8c0c521f6f.

yea this is useless and a waste of time
This commit is contained in:
codl 2017-08-28 23:25:26 +02:00
parent 81409673f3
commit d2c3f7025c
No known key found for this signature in database
GPG Key ID: 6CD7C8891ED1233A
3 changed files with 0 additions and 20 deletions

3
app.py
View File

@ -9,7 +9,6 @@ from flask_limiter import Limiter
from flask_limiter.util import get_remote_address
from lib import get_viewer
import os
from lib.statsd import StatsdMiddleware
app = Flask(__name__)
@ -90,5 +89,3 @@ def install_security_headers(resp):
resp.headers.set('x-xss-protection', '1')
return resp
app.wsgi_app = StatsdMiddleware(app.wsgi_app)

View File

@ -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

View File

@ -42,4 +42,3 @@ urllib3==1.22
vine==1.1.4
Werkzeug==0.12.2
git+https://github.com/codl/Mastodon.py.git@forget
statsd==3.2.1