Skip to content

Commit cf2e910

Browse files
authored
Merge pull request #169 from asherf/md
run isort
2 parents 4d578e0 + 6204123 commit cf2e910

File tree

17 files changed

+20
-23
lines changed

17 files changed

+20
-23
lines changed

django_prometheus/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
33
https://github.com/korfuri/django-prometheus
44
"""
5+
56
# Import all files that define metrics. This has the effect that
67
# `import django_prometheus` will always instanciate all metric
78
# objects right away.
8-
from django_prometheus import middleware
9-
from django_prometheus import models
9+
from django_prometheus import middleware, models
1010

1111
__all__ = ["middleware", "models", "pip_prometheus"]
1212

django_prometheus/cache/backends/django_memcached_consul.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
from __future__ import absolute_import
22

3+
from django_memcached_consul import memcached
34
from django_prometheus.cache.metrics import (
45
django_cache_get_total,
56
django_cache_hits_total,
67
django_cache_misses_total,
78
)
89

9-
from django_memcached_consul import memcached
10-
1110

1211
class MemcachedCache(memcached.MemcachedCache):
1312
"""Inherit django_memcached_consul to add metrics about hit/miss ratio"""

django_prometheus/cache/backends/filebased.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from django.core.cache.backends import filebased
2+
23
from django_prometheus.cache.metrics import (
34
django_cache_get_total,
45
django_cache_hits_total,

django_prometheus/cache/backends/redis.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1+
from django_redis import cache, exceptions
2+
13
from django_prometheus.cache.metrics import (
24
django_cache_get_fail_total,
35
django_cache_get_total,
46
django_cache_hits_total,
57
django_cache_misses_total,
68
)
79

8-
from django_redis import cache, exceptions
9-
1010

1111
class RedisCache(cache.RedisCache):
1212
"""Inherit redis to add metrics about hit/miss/interruption ratio"""

django_prometheus/db/backends/postgresql/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
from django_prometheus.db.common import DatabaseWrapperMixin, ExportingCursorWrapper
2-
31
import psycopg2.extensions
42
from django.db.backends.postgresql import base
53

4+
from django_prometheus.db.common import DatabaseWrapperMixin, ExportingCursorWrapper
5+
66

77
class DatabaseFeatures(base.DatabaseFeatures):
88
"""Our database has the exact same features as the base one."""

django_prometheus/db/common.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
from django_prometheus.db import (
22
connection_errors_total,
33
connections_total,
4-
execute_total,
5-
execute_many_total,
64
errors_total,
5+
execute_many_total,
6+
execute_total,
77
)
88

99

django_prometheus/exports.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import socket
21
import logging
32
import os
4-
import prometheus_client
3+
import socket
54
import threading
65

6+
import prometheus_client
77
from django.conf import settings
88
from django.http import HttpResponse
99
from prometheus_client import multiprocess

django_prometheus/middleware.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
from django.utils.deprecation import MiddlewareMixin
22
from prometheus_client import Counter, Histogram
33

4-
from django_prometheus.utils import Time, TimeSince, PowersOf
5-
4+
from django_prometheus.utils import PowersOf, Time, TimeSince
65

76
requests_total = Counter(
87
"django_http_requests_before_middlewares_total",

django_prometheus/migrations.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from django.db import connections
22
from django.db.backends.dummy.base import DatabaseWrapper
3-
43
from prometheus_client import Gauge
54

65
unapplied_migrations = Gauge(

django_prometheus/tests/end2end/testapp/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from django.db.models import Model, CharField, PositiveIntegerField
1+
from django.db.models import CharField, Model, PositiveIntegerField
22

33
from django_prometheus.models import ExportModelOperationsMixin
44

0 commit comments

Comments
 (0)