leaf-common 1.3.2__tar.gz → 1.3.3__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.
- {leaf_common-1.3.2 → leaf_common-1.3.3}/PKG-INFO +1 -1
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/asyncio/asyncio_executor.py +2 -2
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/asyncio/event_loop_lag_monitor.py +11 -10
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/config/environment_defaults.py +7 -7
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/persistence/mechanism/local_file_persistence_mechanism.py +10 -8
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/resolution/resolver.py +0 -1
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/time/time_util.py +5 -5
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common.egg-info/PKG-INFO +1 -1
- {leaf_common-1.3.2 → leaf_common-1.3.3}/.coveragerc +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/.flake8 +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/.github/workflows/checkmarx.yml +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/.github/workflows/codeql.yml +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/.github/workflows/publish.yml +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/.github/workflows/tests.yml +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/.gitignore +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/.pylintrc +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/CODE_OF_CONDUCT.md +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/CONTRIBUTING.md +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/LICENSE.txt +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/Makefile +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/NOTICE.txt +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/README.md +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/SECURITY.md +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/SUPPORT.md +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/build_scripts/copyright_config.json +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/build_scripts/run_flake8.sh +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/build_scripts/run_pylint.sh +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/build_scripts/source_available_copyright.txt +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/__init__.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/asyncio/__init__.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/asyncio/async_to_sync_generator.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/asyncio/asyncio_executor_pool.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/asyncio/asyncio_threadpool_executor.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/asyncio/event_loop_factory.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/asyncio/task_executor.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/config/__init__.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/config/config_filter.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/config/config_filter_chain.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/config/config_handler.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/config/config_util.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/config/dictionary_overlay.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/config/file_of_class.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/logging/__init__.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/logging/conditional_logger.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/logging/example_logging_config.hocon +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/logging/logging_setup.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/logging/message_types.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/logging/sensitive_logger.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/logging/service_log_record.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/logging/stream_to_logger.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/logging/structured_log_record.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/parsers/__init__.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/parsers/boolean_list_parser.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/parsers/boolean_parser.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/parsers/canonical_multi_config_parser.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/parsers/dictionary_extractor.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/parsers/field_extractor.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/parsers/list_parser.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/parsers/parser.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/parsers/string_parser.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/persistence/__init__.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/persistence/easy/__init__.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/persistence/easy/abstract_easy_persistence.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/persistence/easy/composite_persistor.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/persistence/easy/easy_hocon_persistence.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/persistence/easy/easy_json_persistence.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/persistence/easy/easy_txt_persistence.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/persistence/easy/easy_yaml_persistence.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/persistence/factory/README.md +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/persistence/factory/__init__.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/persistence/factory/abstract_persistence.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/persistence/factory/hocon_persistence.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/persistence/factory/json_gzip_persistence.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/persistence/factory/json_persistence.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/persistence/factory/null_persistence.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/persistence/factory/override_file_extension_provider.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/persistence/factory/persistence_factory.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/persistence/factory/raw_bytes_persistence.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/persistence/factory/reference_helper.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/persistence/factory/simple_file_persistence.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/persistence/factory/text_persistence.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/persistence/factory/yaml_persistence.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/persistence/interface/__init__.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/persistence/interface/persistence.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/persistence/interface/persistence_mechanism.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/persistence/interface/persistor.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/persistence/interface/restorer.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/persistence/mechanism/__init__.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/persistence/mechanism/abstract_persistence_mechanism.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/persistence/mechanism/persistence_mechanism_factory.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/persistence/mechanism/persistence_mechanisms.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/persistence/mechanism/s3_file_persistence_mechanism.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/profiling/__init__.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/profiling/async_profiling_lock.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/profiling/memory_util.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/profiling/profiling_lock.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/resolution/__init__.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/resolution/deprecation_redirect.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/resolution/resolver_util.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/serialization/__init__.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/serialization/format/__init__.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/serialization/format/buffered_gzip_serialization_format.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/serialization/format/chained_serialization_format.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/serialization/format/conversion_policy.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/serialization/format/gzip_serialization_format.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/serialization/format/hocon_serialization_format.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/serialization/format/json_serialization_format.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/serialization/format/raw_bytes_serialization_format.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/serialization/format/serialization_formats.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/serialization/format/text_serialization_format.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/serialization/format/yaml_serialization_format.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/serialization/interface/__init__.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/serialization/interface/deserializer.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/serialization/interface/dictionary_converter.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/serialization/interface/file_extension_provider.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/serialization/interface/reference_pruner.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/serialization/interface/serialization_format.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/serialization/interface/serializer.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/serialization/prep/__init__.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/serialization/prep/empty_dictionary_converter.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/serialization/prep/pass_through_dictionary_converter.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/serialization/prep/pass_through_reference_pruner.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/serialization/prep/redactor_dictionary_converter.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/serialization/util/__init__.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/serialization/util/bytes_decoder.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/serialization/util/text_file_reader.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/time/__init__.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/time/timeout.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/time/timeout_reached_exception.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/utils/__init__.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/utils/async_atomic_counter.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/utils/atomic_counter.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/utils/exception_util.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/utils/startable.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/validation/__init__.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/validation/composite_dictionary_validator.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/validation/dictionary_validator.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common.egg-info/SOURCES.txt +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common.egg-info/dependency_links.txt +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common.egg-info/requires.txt +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common.egg-info/top_level.txt +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/pyproject.toml +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/requirements-build.txt +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/requirements.txt +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/setup.cfg +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/tests/__init__.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/tests/asyncio/__init__.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/tests/asyncio/async_test_helpers.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/tests/asyncio/asyncio_executor_metrics_test.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/tests/asyncio/asyncio_executor_not_started_test.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/tests/asyncio/asyncio_executor_pool_dump_tasks_test.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/tests/asyncio/asyncio_executor_pool_gc_test.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/tests/asyncio/asyncio_executor_pool_metrics_test.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/tests/asyncio/asyncio_executor_started_test.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/tests/asyncio/asyncio_threadpool_executor_metrics_test.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/tests/asyncio/callable_class.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/tests/asyncio/event_loop_factory_test.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/tests/asyncio/sync_test_helpers.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/tests/config/__init__.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/tests/config/dictionary_overlay_test.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/tests/config/test_config_util.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/tests/parsers/__init__.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/tests/parsers/canonical_multi_config_parser_test.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/tests/resolution/__init__.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/tests/resolution/resolver_util_test.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/tests/resolution/test_deprecation_redirect.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/tests/serialization/__init__.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/tests/serialization/encoding/__init__.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/tests/serialization/encoding/decode_text_test.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/tests/serialization/encoding/text_file_reader_test.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/tests/serialization/format/__init__.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/tests/serialization/format/hocon_serialization_format_test.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/tests/serialization/prep/__init__.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/tests/serialization/prep/redactor_dictionary_converter_test.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/tests/time/__init__.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/tests/time/timeout_test.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/tests/utils/__init__.py +0 -0
- {leaf_common-1.3.2 → leaf_common-1.3.3}/tests/utils/test_exception_util.py +0 -0
|
@@ -418,8 +418,8 @@ class AsyncioExecutor(TaskExecutor):
|
|
|
418
418
|
|
|
419
419
|
# Get a dictionary entry describing some metadata about the future itself.
|
|
420
420
|
task_id: int = id(task)
|
|
421
|
-
|
|
422
|
-
task_info = self._background_tasks.get(task_id,
|
|
421
|
+
empty: Dict[str, Any] = {}
|
|
422
|
+
task_info: Dict[str, Any] = self._background_tasks.get(task_id, empty)
|
|
423
423
|
|
|
424
424
|
self._check_task(task)
|
|
425
425
|
origination: str = task.get_name()
|
|
@@ -18,9 +18,10 @@
|
|
|
18
18
|
See class comment for details
|
|
19
19
|
"""
|
|
20
20
|
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
21
|
+
from asyncio import create_task
|
|
22
|
+
from asyncio import sleep as async_sleep
|
|
23
|
+
from statistics import fmean
|
|
24
|
+
from time import monotonic
|
|
24
25
|
from typing import Any
|
|
25
26
|
from typing import Dict
|
|
26
27
|
from typing import List
|
|
@@ -68,10 +69,10 @@ class EventLoopLagMonitor:
|
|
|
68
69
|
"""
|
|
69
70
|
Sampling loop. Cancel the surrounding task to stop.
|
|
70
71
|
"""
|
|
71
|
-
expected =
|
|
72
|
+
expected = monotonic() + self.interval
|
|
72
73
|
while True:
|
|
73
|
-
await
|
|
74
|
-
now =
|
|
74
|
+
await async_sleep(self.interval)
|
|
75
|
+
now = monotonic()
|
|
75
76
|
lag = max(0.0, now - expected)
|
|
76
77
|
self._samples.append(lag)
|
|
77
78
|
|
|
@@ -80,16 +81,16 @@ class EventLoopLagMonitor:
|
|
|
80
81
|
# Clear the samples after reporting.
|
|
81
82
|
self._samples.clear()
|
|
82
83
|
if self.break_between_reports > 0:
|
|
83
|
-
await
|
|
84
|
+
await async_sleep(self.break_between_reports)
|
|
84
85
|
|
|
85
|
-
now =
|
|
86
|
+
now = monotonic()
|
|
86
87
|
expected = now + self.interval # resync so one big spike doesn't bias the rest
|
|
87
88
|
|
|
88
89
|
def start(self) -> None:
|
|
89
90
|
"""
|
|
90
91
|
Start the monitoring loop in a background task.
|
|
91
92
|
"""
|
|
92
|
-
self.task =
|
|
93
|
+
self.task = create_task(self.run())
|
|
93
94
|
|
|
94
95
|
def stop(self) -> None:
|
|
95
96
|
"""
|
|
@@ -119,7 +120,7 @@ class EventLoopLagMonitor:
|
|
|
119
120
|
p99 = samples_ms_sorted[min(int(n * 0.99), n - 1)]
|
|
120
121
|
self.max_p50_ms = max(self.max_p50_ms, p50)
|
|
121
122
|
self.max_p95_ms = max(self.max_p95_ms, p95)
|
|
122
|
-
mean_ms =
|
|
123
|
+
mean_ms = fmean(samples_ms)
|
|
123
124
|
max_samples_ms = max(samples_ms)
|
|
124
125
|
self.max_mean_ms = max(self.max_mean_ms, mean_ms)
|
|
125
126
|
self.max_max_ms = max(self.max_max_ms, max_samples_ms)
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
See class comment for details.
|
|
19
19
|
"""
|
|
20
20
|
|
|
21
|
-
import
|
|
21
|
+
from os import environ
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
class EnvironmentDefaults():
|
|
@@ -32,9 +32,9 @@ class EnvironmentDefaults():
|
|
|
32
32
|
def set_environment_defaults(cls, default_dict):
|
|
33
33
|
"""
|
|
34
34
|
:param default_dict: For each key in this dictionary, if there is
|
|
35
|
-
not a corresponding key in the
|
|
36
|
-
value in default_dict is added to the
|
|
37
|
-
Keys that are already in the
|
|
35
|
+
not a corresponding key in the environ dictionary, then the
|
|
36
|
+
value in default_dict is added to the environ dictionary.
|
|
37
|
+
Keys that are already in the environ dictionary are not
|
|
38
38
|
added.
|
|
39
39
|
:return: a dictionary of values that were added. This dictionary
|
|
40
40
|
could be empty if nothing was added, or None if default_dict
|
|
@@ -49,13 +49,13 @@ class EnvironmentDefaults():
|
|
|
49
49
|
for key in default_dict.keys():
|
|
50
50
|
|
|
51
51
|
# See if the key exists
|
|
52
|
-
existing_value =
|
|
52
|
+
existing_value = environ.get(key, None)
|
|
53
53
|
if existing_value is None:
|
|
54
54
|
|
|
55
55
|
# Key does not exist, add from defaults
|
|
56
|
-
#
|
|
56
|
+
# environ values must be strings
|
|
57
57
|
new_value = str(default_dict.get(key))
|
|
58
|
-
|
|
58
|
+
environ[key] = new_value
|
|
59
59
|
added[key] = new_value
|
|
60
60
|
|
|
61
61
|
return added
|
|
@@ -17,9 +17,11 @@
|
|
|
17
17
|
"""
|
|
18
18
|
See class comment for details.
|
|
19
19
|
"""
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
20
|
+
from io import StringIO
|
|
21
|
+
from logging import getLogger
|
|
22
|
+
from logging import Logger
|
|
23
|
+
from os import makedirs
|
|
24
|
+
from os.path import dirname
|
|
23
25
|
|
|
24
26
|
from leaf_common.persistence.mechanism.abstract_persistence_mechanism \
|
|
25
27
|
import AbstractPersistenceMechanism
|
|
@@ -55,7 +57,7 @@ class LocalFilePersistenceMechanism(AbstractPersistenceMechanism):
|
|
|
55
57
|
this call.
|
|
56
58
|
"""
|
|
57
59
|
path = self.get_path(file_extension_provider, file_reference)
|
|
58
|
-
logger =
|
|
60
|
+
logger: Logger = getLogger(__name__)
|
|
59
61
|
logger.info("Reading %s", str(path))
|
|
60
62
|
|
|
61
63
|
fileobj = None
|
|
@@ -89,15 +91,15 @@ class LocalFilePersistenceMechanism(AbstractPersistenceMechanism):
|
|
|
89
91
|
with data by this call.
|
|
90
92
|
"""
|
|
91
93
|
path = self.get_path(file_extension_provider, file_reference)
|
|
92
|
-
logger =
|
|
94
|
+
logger: Logger = getLogger(__name__)
|
|
93
95
|
logger.info("Writing %s", str(path))
|
|
94
96
|
|
|
95
|
-
dirs =
|
|
96
|
-
|
|
97
|
+
dirs = dirname(path)
|
|
98
|
+
makedirs(dirs, exist_ok=True)
|
|
97
99
|
|
|
98
100
|
# Allow for string or bytes as input
|
|
99
101
|
writestyle = "wb"
|
|
100
|
-
if isinstance(send_from_fileobj,
|
|
102
|
+
if isinstance(send_from_fileobj, StringIO):
|
|
101
103
|
writestyle = "w"
|
|
102
104
|
|
|
103
105
|
return open(path, writestyle)
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
See class comment for details
|
|
19
19
|
"""
|
|
20
20
|
|
|
21
|
-
import datetime
|
|
21
|
+
from datetime import datetime
|
|
22
22
|
|
|
23
23
|
from pytz import timezone
|
|
24
24
|
|
|
@@ -33,9 +33,9 @@ class TimeUtil:
|
|
|
33
33
|
"""
|
|
34
34
|
Creates a nicely formated timestamp
|
|
35
35
|
"""
|
|
36
|
-
|
|
36
|
+
now_for_local = datetime.now()
|
|
37
37
|
|
|
38
|
-
local_now =
|
|
38
|
+
local_now = now_for_local.astimezone()
|
|
39
39
|
use_tz = local_now.tzinfo
|
|
40
40
|
|
|
41
41
|
# If the user's machine doesn't care about the time zone,
|
|
@@ -44,7 +44,7 @@ class TimeUtil:
|
|
|
44
44
|
if local_tzname == "UTC":
|
|
45
45
|
use_tz = timezone('US/Pacific')
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
formatted_time =
|
|
47
|
+
now_with_tz = datetime.now(use_tz)
|
|
48
|
+
formatted_time = now_with_tz.strftime("%Y-%m-%d %H:%M:%S %Z%z")
|
|
49
49
|
|
|
50
50
|
return formatted_time
|
|
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
|
{leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/parsers/canonical_multi_config_parser.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
|
{leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/persistence/easy/abstract_easy_persistence.py
RENAMED
|
File without changes
|
|
File without changes
|
{leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/persistence/easy/easy_hocon_persistence.py
RENAMED
|
File without changes
|
{leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/persistence/easy/easy_json_persistence.py
RENAMED
|
File without changes
|
{leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/persistence/easy/easy_txt_persistence.py
RENAMED
|
File without changes
|
{leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/persistence/easy/easy_yaml_persistence.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/persistence/factory/abstract_persistence.py
RENAMED
|
File without changes
|
{leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/persistence/factory/hocon_persistence.py
RENAMED
|
File without changes
|
{leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/persistence/factory/json_gzip_persistence.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/persistence/factory/persistence_factory.py
RENAMED
|
File without changes
|
{leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/persistence/factory/raw_bytes_persistence.py
RENAMED
|
File without changes
|
|
File without changes
|
{leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/persistence/factory/simple_file_persistence.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/persistence/interface/persistence_mechanism.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/persistence/mechanism/persistence_mechanisms.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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/serialization/format/conversion_policy.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/serialization/format/serialization_formats.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/serialization/interface/dictionary_converter.py
RENAMED
|
File without changes
|
|
File without changes
|
{leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/serialization/interface/reference_pruner.py
RENAMED
|
File without changes
|
{leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/serialization/interface/serialization_format.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/serialization/prep/empty_dictionary_converter.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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{leaf_common-1.3.2 → leaf_common-1.3.3}/leaf_common/validation/composite_dictionary_validator.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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{leaf_common-1.3.2 → leaf_common-1.3.3}/tests/asyncio/asyncio_executor_pool_dump_tasks_test.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{leaf_common-1.3.2 → leaf_common-1.3.3}/tests/asyncio/asyncio_threadpool_executor_metrics_test.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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{leaf_common-1.3.2 → leaf_common-1.3.3}/tests/serialization/encoding/text_file_reader_test.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
|