from django.http import Http404
from django_statsd.clients import statsd


class GraphiteMiddleware(object):
    def process_response(self, request, response):
        statsd.incr("response.%s" % response.status_code)
        return response

    def process_exception(self, request, exception):
        if not isinstance(exception, Http404):
            statsd.incr("response.500")

class GraphiteMiddleware(object):
    def process_response(self, request, response):
        return response

Remove statsd code and resultant redundant code
Remove statsd code and resultant redundant code
- from django.http import Http404
- from django_statsd.clients import statsd
- 
- 
  class GraphiteMiddleware(object):
      def process_response(self, request, response):
-         statsd.incr("response.%s" % response.status_code)
          return response
  
-     def process_exception(self, request, exception):
-         if not isinstance(exception, Http404):
-             statsd.incr("response.500")
- 
Remove statsd code and resultant redundant code
## Code Before:
from django.http import Http404
from django_statsd.clients import statsd


class GraphiteMiddleware(object):
    def process_response(self, request, response):
        statsd.incr("response.%s" % response.status_code)
        return response

    def process_exception(self, request, exception):
        if not isinstance(exception, Http404):
            statsd.incr("response.500")

## Instruction:
Remove statsd code and resultant redundant code
## Code After:
class GraphiteMiddleware(object):
    def process_response(self, request, response):
        return response
