improve metrics gathered using in our traffic section

this also pulls out the middleware into its own home and inserts in front
This commit is contained in:
Sam
2015-02-05 16:08:52 +11:00
parent ebc2ad7c81
commit 08b790b3c2
14 changed files with 188 additions and 104 deletions

View File

@ -1,9 +1,9 @@
class ApplicationRequest < ActiveRecord::Base
enum req_type: %i(anon logged_in crawler)
enum req_type: %i(total success background topic_anon topic_logged_in topic_crawler server_error client_error redirect)
cattr_accessor :autoflush
# auto flush if backlog is larger than this
self.autoflush = 100
self.autoflush = 200
def self.increment!(type, opts=nil)
key = redis_key(type)