c2cwsgiutils 6.1.7__tar.gz → 6.1.7.dev2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/PKG-INFO +1 -1
- {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/acceptance/image.py +3 -10
- {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/prometheus.py +3 -9
- {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/pyproject.toml +1 -1
- {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/LICENSE +0 -0
- {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/README.md +0 -0
- {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/__init__.py +0 -0
- {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/acceptance/__init__.py +0 -0
- {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/acceptance/connection.py +0 -0
- {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/acceptance/package-lock.json +0 -0
- {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/acceptance/package.json +0 -0
- {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/acceptance/print.py +0 -0
- {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/acceptance/screenshot.js +0 -0
- {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/acceptance/utils.py +0 -0
- {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/auth.py +0 -0
- {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/broadcast/__init__.py +0 -0
- {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/broadcast/interface.py +0 -0
- {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/broadcast/local.py +0 -0
- {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/broadcast/redis.py +0 -0
- {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/broadcast/utils.py +0 -0
- {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/client_info.py +0 -0
- {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/config_utils.py +0 -0
- {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/coverage_setup.py +0 -0
- {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/db.py +0 -0
- {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/db_maintenance_view.py +0 -0
- {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/debug/__init__.py +0 -0
- {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/debug/_listeners.py +0 -0
- {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/debug/_views.py +0 -0
- {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/debug/utils.py +0 -0
- {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/errors.py +0 -0
- {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/health_check.py +0 -0
- {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/index.py +0 -0
- {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/loader.py +0 -0
- {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/logging_view.py +0 -0
- {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/models_graph.py +0 -0
- {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/pretty_json.py +0 -0
- {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/profiler.py +0 -0
- {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/py.typed +0 -0
- {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/pyramid.py +0 -0
- {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/pyramid_logging.py +0 -0
- {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/redis_stats.py +0 -0
- {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/redis_utils.py +0 -0
- {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/request_tracking/__init__.py +0 -0
- {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/request_tracking/_sql.py +0 -0
- {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/scripts/__init__.py +0 -0
- {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/scripts/genversion.py +0 -0
- {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/scripts/stats_db.py +0 -0
- {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/scripts/test_print.py +0 -0
- {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/sentry.py +0 -0
- {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/services.py +0 -0
- {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/setup_process.py +0 -0
- {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/sql_profiler/__init__.py +0 -0
- {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/sql_profiler/_impl.py +0 -0
- {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/sqlalchemylogger/README.md +0 -0
- {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/sqlalchemylogger/__init__.py +0 -0
- {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/sqlalchemylogger/_filters.py +0 -0
- {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/sqlalchemylogger/_models.py +0 -0
- {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/sqlalchemylogger/examples/example.py +0 -0
- {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/sqlalchemylogger/handlers.py +0 -0
- {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/static/favicon-16x16.png +0 -0
- {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/static/favicon-32x32.png +0 -0
- {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/stats_pyramid/__init__.py +0 -0
- {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/stats_pyramid/_db_spy.py +0 -0
- {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/stats_pyramid/_pyramid_spy.py +0 -0
- {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/templates/index.html.mako +0 -0
- {c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/version.py +0 -0
@@ -58,7 +58,7 @@ def normalize_image(image: NpNdarrayInt) -> NpNdarrayInt:
|
|
58
58
|
return image
|
59
59
|
|
60
60
|
|
61
|
-
def check_image(
|
61
|
+
def check_image(
|
62
62
|
result_folder: str,
|
63
63
|
image_to_check: NpNdarrayInt,
|
64
64
|
expected_filename: str,
|
@@ -108,13 +108,6 @@ def check_image( # pylint: disable=too-many-locals,too-many-statements
|
|
108
108
|
|
109
109
|
mask = None
|
110
110
|
if mask_filename is not None:
|
111
|
-
background_color = [255, 255, 255]
|
112
|
-
for color in range(3):
|
113
|
-
img_hist, _ = skimage.exposure.histogram(
|
114
|
-
image_to_check[..., color], nbins=256, source_range="dtype"
|
115
|
-
)
|
116
|
-
background_color[color] = np.argmax(img_hist)
|
117
|
-
|
118
111
|
mask = skimage.io.imread(mask_filename)
|
119
112
|
|
120
113
|
assert mask is not None, "Wrong mask: " + mask_filename
|
@@ -137,7 +130,7 @@ def check_image( # pylint: disable=too-many-locals,too-many-statements
|
|
137
130
|
assert (
|
138
131
|
mask.shape[0] == image_to_check.shape[0] and mask.shape[1] == image_to_check.shape[1]
|
139
132
|
), f"Mask and image should have the same shape ({mask.shape} != {image_to_check.shape})"
|
140
|
-
image_to_check[mask] =
|
133
|
+
image_to_check[mask] = [255, 255, 255]
|
141
134
|
|
142
135
|
if not os.path.exists(result_folder):
|
143
136
|
os.makedirs(result_folder)
|
@@ -155,7 +148,7 @@ def check_image( # pylint: disable=too-many-locals,too-many-statements
|
|
155
148
|
assert (
|
156
149
|
expected.shape[0] == mask.shape[0] and expected.shape[1] == mask.shape[1]
|
157
150
|
), f"Mask and expected image should have the same shape ({mask.shape} != {expected.shape})"
|
158
|
-
expected[mask] =
|
151
|
+
expected[mask] = [255, 255, 255]
|
159
152
|
|
160
153
|
assert (
|
161
154
|
expected.shape == image_to_check.shape
|
@@ -1,6 +1,5 @@
|
|
1
1
|
"""Every thing we needs to have the metrics in Prometheus."""
|
2
2
|
|
3
|
-
import logging
|
4
3
|
import os
|
5
4
|
import re
|
6
5
|
from collections.abc import Generator, Iterable
|
@@ -12,12 +11,10 @@ import prometheus_client.metrics_core
|
|
12
11
|
import prometheus_client.multiprocess
|
13
12
|
import prometheus_client.registry
|
14
13
|
import pyramid.config
|
15
|
-
import redis.exceptions
|
16
14
|
|
17
15
|
from c2cwsgiutils import broadcast, redis_utils
|
18
16
|
from c2cwsgiutils.debug.utils import dump_memory_maps
|
19
17
|
|
20
|
-
_LOG = logging.getLogger(__name__)
|
21
18
|
_NUMBER_RE = re.compile(r"^[0-9]+$")
|
22
19
|
MULTI_PROCESS_COLLECTOR_BROADCAST_CHANNELS = [
|
23
20
|
"c2cwsgiutils_prometheus_collector_gc",
|
@@ -120,12 +117,9 @@ class MultiProcessCustomCollector(prometheus_client.registry.Collector):
|
|
120
117
|
def collect(self) -> Generator[prometheus_client.core.Metric, None, None]:
|
121
118
|
results: list[list[SerializedMetric]] = []
|
122
119
|
for channel in MULTI_PROCESS_COLLECTOR_BROADCAST_CHANNELS:
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
results.extend(cast(Iterable[list[SerializedMetric]], result))
|
127
|
-
except redis.exceptions.ConnectionError:
|
128
|
-
_LOG.error("Failed to get the metrics from the other processes")
|
120
|
+
result = broadcast.broadcast(channel, expect_answers=True)
|
121
|
+
if result is not None:
|
122
|
+
results.extend(cast(Iterable[list[SerializedMetric]], result))
|
129
123
|
return _deserialize_collected_data(results)
|
130
124
|
|
131
125
|
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{c2cwsgiutils-6.1.7 → c2cwsgiutils-6.1.7.dev2}/c2cwsgiutils/sqlalchemylogger/examples/example.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|