exonware-xwsystem 0.1.0.1__py3-none-any.whl → 0.1.0.4__py3-none-any.whl
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.
- exonware/__init__.py +2 -1
- exonware/conf.py +2 -2
- exonware/xwsystem/__init__.py +115 -43
- exonware/xwsystem/base.py +30 -0
- exonware/xwsystem/caching/__init__.py +39 -13
- exonware/xwsystem/caching/base.py +24 -6
- exonware/xwsystem/caching/bloom_cache.py +2 -2
- exonware/xwsystem/caching/cache_manager.py +2 -1
- exonware/xwsystem/caching/conditional.py +2 -2
- exonware/xwsystem/caching/contracts.py +85 -139
- exonware/xwsystem/caching/decorators.py +6 -19
- exonware/xwsystem/caching/defs.py +2 -1
- exonware/xwsystem/caching/disk_cache.py +2 -1
- exonware/xwsystem/caching/distributed.py +2 -1
- exonware/xwsystem/caching/errors.py +2 -1
- exonware/xwsystem/caching/events.py +110 -27
- exonware/xwsystem/caching/eviction_strategies.py +2 -2
- exonware/xwsystem/caching/external_caching_python.py +701 -0
- exonware/xwsystem/caching/facade.py +253 -0
- exonware/xwsystem/caching/factory.py +300 -0
- exonware/xwsystem/caching/fluent.py +14 -12
- exonware/xwsystem/caching/integrity.py +21 -6
- exonware/xwsystem/caching/lfu_cache.py +2 -1
- exonware/xwsystem/caching/lfu_optimized.py +18 -6
- exonware/xwsystem/caching/lru_cache.py +7 -4
- exonware/xwsystem/caching/memory_bounded.py +2 -2
- exonware/xwsystem/caching/metrics_exporter.py +2 -2
- exonware/xwsystem/caching/observable_cache.py +2 -2
- exonware/xwsystem/caching/pluggable_cache.py +2 -2
- exonware/xwsystem/caching/rate_limiter.py +2 -2
- exonware/xwsystem/caching/read_through.py +2 -2
- exonware/xwsystem/caching/secure_cache.py +81 -28
- exonware/xwsystem/caching/serializable.py +9 -7
- exonware/xwsystem/caching/stats.py +2 -2
- exonware/xwsystem/caching/tagging.py +2 -2
- exonware/xwsystem/caching/ttl_cache.py +4 -3
- exonware/xwsystem/caching/two_tier_cache.py +6 -3
- exonware/xwsystem/caching/utils.py +30 -12
- exonware/xwsystem/caching/validation.py +2 -2
- exonware/xwsystem/caching/warming.py +6 -3
- exonware/xwsystem/caching/write_behind.py +15 -6
- exonware/xwsystem/config/__init__.py +11 -17
- exonware/xwsystem/config/base.py +5 -5
- exonware/xwsystem/config/contracts.py +93 -153
- exonware/xwsystem/config/defaults.py +3 -2
- exonware/xwsystem/config/defs.py +3 -2
- exonware/xwsystem/config/errors.py +2 -5
- exonware/xwsystem/config/logging.py +12 -8
- exonware/xwsystem/config/logging_setup.py +3 -2
- exonware/xwsystem/config/performance.py +1 -46
- exonware/xwsystem/config/performance_modes.py +9 -8
- exonware/xwsystem/config/version_manager.py +1 -0
- exonware/xwsystem/config.py +27 -0
- exonware/xwsystem/console/__init__.py +53 -0
- exonware/xwsystem/console/base.py +133 -0
- exonware/xwsystem/console/cli/__init__.py +61 -0
- exonware/xwsystem/{cli → console/cli}/args.py +27 -24
- exonware/xwsystem/{cli → console/cli}/base.py +18 -87
- exonware/xwsystem/{cli → console/cli}/colors.py +15 -13
- exonware/xwsystem/console/cli/console.py +98 -0
- exonware/xwsystem/{cli → console/cli}/contracts.py +51 -69
- exonware/xwsystem/console/cli/defs.py +87 -0
- exonware/xwsystem/console/cli/encoding.py +69 -0
- exonware/xwsystem/{cli → console/cli}/errors.py +8 -3
- exonware/xwsystem/console/cli/event_logger.py +166 -0
- exonware/xwsystem/{cli → console/cli}/progress.py +25 -21
- exonware/xwsystem/{cli → console/cli}/prompts.py +3 -2
- exonware/xwsystem/{cli → console/cli}/tables.py +27 -24
- exonware/xwsystem/console/contracts.py +113 -0
- exonware/xwsystem/console/defs.py +154 -0
- exonware/xwsystem/console/errors.py +34 -0
- exonware/xwsystem/console/event_logger.py +385 -0
- exonware/xwsystem/console/writer.py +132 -0
- exonware/xwsystem/contracts.py +28 -0
- exonware/xwsystem/data_structures/__init__.py +23 -0
- exonware/xwsystem/data_structures/trie.py +34 -0
- exonware/xwsystem/data_structures/union_find.py +144 -0
- exonware/xwsystem/defs.py +17 -0
- exonware/xwsystem/errors.py +23 -0
- exonware/xwsystem/facade.py +62 -0
- exonware/xwsystem/http_client/__init__.py +22 -1
- exonware/xwsystem/http_client/advanced_client.py +8 -5
- exonware/xwsystem/http_client/base.py +3 -2
- exonware/xwsystem/http_client/client.py +7 -4
- exonware/xwsystem/http_client/contracts.py +42 -56
- exonware/xwsystem/http_client/defs.py +2 -1
- exonware/xwsystem/http_client/errors.py +2 -1
- exonware/xwsystem/http_client/facade.py +156 -0
- exonware/xwsystem/io/__init__.py +22 -3
- exonware/xwsystem/io/archive/__init__.py +8 -2
- exonware/xwsystem/io/archive/archive.py +1 -1
- exonware/xwsystem/io/archive/archive_files.py +4 -7
- exonware/xwsystem/io/archive/archivers.py +120 -10
- exonware/xwsystem/io/archive/base.py +4 -5
- exonware/xwsystem/io/archive/codec_integration.py +1 -2
- exonware/xwsystem/io/archive/compression.py +1 -2
- exonware/xwsystem/io/archive/facade.py +263 -0
- exonware/xwsystem/io/archive/formats/__init__.py +2 -3
- exonware/xwsystem/io/archive/formats/brotli_format.py +20 -7
- exonware/xwsystem/io/archive/formats/lz4_format.py +20 -7
- exonware/xwsystem/io/archive/formats/rar.py +11 -5
- exonware/xwsystem/io/archive/formats/sevenzip.py +12 -6
- exonware/xwsystem/io/archive/formats/squashfs_format.py +1 -2
- exonware/xwsystem/io/archive/formats/tar.py +52 -7
- exonware/xwsystem/io/archive/formats/wim_format.py +11 -5
- exonware/xwsystem/io/archive/formats/zip.py +1 -2
- exonware/xwsystem/io/archive/formats/zpaq_format.py +1 -2
- exonware/xwsystem/io/archive/formats/zstandard.py +20 -7
- exonware/xwsystem/io/base.py +119 -115
- exonware/xwsystem/io/codec/__init__.py +4 -2
- exonware/xwsystem/io/codec/base.py +19 -13
- exonware/xwsystem/io/codec/contracts.py +59 -2
- exonware/xwsystem/io/codec/registry.py +67 -21
- exonware/xwsystem/io/common/__init__.py +1 -1
- exonware/xwsystem/io/common/atomic.py +29 -16
- exonware/xwsystem/io/common/base.py +11 -10
- exonware/xwsystem/io/common/lock.py +6 -5
- exonware/xwsystem/io/common/path_manager.py +2 -1
- exonware/xwsystem/io/common/watcher.py +1 -2
- exonware/xwsystem/io/contracts.py +301 -433
- exonware/xwsystem/io/contracts_1.py +1180 -0
- exonware/xwsystem/io/data_operations.py +19 -20
- exonware/xwsystem/io/defs.py +4 -3
- exonware/xwsystem/io/errors.py +3 -2
- exonware/xwsystem/io/facade.py +87 -61
- exonware/xwsystem/io/file/__init__.py +1 -1
- exonware/xwsystem/io/file/base.py +8 -9
- exonware/xwsystem/io/file/conversion.py +2 -3
- exonware/xwsystem/io/file/file.py +61 -18
- exonware/xwsystem/io/file/paged_source.py +8 -8
- exonware/xwsystem/io/file/paging/__init__.py +1 -2
- exonware/xwsystem/io/file/paging/byte_paging.py +4 -5
- exonware/xwsystem/io/file/paging/line_paging.py +2 -3
- exonware/xwsystem/io/file/paging/record_paging.py +2 -3
- exonware/xwsystem/io/file/paging/registry.py +1 -2
- exonware/xwsystem/io/file/source.py +13 -17
- exonware/xwsystem/io/filesystem/__init__.py +1 -1
- exonware/xwsystem/io/filesystem/base.py +1 -2
- exonware/xwsystem/io/filesystem/local.py +3 -4
- exonware/xwsystem/io/folder/__init__.py +1 -1
- exonware/xwsystem/io/folder/base.py +1 -2
- exonware/xwsystem/io/folder/folder.py +16 -7
- exonware/xwsystem/io/indexing/__init__.py +14 -0
- exonware/xwsystem/io/indexing/facade.py +443 -0
- exonware/xwsystem/io/path_parser.py +98 -0
- exonware/xwsystem/io/serialization/__init__.py +21 -3
- exonware/xwsystem/io/serialization/auto_serializer.py +146 -20
- exonware/xwsystem/io/serialization/base.py +84 -34
- exonware/xwsystem/io/serialization/contracts.py +50 -73
- exonware/xwsystem/io/serialization/defs.py +2 -1
- exonware/xwsystem/io/serialization/errors.py +2 -1
- exonware/xwsystem/io/serialization/flyweight.py +154 -7
- exonware/xwsystem/io/serialization/format_detector.py +15 -14
- exonware/xwsystem/io/serialization/formats/__init__.py +8 -5
- exonware/xwsystem/io/serialization/formats/binary/bson.py +15 -6
- exonware/xwsystem/io/serialization/formats/binary/cbor.py +5 -5
- exonware/xwsystem/io/serialization/formats/binary/marshal.py +5 -5
- exonware/xwsystem/io/serialization/formats/binary/msgpack.py +5 -5
- exonware/xwsystem/io/serialization/formats/binary/pickle.py +5 -5
- exonware/xwsystem/io/serialization/formats/binary/plistlib.py +5 -5
- exonware/xwsystem/io/serialization/formats/database/dbm.py +7 -7
- exonware/xwsystem/io/serialization/formats/database/shelve.py +7 -7
- exonware/xwsystem/io/serialization/formats/database/sqlite3.py +7 -7
- exonware/xwsystem/io/serialization/formats/tabular/__init__.py +27 -0
- exonware/xwsystem/io/serialization/formats/tabular/base.py +89 -0
- exonware/xwsystem/io/serialization/formats/tabular/csv.py +319 -0
- exonware/xwsystem/io/serialization/formats/tabular/df.py +249 -0
- exonware/xwsystem/io/serialization/formats/tabular/excel.py +291 -0
- exonware/xwsystem/io/serialization/formats/tabular/googlesheets.py +374 -0
- exonware/xwsystem/io/serialization/formats/text/__init__.py +1 -1
- exonware/xwsystem/io/serialization/formats/text/append_only_log.py +5 -7
- exonware/xwsystem/io/serialization/formats/text/configparser.py +5 -5
- exonware/xwsystem/io/serialization/formats/text/csv.py +7 -5
- exonware/xwsystem/io/serialization/formats/text/formdata.py +5 -5
- exonware/xwsystem/io/serialization/formats/text/json.py +27 -18
- exonware/xwsystem/io/serialization/formats/text/json5.py +8 -4
- exonware/xwsystem/io/serialization/formats/text/jsonlines.py +18 -14
- exonware/xwsystem/io/serialization/formats/text/multipart.py +5 -5
- exonware/xwsystem/io/serialization/formats/text/toml.py +8 -6
- exonware/xwsystem/io/serialization/formats/text/xml.py +25 -20
- exonware/xwsystem/io/serialization/formats/text/yaml.py +8 -6
- exonware/xwsystem/io/serialization/parsers/__init__.py +3 -2
- exonware/xwsystem/io/serialization/parsers/base.py +6 -5
- exonware/xwsystem/io/serialization/parsers/hybrid_parser.py +7 -6
- exonware/xwsystem/io/serialization/parsers/msgspec_parser.py +10 -7
- exonware/xwsystem/io/serialization/parsers/orjson_direct_parser.py +7 -6
- exonware/xwsystem/io/serialization/parsers/orjson_parser.py +11 -8
- exonware/xwsystem/io/serialization/parsers/pysimdjson_parser.py +13 -9
- exonware/xwsystem/io/serialization/parsers/rapidjson_parser.py +10 -7
- exonware/xwsystem/io/serialization/parsers/registry.py +11 -10
- exonware/xwsystem/io/serialization/parsers/standard.py +7 -6
- exonware/xwsystem/io/serialization/parsers/ujson_parser.py +10 -7
- exonware/xwsystem/io/serialization/registry.py +4 -4
- exonware/xwsystem/io/serialization/serializer.py +168 -79
- exonware/xwsystem/io/serialization/universal_options.py +367 -0
- exonware/xwsystem/io/serialization/utils/__init__.py +1 -2
- exonware/xwsystem/io/serialization/utils/path_ops.py +5 -6
- exonware/xwsystem/io/source_reader.py +223 -0
- exonware/xwsystem/io/stream/__init__.py +1 -1
- exonware/xwsystem/io/stream/async_operations.py +61 -14
- exonware/xwsystem/io/stream/base.py +1 -2
- exonware/xwsystem/io/stream/codec_io.py +6 -7
- exonware/xwsystem/ipc/__init__.py +1 -0
- exonware/xwsystem/ipc/async_fabric.py +4 -4
- exonware/xwsystem/ipc/base.py +6 -5
- exonware/xwsystem/ipc/contracts.py +41 -66
- exonware/xwsystem/ipc/defs.py +2 -1
- exonware/xwsystem/ipc/errors.py +2 -1
- exonware/xwsystem/ipc/message_queue.py +5 -2
- exonware/xwsystem/ipc/pipes.py +70 -34
- exonware/xwsystem/ipc/process_manager.py +7 -5
- exonware/xwsystem/ipc/process_pool.py +6 -5
- exonware/xwsystem/ipc/shared_memory.py +64 -11
- exonware/xwsystem/monitoring/__init__.py +7 -0
- exonware/xwsystem/monitoring/base.py +11 -8
- exonware/xwsystem/monitoring/contracts.py +86 -144
- exonware/xwsystem/monitoring/defs.py +2 -1
- exonware/xwsystem/monitoring/error_recovery.py +16 -3
- exonware/xwsystem/monitoring/errors.py +2 -1
- exonware/xwsystem/monitoring/facade.py +183 -0
- exonware/xwsystem/monitoring/memory_monitor.py +1 -0
- exonware/xwsystem/monitoring/metrics.py +1 -0
- exonware/xwsystem/monitoring/performance_manager_generic.py +7 -7
- exonware/xwsystem/monitoring/performance_monitor.py +1 -0
- exonware/xwsystem/monitoring/performance_validator.py +1 -0
- exonware/xwsystem/monitoring/system_monitor.py +6 -5
- exonware/xwsystem/monitoring/tracing.py +18 -16
- exonware/xwsystem/monitoring/tracker.py +2 -1
- exonware/xwsystem/operations/__init__.py +5 -50
- exonware/xwsystem/operations/base.py +3 -44
- exonware/xwsystem/operations/contracts.py +25 -15
- exonware/xwsystem/operations/defs.py +1 -1
- exonware/xwsystem/operations/diff.py +5 -4
- exonware/xwsystem/operations/errors.py +1 -1
- exonware/xwsystem/operations/merge.py +6 -4
- exonware/xwsystem/operations/patch.py +5 -4
- exonware/xwsystem/patterns/__init__.py +1 -0
- exonware/xwsystem/patterns/base.py +2 -1
- exonware/xwsystem/patterns/context_manager.py +2 -1
- exonware/xwsystem/patterns/contracts.py +215 -256
- exonware/xwsystem/patterns/defs.py +2 -1
- exonware/xwsystem/patterns/dynamic_facade.py +1 -0
- exonware/xwsystem/patterns/errors.py +2 -4
- exonware/xwsystem/patterns/handler_factory.py +2 -3
- exonware/xwsystem/patterns/import_registry.py +1 -0
- exonware/xwsystem/patterns/object_pool.py +1 -0
- exonware/xwsystem/patterns/registry.py +4 -43
- exonware/xwsystem/plugins/__init__.py +2 -1
- exonware/xwsystem/plugins/base.py +6 -5
- exonware/xwsystem/plugins/contracts.py +94 -158
- exonware/xwsystem/plugins/defs.py +2 -1
- exonware/xwsystem/plugins/errors.py +2 -1
- exonware/xwsystem/py.typed +3 -0
- exonware/xwsystem/query/__init__.py +36 -0
- exonware/xwsystem/query/contracts.py +56 -0
- exonware/xwsystem/query/errors.py +22 -0
- exonware/xwsystem/query/registry.py +128 -0
- exonware/xwsystem/runtime/__init__.py +2 -1
- exonware/xwsystem/runtime/base.py +4 -3
- exonware/xwsystem/runtime/contracts.py +39 -60
- exonware/xwsystem/runtime/defs.py +2 -1
- exonware/xwsystem/runtime/env.py +11 -9
- exonware/xwsystem/runtime/errors.py +2 -1
- exonware/xwsystem/runtime/reflection.py +3 -2
- exonware/xwsystem/security/__init__.py +68 -11
- exonware/xwsystem/security/audit.py +167 -0
- exonware/xwsystem/security/base.py +121 -24
- exonware/xwsystem/security/contracts.py +91 -146
- exonware/xwsystem/security/crypto.py +17 -16
- exonware/xwsystem/security/defs.py +2 -1
- exonware/xwsystem/security/errors.py +2 -1
- exonware/xwsystem/security/facade.py +321 -0
- exonware/xwsystem/security/file_security.py +330 -0
- exonware/xwsystem/security/hazmat.py +11 -8
- exonware/xwsystem/security/monitor.py +372 -0
- exonware/xwsystem/security/path_validator.py +140 -18
- exonware/xwsystem/security/policy.py +357 -0
- exonware/xwsystem/security/resource_limits.py +1 -0
- exonware/xwsystem/security/validator.py +455 -0
- exonware/xwsystem/shared/__init__.py +14 -1
- exonware/xwsystem/shared/base.py +285 -2
- exonware/xwsystem/shared/contracts.py +415 -126
- exonware/xwsystem/shared/defs.py +2 -1
- exonware/xwsystem/shared/errors.py +2 -2
- exonware/xwsystem/shared/xwobject.py +316 -0
- exonware/xwsystem/structures/__init__.py +1 -0
- exonware/xwsystem/structures/base.py +3 -2
- exonware/xwsystem/structures/circular_detector.py +15 -14
- exonware/xwsystem/structures/contracts.py +53 -76
- exonware/xwsystem/structures/defs.py +2 -1
- exonware/xwsystem/structures/errors.py +2 -1
- exonware/xwsystem/structures/tree_walker.py +2 -1
- exonware/xwsystem/threading/__init__.py +21 -4
- exonware/xwsystem/threading/async_primitives.py +6 -5
- exonware/xwsystem/threading/base.py +3 -2
- exonware/xwsystem/threading/contracts.py +87 -143
- exonware/xwsystem/threading/defs.py +2 -1
- exonware/xwsystem/threading/errors.py +2 -1
- exonware/xwsystem/threading/facade.py +175 -0
- exonware/xwsystem/threading/locks.py +1 -0
- exonware/xwsystem/threading/safe_factory.py +1 -0
- exonware/xwsystem/utils/__init__.py +40 -0
- exonware/xwsystem/utils/base.py +22 -21
- exonware/xwsystem/utils/contracts.py +50 -73
- exonware/xwsystem/utils/dt/__init__.py +19 -3
- exonware/xwsystem/utils/dt/base.py +5 -4
- exonware/xwsystem/utils/dt/contracts.py +22 -29
- exonware/xwsystem/utils/dt/defs.py +2 -1
- exonware/xwsystem/utils/dt/errors.py +2 -5
- exonware/xwsystem/utils/dt/formatting.py +88 -2
- exonware/xwsystem/utils/dt/humanize.py +10 -9
- exonware/xwsystem/utils/dt/parsing.py +56 -5
- exonware/xwsystem/utils/dt/timezone_utils.py +2 -24
- exonware/xwsystem/utils/errors.py +2 -4
- exonware/xwsystem/utils/paths.py +1 -0
- exonware/xwsystem/utils/string.py +49 -0
- exonware/xwsystem/utils/test_runner.py +185 -0
- exonware/xwsystem/utils/utils_contracts.py +2 -1
- exonware/xwsystem/utils/web.py +110 -0
- exonware/xwsystem/validation/__init__.py +25 -1
- exonware/xwsystem/validation/base.py +6 -5
- exonware/xwsystem/validation/contracts.py +29 -41
- exonware/xwsystem/validation/data_validator.py +1 -0
- exonware/xwsystem/validation/declarative.py +11 -8
- exonware/xwsystem/validation/defs.py +2 -1
- exonware/xwsystem/validation/errors.py +2 -1
- exonware/xwsystem/validation/facade.py +198 -0
- exonware/xwsystem/validation/fluent_validator.py +22 -19
- exonware/xwsystem/validation/schema_discovery.py +210 -0
- exonware/xwsystem/validation/type_safety.py +2 -1
- exonware/xwsystem/version.py +2 -2
- {exonware_xwsystem-0.1.0.1.dist-info → exonware_xwsystem-0.1.0.4.dist-info}/METADATA +71 -4
- exonware_xwsystem-0.1.0.4.dist-info/RECORD +337 -0
- exonware/xwsystem/cli/__init__.py +0 -43
- exonware/xwsystem/cli/console.py +0 -113
- exonware/xwsystem/cli/defs.py +0 -134
- exonware/xwsystem/conf.py +0 -44
- exonware/xwsystem/security/auth.py +0 -484
- exonware_xwsystem-0.1.0.1.dist-info/RECORD +0 -284
- {exonware_xwsystem-0.1.0.1.dist-info → exonware_xwsystem-0.1.0.4.dist-info}/WHEEL +0 -0
- {exonware_xwsystem-0.1.0.1.dist-info → exonware_xwsystem-0.1.0.4.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
|
+
#exonware/xwsystem/src/exonware/xwsystem/monitoring/contracts.py
|
|
2
3
|
"""
|
|
3
4
|
Company: eXonware.com
|
|
4
5
|
Author: Eng. Muhammad AlShehri
|
|
5
6
|
Email: connect@exonware.com
|
|
6
|
-
Version: 0.1.0.
|
|
7
|
+
Version: 0.1.0.4
|
|
7
8
|
Generation Date: September 04, 2025
|
|
8
9
|
|
|
9
10
|
Monitoring protocol interfaces for XWSystem.
|
|
10
11
|
"""
|
|
11
12
|
|
|
12
|
-
from
|
|
13
|
-
from typing import Any, Optional, Union, Iterator, Callable, Protocol
|
|
14
|
-
from typing_extensions import runtime_checkable
|
|
13
|
+
from typing import Any, Optional, Iterator, Callable, Protocol, runtime_checkable
|
|
15
14
|
import time
|
|
16
15
|
|
|
17
16
|
# Import enums from types module
|
|
@@ -29,14 +28,14 @@ from .defs import (
|
|
|
29
28
|
# PERFORMANCE INTERFACES
|
|
30
29
|
# ============================================================================
|
|
31
30
|
|
|
32
|
-
|
|
31
|
+
@runtime_checkable
|
|
32
|
+
class IPerformance(Protocol):
|
|
33
33
|
"""
|
|
34
34
|
Interface for performance monitoring.
|
|
35
35
|
|
|
36
36
|
Enforces consistent performance monitoring across XWSystem.
|
|
37
37
|
"""
|
|
38
38
|
|
|
39
|
-
@abstractmethod
|
|
40
39
|
def start_timer(self, operation: str) -> str:
|
|
41
40
|
"""
|
|
42
41
|
Start performance timer.
|
|
@@ -47,9 +46,8 @@ class IPerformance(ABC):
|
|
|
47
46
|
Returns:
|
|
48
47
|
Timer ID
|
|
49
48
|
"""
|
|
50
|
-
|
|
49
|
+
...
|
|
51
50
|
|
|
52
|
-
@abstractmethod
|
|
53
51
|
def end_timer(self, timer_id: str) -> float:
|
|
54
52
|
"""
|
|
55
53
|
End performance timer.
|
|
@@ -60,9 +58,8 @@ class IPerformance(ABC):
|
|
|
60
58
|
Returns:
|
|
61
59
|
Elapsed time in seconds
|
|
62
60
|
"""
|
|
63
|
-
|
|
61
|
+
...
|
|
64
62
|
|
|
65
|
-
@abstractmethod
|
|
66
63
|
def get_metrics(self) -> dict[str, Any]:
|
|
67
64
|
"""
|
|
68
65
|
Get performance metrics.
|
|
@@ -70,16 +67,14 @@ class IPerformance(ABC):
|
|
|
70
67
|
Returns:
|
|
71
68
|
Performance metrics dictionary
|
|
72
69
|
"""
|
|
73
|
-
|
|
70
|
+
...
|
|
74
71
|
|
|
75
|
-
@abstractmethod
|
|
76
72
|
def reset_metrics(self) -> None:
|
|
77
73
|
"""
|
|
78
74
|
Reset performance metrics.
|
|
79
75
|
"""
|
|
80
|
-
|
|
76
|
+
...
|
|
81
77
|
|
|
82
|
-
@abstractmethod
|
|
83
78
|
def record_metric(self, name: str, value: float, metric_type: MetricType = MetricType.GAUGE) -> None:
|
|
84
79
|
"""
|
|
85
80
|
Record performance metric.
|
|
@@ -89,9 +84,8 @@ class IPerformance(ABC):
|
|
|
89
84
|
value: Metric value
|
|
90
85
|
metric_type: Type of metric
|
|
91
86
|
"""
|
|
92
|
-
|
|
87
|
+
...
|
|
93
88
|
|
|
94
|
-
@abstractmethod
|
|
95
89
|
def get_metric(self, name: str) -> Optional[float]:
|
|
96
90
|
"""
|
|
97
91
|
Get performance metric value.
|
|
@@ -102,9 +96,8 @@ class IPerformance(ABC):
|
|
|
102
96
|
Returns:
|
|
103
97
|
Metric value or None
|
|
104
98
|
"""
|
|
105
|
-
|
|
99
|
+
...
|
|
106
100
|
|
|
107
|
-
@abstractmethod
|
|
108
101
|
def get_performance_level(self) -> PerformanceLevel:
|
|
109
102
|
"""
|
|
110
103
|
Get current performance level.
|
|
@@ -112,9 +105,8 @@ class IPerformance(ABC):
|
|
|
112
105
|
Returns:
|
|
113
106
|
Current performance level
|
|
114
107
|
"""
|
|
115
|
-
|
|
108
|
+
...
|
|
116
109
|
|
|
117
|
-
@abstractmethod
|
|
118
110
|
def set_performance_threshold(self, metric: str, threshold: float) -> None:
|
|
119
111
|
"""
|
|
120
112
|
Set performance threshold.
|
|
@@ -123,9 +115,8 @@ class IPerformance(ABC):
|
|
|
123
115
|
metric: Metric name
|
|
124
116
|
threshold: Threshold value
|
|
125
117
|
"""
|
|
126
|
-
|
|
118
|
+
...
|
|
127
119
|
|
|
128
|
-
@abstractmethod
|
|
129
120
|
def is_performance_acceptable(self) -> bool:
|
|
130
121
|
"""
|
|
131
122
|
Check if performance is acceptable.
|
|
@@ -133,35 +124,33 @@ class IPerformance(ABC):
|
|
|
133
124
|
Returns:
|
|
134
125
|
True if performance is acceptable
|
|
135
126
|
"""
|
|
136
|
-
|
|
127
|
+
...
|
|
137
128
|
|
|
138
129
|
|
|
139
130
|
# ============================================================================
|
|
140
131
|
# MONITORABLE INTERFACES
|
|
141
132
|
# ============================================================================
|
|
142
133
|
|
|
143
|
-
|
|
134
|
+
@runtime_checkable
|
|
135
|
+
class IMonitorable(Protocol):
|
|
144
136
|
"""
|
|
145
137
|
Interface for monitorable objects.
|
|
146
138
|
|
|
147
139
|
Enforces consistent monitoring behavior across XWSystem.
|
|
148
140
|
"""
|
|
149
141
|
|
|
150
|
-
@abstractmethod
|
|
151
142
|
def start_monitoring(self) -> None:
|
|
152
143
|
"""
|
|
153
144
|
Start monitoring.
|
|
154
145
|
"""
|
|
155
|
-
|
|
146
|
+
...
|
|
156
147
|
|
|
157
|
-
@abstractmethod
|
|
158
148
|
def stop_monitoring(self) -> None:
|
|
159
149
|
"""
|
|
160
150
|
Stop monitoring.
|
|
161
151
|
"""
|
|
162
|
-
|
|
152
|
+
...
|
|
163
153
|
|
|
164
|
-
@abstractmethod
|
|
165
154
|
def get_status(self) -> HealthStatus:
|
|
166
155
|
"""
|
|
167
156
|
Get current status.
|
|
@@ -169,9 +158,8 @@ class IMonitorable(ABC):
|
|
|
169
158
|
Returns:
|
|
170
159
|
Current health status
|
|
171
160
|
"""
|
|
172
|
-
|
|
161
|
+
...
|
|
173
162
|
|
|
174
|
-
@abstractmethod
|
|
175
163
|
def get_health(self) -> dict[str, Any]:
|
|
176
164
|
"""
|
|
177
165
|
Get health information.
|
|
@@ -179,9 +167,8 @@ class IMonitorable(ABC):
|
|
|
179
167
|
Returns:
|
|
180
168
|
Health information dictionary
|
|
181
169
|
"""
|
|
182
|
-
|
|
170
|
+
...
|
|
183
171
|
|
|
184
|
-
@abstractmethod
|
|
185
172
|
def is_monitoring(self) -> bool:
|
|
186
173
|
"""
|
|
187
174
|
Check if monitoring is active.
|
|
@@ -189,9 +176,8 @@ class IMonitorable(ABC):
|
|
|
189
176
|
Returns:
|
|
190
177
|
True if monitoring is active
|
|
191
178
|
"""
|
|
192
|
-
|
|
179
|
+
...
|
|
193
180
|
|
|
194
|
-
@abstractmethod
|
|
195
181
|
def get_monitoring_info(self) -> dict[str, Any]:
|
|
196
182
|
"""
|
|
197
183
|
Get monitoring information.
|
|
@@ -199,9 +185,8 @@ class IMonitorable(ABC):
|
|
|
199
185
|
Returns:
|
|
200
186
|
Monitoring information dictionary
|
|
201
187
|
"""
|
|
202
|
-
|
|
188
|
+
...
|
|
203
189
|
|
|
204
|
-
@abstractmethod
|
|
205
190
|
def set_monitoring_interval(self, interval: float) -> None:
|
|
206
191
|
"""
|
|
207
192
|
Set monitoring interval.
|
|
@@ -209,9 +194,8 @@ class IMonitorable(ABC):
|
|
|
209
194
|
Args:
|
|
210
195
|
interval: Monitoring interval in seconds
|
|
211
196
|
"""
|
|
212
|
-
|
|
197
|
+
...
|
|
213
198
|
|
|
214
|
-
@abstractmethod
|
|
215
199
|
def get_monitoring_interval(self) -> float:
|
|
216
200
|
"""
|
|
217
201
|
Get monitoring interval.
|
|
@@ -219,21 +203,21 @@ class IMonitorable(ABC):
|
|
|
219
203
|
Returns:
|
|
220
204
|
Monitoring interval in seconds
|
|
221
205
|
"""
|
|
222
|
-
|
|
206
|
+
...
|
|
223
207
|
|
|
224
208
|
|
|
225
209
|
# ============================================================================
|
|
226
210
|
# METRICS INTERFACES
|
|
227
211
|
# ============================================================================
|
|
228
212
|
|
|
229
|
-
|
|
213
|
+
@runtime_checkable
|
|
214
|
+
class IMetrics(Protocol):
|
|
230
215
|
"""
|
|
231
216
|
Interface for metrics collection.
|
|
232
217
|
|
|
233
218
|
Enforces consistent metrics behavior across XWSystem.
|
|
234
219
|
"""
|
|
235
220
|
|
|
236
|
-
@abstractmethod
|
|
237
221
|
def collect_metrics(self) -> dict[str, Any]:
|
|
238
222
|
"""
|
|
239
223
|
Collect all metrics.
|
|
@@ -241,9 +225,8 @@ class IMetrics(ABC):
|
|
|
241
225
|
Returns:
|
|
242
226
|
Dictionary of collected metrics
|
|
243
227
|
"""
|
|
244
|
-
|
|
228
|
+
...
|
|
245
229
|
|
|
246
|
-
@abstractmethod
|
|
247
230
|
def add_metric(self, name: str, value: Any, labels: Optional[dict[str, str]] = None) -> None:
|
|
248
231
|
"""
|
|
249
232
|
Add metric.
|
|
@@ -253,9 +236,8 @@ class IMetrics(ABC):
|
|
|
253
236
|
value: Metric value
|
|
254
237
|
labels: Optional metric labels
|
|
255
238
|
"""
|
|
256
|
-
|
|
239
|
+
...
|
|
257
240
|
|
|
258
|
-
@abstractmethod
|
|
259
241
|
def get_metric(self, name: str) -> Optional[Any]:
|
|
260
242
|
"""
|
|
261
243
|
Get metric value.
|
|
@@ -266,9 +248,8 @@ class IMetrics(ABC):
|
|
|
266
248
|
Returns:
|
|
267
249
|
Metric value or None
|
|
268
250
|
"""
|
|
269
|
-
|
|
251
|
+
...
|
|
270
252
|
|
|
271
|
-
@abstractmethod
|
|
272
253
|
def remove_metric(self, name: str) -> bool:
|
|
273
254
|
"""
|
|
274
255
|
Remove metric.
|
|
@@ -279,9 +260,8 @@ class IMetrics(ABC):
|
|
|
279
260
|
Returns:
|
|
280
261
|
True if removed
|
|
281
262
|
"""
|
|
282
|
-
|
|
263
|
+
...
|
|
283
264
|
|
|
284
|
-
@abstractmethod
|
|
285
265
|
def list_metrics(self) -> list[str]:
|
|
286
266
|
"""
|
|
287
267
|
List all metric names.
|
|
@@ -289,9 +269,8 @@ class IMetrics(ABC):
|
|
|
289
269
|
Returns:
|
|
290
270
|
List of metric names
|
|
291
271
|
"""
|
|
292
|
-
|
|
272
|
+
...
|
|
293
273
|
|
|
294
|
-
@abstractmethod
|
|
295
274
|
def export_metrics(self, format: str = "json") -> str:
|
|
296
275
|
"""
|
|
297
276
|
Export metrics in specified format.
|
|
@@ -302,16 +281,14 @@ class IMetrics(ABC):
|
|
|
302
281
|
Returns:
|
|
303
282
|
Exported metrics string
|
|
304
283
|
"""
|
|
305
|
-
|
|
284
|
+
...
|
|
306
285
|
|
|
307
|
-
@abstractmethod
|
|
308
286
|
def clear_metrics(self) -> None:
|
|
309
287
|
"""
|
|
310
288
|
Clear all metrics.
|
|
311
289
|
"""
|
|
312
|
-
|
|
290
|
+
...
|
|
313
291
|
|
|
314
|
-
@abstractmethod
|
|
315
292
|
def get_metrics_summary(self) -> dict[str, Any]:
|
|
316
293
|
"""
|
|
317
294
|
Get metrics summary.
|
|
@@ -319,21 +296,21 @@ class IMetrics(ABC):
|
|
|
319
296
|
Returns:
|
|
320
297
|
Metrics summary dictionary
|
|
321
298
|
"""
|
|
322
|
-
|
|
299
|
+
...
|
|
323
300
|
|
|
324
301
|
|
|
325
302
|
# ============================================================================
|
|
326
303
|
# HEALTH CHECK INTERFACES
|
|
327
304
|
# ============================================================================
|
|
328
305
|
|
|
329
|
-
|
|
306
|
+
@runtime_checkable
|
|
307
|
+
class IHealthCheck(Protocol):
|
|
330
308
|
"""
|
|
331
309
|
Interface for health checks.
|
|
332
310
|
|
|
333
311
|
Enforces consistent health checking across XWSystem.
|
|
334
312
|
"""
|
|
335
313
|
|
|
336
|
-
@abstractmethod
|
|
337
314
|
def check_health(self) -> HealthStatus:
|
|
338
315
|
"""
|
|
339
316
|
Perform health check.
|
|
@@ -341,9 +318,8 @@ class IHealthCheck(ABC):
|
|
|
341
318
|
Returns:
|
|
342
319
|
Health status
|
|
343
320
|
"""
|
|
344
|
-
|
|
321
|
+
...
|
|
345
322
|
|
|
346
|
-
@abstractmethod
|
|
347
323
|
def get_health_details(self) -> dict[str, Any]:
|
|
348
324
|
"""
|
|
349
325
|
Get detailed health information.
|
|
@@ -351,9 +327,8 @@ class IHealthCheck(ABC):
|
|
|
351
327
|
Returns:
|
|
352
328
|
Health details dictionary
|
|
353
329
|
"""
|
|
354
|
-
|
|
330
|
+
...
|
|
355
331
|
|
|
356
|
-
@abstractmethod
|
|
357
332
|
def add_health_check(self, name: str, check_func: Callable[[], HealthStatus]) -> None:
|
|
358
333
|
"""
|
|
359
334
|
Add health check function.
|
|
@@ -362,9 +337,8 @@ class IHealthCheck(ABC):
|
|
|
362
337
|
name: Health check name
|
|
363
338
|
check_func: Health check function
|
|
364
339
|
"""
|
|
365
|
-
|
|
340
|
+
...
|
|
366
341
|
|
|
367
|
-
@abstractmethod
|
|
368
342
|
def remove_health_check(self, name: str) -> bool:
|
|
369
343
|
"""
|
|
370
344
|
Remove health check.
|
|
@@ -375,9 +349,8 @@ class IHealthCheck(ABC):
|
|
|
375
349
|
Returns:
|
|
376
350
|
True if removed
|
|
377
351
|
"""
|
|
378
|
-
|
|
352
|
+
...
|
|
379
353
|
|
|
380
|
-
@abstractmethod
|
|
381
354
|
def list_health_checks(self) -> list[str]:
|
|
382
355
|
"""
|
|
383
356
|
List all health check names.
|
|
@@ -385,9 +358,8 @@ class IHealthCheck(ABC):
|
|
|
385
358
|
Returns:
|
|
386
359
|
List of health check names
|
|
387
360
|
"""
|
|
388
|
-
|
|
361
|
+
...
|
|
389
362
|
|
|
390
|
-
@abstractmethod
|
|
391
363
|
def run_health_checks(self) -> dict[str, HealthStatus]:
|
|
392
364
|
"""
|
|
393
365
|
Run all health checks.
|
|
@@ -395,9 +367,8 @@ class IHealthCheck(ABC):
|
|
|
395
367
|
Returns:
|
|
396
368
|
Dictionary of health check results
|
|
397
369
|
"""
|
|
398
|
-
|
|
370
|
+
...
|
|
399
371
|
|
|
400
|
-
@abstractmethod
|
|
401
372
|
def get_overall_health(self) -> HealthStatus:
|
|
402
373
|
"""
|
|
403
374
|
Get overall health status.
|
|
@@ -405,9 +376,8 @@ class IHealthCheck(ABC):
|
|
|
405
376
|
Returns:
|
|
406
377
|
Overall health status
|
|
407
378
|
"""
|
|
408
|
-
|
|
379
|
+
...
|
|
409
380
|
|
|
410
|
-
@abstractmethod
|
|
411
381
|
def set_health_threshold(self, check_name: str, threshold: float) -> None:
|
|
412
382
|
"""
|
|
413
383
|
Set health check threshold.
|
|
@@ -416,21 +386,21 @@ class IHealthCheck(ABC):
|
|
|
416
386
|
check_name: Health check name
|
|
417
387
|
threshold: Threshold value
|
|
418
388
|
"""
|
|
419
|
-
|
|
389
|
+
...
|
|
420
390
|
|
|
421
391
|
|
|
422
392
|
# ============================================================================
|
|
423
393
|
# ALERTING INTERFACES
|
|
424
394
|
# ============================================================================
|
|
425
395
|
|
|
426
|
-
|
|
396
|
+
@runtime_checkable
|
|
397
|
+
class IAlerting(Protocol):
|
|
427
398
|
"""
|
|
428
399
|
Interface for alerting.
|
|
429
400
|
|
|
430
401
|
Enforces consistent alerting behavior across XWSystem.
|
|
431
402
|
"""
|
|
432
403
|
|
|
433
|
-
@abstractmethod
|
|
434
404
|
def create_alert(self, message: str, level: AlertLevel, source: str = "") -> str:
|
|
435
405
|
"""
|
|
436
406
|
Create alert.
|
|
@@ -443,9 +413,8 @@ class IAlerting(ABC):
|
|
|
443
413
|
Returns:
|
|
444
414
|
Alert ID
|
|
445
415
|
"""
|
|
446
|
-
|
|
416
|
+
...
|
|
447
417
|
|
|
448
|
-
@abstractmethod
|
|
449
418
|
def get_alert(self, alert_id: str) -> Optional[dict[str, Any]]:
|
|
450
419
|
"""
|
|
451
420
|
Get alert by ID.
|
|
@@ -456,9 +425,8 @@ class IAlerting(ABC):
|
|
|
456
425
|
Returns:
|
|
457
426
|
Alert information or None
|
|
458
427
|
"""
|
|
459
|
-
|
|
428
|
+
...
|
|
460
429
|
|
|
461
|
-
@abstractmethod
|
|
462
430
|
def list_alerts(self, level: Optional[AlertLevel] = None) -> list[dict[str, Any]]:
|
|
463
431
|
"""
|
|
464
432
|
List alerts.
|
|
@@ -469,9 +437,8 @@ class IAlerting(ABC):
|
|
|
469
437
|
Returns:
|
|
470
438
|
List of alert information
|
|
471
439
|
"""
|
|
472
|
-
|
|
440
|
+
...
|
|
473
441
|
|
|
474
|
-
@abstractmethod
|
|
475
442
|
def acknowledge_alert(self, alert_id: str, user: str = "") -> bool:
|
|
476
443
|
"""
|
|
477
444
|
Acknowledge alert.
|
|
@@ -483,9 +450,8 @@ class IAlerting(ABC):
|
|
|
483
450
|
Returns:
|
|
484
451
|
True if acknowledged
|
|
485
452
|
"""
|
|
486
|
-
|
|
453
|
+
...
|
|
487
454
|
|
|
488
|
-
@abstractmethod
|
|
489
455
|
def resolve_alert(self, alert_id: str, resolution: str = "") -> bool:
|
|
490
456
|
"""
|
|
491
457
|
Resolve alert.
|
|
@@ -497,9 +463,8 @@ class IAlerting(ABC):
|
|
|
497
463
|
Returns:
|
|
498
464
|
True if resolved
|
|
499
465
|
"""
|
|
500
|
-
|
|
466
|
+
...
|
|
501
467
|
|
|
502
|
-
@abstractmethod
|
|
503
468
|
def clear_alert(self, alert_id: str) -> bool:
|
|
504
469
|
"""
|
|
505
470
|
Clear alert.
|
|
@@ -510,9 +475,8 @@ class IAlerting(ABC):
|
|
|
510
475
|
Returns:
|
|
511
476
|
True if cleared
|
|
512
477
|
"""
|
|
513
|
-
|
|
478
|
+
...
|
|
514
479
|
|
|
515
|
-
@abstractmethod
|
|
516
480
|
def get_alert_stats(self) -> dict[str, int]:
|
|
517
481
|
"""
|
|
518
482
|
Get alert statistics.
|
|
@@ -520,9 +484,8 @@ class IAlerting(ABC):
|
|
|
520
484
|
Returns:
|
|
521
485
|
Alert statistics dictionary
|
|
522
486
|
"""
|
|
523
|
-
|
|
487
|
+
...
|
|
524
488
|
|
|
525
|
-
@abstractmethod
|
|
526
489
|
def set_alert_threshold(self, metric: str, threshold: float, level: AlertLevel) -> None:
|
|
527
490
|
"""
|
|
528
491
|
Set alert threshold.
|
|
@@ -532,21 +495,21 @@ class IAlerting(ABC):
|
|
|
532
495
|
threshold: Threshold value
|
|
533
496
|
level: Alert level
|
|
534
497
|
"""
|
|
535
|
-
|
|
498
|
+
...
|
|
536
499
|
|
|
537
500
|
|
|
538
501
|
# ============================================================================
|
|
539
502
|
# SYSTEM MONITORING INTERFACES
|
|
540
503
|
# ============================================================================
|
|
541
504
|
|
|
542
|
-
|
|
505
|
+
@runtime_checkable
|
|
506
|
+
class ISystemMonitor(Protocol):
|
|
543
507
|
"""
|
|
544
508
|
Interface for system monitoring.
|
|
545
509
|
|
|
546
510
|
Enforces consistent system monitoring across XWSystem.
|
|
547
511
|
"""
|
|
548
512
|
|
|
549
|
-
@abstractmethod
|
|
550
513
|
def get_cpu_usage(self) -> float:
|
|
551
514
|
"""
|
|
552
515
|
Get CPU usage percentage.
|
|
@@ -554,9 +517,8 @@ class ISystemMonitor(ABC):
|
|
|
554
517
|
Returns:
|
|
555
518
|
CPU usage percentage
|
|
556
519
|
"""
|
|
557
|
-
|
|
520
|
+
...
|
|
558
521
|
|
|
559
|
-
@abstractmethod
|
|
560
522
|
def get_memory_usage(self) -> dict[str, Any]:
|
|
561
523
|
"""
|
|
562
524
|
Get memory usage information.
|
|
@@ -564,9 +526,8 @@ class ISystemMonitor(ABC):
|
|
|
564
526
|
Returns:
|
|
565
527
|
Memory usage dictionary
|
|
566
528
|
"""
|
|
567
|
-
|
|
529
|
+
...
|
|
568
530
|
|
|
569
|
-
@abstractmethod
|
|
570
531
|
def get_disk_usage(self) -> dict[str, Any]:
|
|
571
532
|
"""
|
|
572
533
|
Get disk usage information.
|
|
@@ -574,9 +535,8 @@ class ISystemMonitor(ABC):
|
|
|
574
535
|
Returns:
|
|
575
536
|
Disk usage dictionary
|
|
576
537
|
"""
|
|
577
|
-
|
|
538
|
+
...
|
|
578
539
|
|
|
579
|
-
@abstractmethod
|
|
580
540
|
def get_network_usage(self) -> dict[str, Any]:
|
|
581
541
|
"""
|
|
582
542
|
Get network usage information.
|
|
@@ -584,9 +544,8 @@ class ISystemMonitor(ABC):
|
|
|
584
544
|
Returns:
|
|
585
545
|
Network usage dictionary
|
|
586
546
|
"""
|
|
587
|
-
|
|
547
|
+
...
|
|
588
548
|
|
|
589
|
-
@abstractmethod
|
|
590
549
|
def get_process_info(self) -> list[dict[str, Any]]:
|
|
591
550
|
"""
|
|
592
551
|
Get process information.
|
|
@@ -594,9 +553,8 @@ class ISystemMonitor(ABC):
|
|
|
594
553
|
Returns:
|
|
595
554
|
List of process information
|
|
596
555
|
"""
|
|
597
|
-
|
|
556
|
+
...
|
|
598
557
|
|
|
599
|
-
@abstractmethod
|
|
600
558
|
def get_system_load(self) -> float:
|
|
601
559
|
"""
|
|
602
560
|
Get system load average.
|
|
@@ -604,9 +562,8 @@ class ISystemMonitor(ABC):
|
|
|
604
562
|
Returns:
|
|
605
563
|
System load average
|
|
606
564
|
"""
|
|
607
|
-
|
|
565
|
+
...
|
|
608
566
|
|
|
609
|
-
@abstractmethod
|
|
610
567
|
def get_uptime(self) -> float:
|
|
611
568
|
"""
|
|
612
569
|
Get system uptime.
|
|
@@ -614,9 +571,8 @@ class ISystemMonitor(ABC):
|
|
|
614
571
|
Returns:
|
|
615
572
|
Uptime in seconds
|
|
616
573
|
"""
|
|
617
|
-
|
|
574
|
+
...
|
|
618
575
|
|
|
619
|
-
@abstractmethod
|
|
620
576
|
def get_system_info(self) -> dict[str, Any]:
|
|
621
577
|
"""
|
|
622
578
|
Get system information.
|
|
@@ -624,21 +580,21 @@ class ISystemMonitor(ABC):
|
|
|
624
580
|
Returns:
|
|
625
581
|
System information dictionary
|
|
626
582
|
"""
|
|
627
|
-
|
|
583
|
+
...
|
|
628
584
|
|
|
629
585
|
|
|
630
586
|
# ============================================================================
|
|
631
587
|
# PERFORMANCE PROFILING INTERFACES
|
|
632
588
|
# ============================================================================
|
|
633
589
|
|
|
634
|
-
|
|
590
|
+
@runtime_checkable
|
|
591
|
+
class IProfiler(Protocol):
|
|
635
592
|
"""
|
|
636
593
|
Interface for performance profiling.
|
|
637
594
|
|
|
638
595
|
Enforces consistent profiling behavior across XWSystem.
|
|
639
596
|
"""
|
|
640
597
|
|
|
641
|
-
@abstractmethod
|
|
642
598
|
def start_profiling(self, name: str) -> str:
|
|
643
599
|
"""
|
|
644
600
|
Start profiling session.
|
|
@@ -649,9 +605,8 @@ class IProfiler(ABC):
|
|
|
649
605
|
Returns:
|
|
650
606
|
Profiling session ID
|
|
651
607
|
"""
|
|
652
|
-
|
|
608
|
+
...
|
|
653
609
|
|
|
654
|
-
@abstractmethod
|
|
655
610
|
def stop_profiling(self, session_id: str) -> dict[str, Any]:
|
|
656
611
|
"""
|
|
657
612
|
Stop profiling session.
|
|
@@ -662,9 +617,8 @@ class IProfiler(ABC):
|
|
|
662
617
|
Returns:
|
|
663
618
|
Profiling results
|
|
664
619
|
"""
|
|
665
|
-
|
|
620
|
+
...
|
|
666
621
|
|
|
667
|
-
@abstractmethod
|
|
668
622
|
def profile_function(self, func: Callable, *args, **kwargs) -> tuple[Any, dict[str, Any]]:
|
|
669
623
|
"""
|
|
670
624
|
Profile function execution.
|
|
@@ -677,9 +631,8 @@ class IProfiler(ABC):
|
|
|
677
631
|
Returns:
|
|
678
632
|
Tuple of (result, profiling_data)
|
|
679
633
|
"""
|
|
680
|
-
|
|
634
|
+
...
|
|
681
635
|
|
|
682
|
-
@abstractmethod
|
|
683
636
|
def get_profiling_results(self, session_id: str) -> Optional[dict[str, Any]]:
|
|
684
637
|
"""
|
|
685
638
|
Get profiling results.
|
|
@@ -690,9 +643,8 @@ class IProfiler(ABC):
|
|
|
690
643
|
Returns:
|
|
691
644
|
Profiling results or None
|
|
692
645
|
"""
|
|
693
|
-
|
|
646
|
+
...
|
|
694
647
|
|
|
695
|
-
@abstractmethod
|
|
696
648
|
def list_profiling_sessions(self) -> list[str]:
|
|
697
649
|
"""
|
|
698
650
|
List profiling sessions.
|
|
@@ -700,16 +652,14 @@ class IProfiler(ABC):
|
|
|
700
652
|
Returns:
|
|
701
653
|
List of session IDs
|
|
702
654
|
"""
|
|
703
|
-
|
|
655
|
+
...
|
|
704
656
|
|
|
705
|
-
@abstractmethod
|
|
706
657
|
def clear_profiling_data(self) -> None:
|
|
707
658
|
"""
|
|
708
659
|
Clear profiling data.
|
|
709
660
|
"""
|
|
710
|
-
|
|
661
|
+
...
|
|
711
662
|
|
|
712
|
-
@abstractmethod
|
|
713
663
|
def export_profiling_data(self, session_id: str, format: str = "json") -> str:
|
|
714
664
|
"""
|
|
715
665
|
Export profiling data.
|
|
@@ -721,21 +671,21 @@ class IProfiler(ABC):
|
|
|
721
671
|
Returns:
|
|
722
672
|
Exported profiling data
|
|
723
673
|
"""
|
|
724
|
-
|
|
674
|
+
...
|
|
725
675
|
|
|
726
676
|
|
|
727
677
|
# ============================================================================
|
|
728
678
|
# MONITORING CONFIGURATION INTERFACES
|
|
729
679
|
# ============================================================================
|
|
730
680
|
|
|
731
|
-
|
|
681
|
+
@runtime_checkable
|
|
682
|
+
class IMonitoringConfig(Protocol):
|
|
732
683
|
"""
|
|
733
684
|
Interface for monitoring configuration.
|
|
734
685
|
|
|
735
686
|
Enforces consistent monitoring configuration across XWSystem.
|
|
736
687
|
"""
|
|
737
688
|
|
|
738
|
-
@abstractmethod
|
|
739
689
|
def set_monitoring_mode(self, mode: MonitoringMode) -> None:
|
|
740
690
|
"""
|
|
741
691
|
Set monitoring mode.
|
|
@@ -743,9 +693,8 @@ class IMonitoringConfig(ABC):
|
|
|
743
693
|
Args:
|
|
744
694
|
mode: Monitoring mode
|
|
745
695
|
"""
|
|
746
|
-
|
|
696
|
+
...
|
|
747
697
|
|
|
748
|
-
@abstractmethod
|
|
749
698
|
def get_monitoring_mode(self) -> MonitoringMode:
|
|
750
699
|
"""
|
|
751
700
|
Get monitoring mode.
|
|
@@ -753,9 +702,8 @@ class IMonitoringConfig(ABC):
|
|
|
753
702
|
Returns:
|
|
754
703
|
Current monitoring mode
|
|
755
704
|
"""
|
|
756
|
-
|
|
705
|
+
...
|
|
757
706
|
|
|
758
|
-
@abstractmethod
|
|
759
707
|
def set_metric_interval(self, metric: str, interval: float) -> None:
|
|
760
708
|
"""
|
|
761
709
|
Set metric collection interval.
|
|
@@ -764,9 +712,8 @@ class IMonitoringConfig(ABC):
|
|
|
764
712
|
metric: Metric name
|
|
765
713
|
interval: Collection interval in seconds
|
|
766
714
|
"""
|
|
767
|
-
|
|
715
|
+
...
|
|
768
716
|
|
|
769
|
-
@abstractmethod
|
|
770
717
|
def get_metric_interval(self, metric: str) -> Optional[float]:
|
|
771
718
|
"""
|
|
772
719
|
Get metric collection interval.
|
|
@@ -777,9 +724,8 @@ class IMonitoringConfig(ABC):
|
|
|
777
724
|
Returns:
|
|
778
725
|
Collection interval or None
|
|
779
726
|
"""
|
|
780
|
-
|
|
727
|
+
...
|
|
781
728
|
|
|
782
|
-
@abstractmethod
|
|
783
729
|
def enable_metric(self, metric: str) -> None:
|
|
784
730
|
"""
|
|
785
731
|
Enable metric collection.
|
|
@@ -787,9 +733,8 @@ class IMonitoringConfig(ABC):
|
|
|
787
733
|
Args:
|
|
788
734
|
metric: Metric name
|
|
789
735
|
"""
|
|
790
|
-
|
|
736
|
+
...
|
|
791
737
|
|
|
792
|
-
@abstractmethod
|
|
793
738
|
def disable_metric(self, metric: str) -> None:
|
|
794
739
|
"""
|
|
795
740
|
Disable metric collection.
|
|
@@ -797,9 +742,8 @@ class IMonitoringConfig(ABC):
|
|
|
797
742
|
Args:
|
|
798
743
|
metric: Metric name
|
|
799
744
|
"""
|
|
800
|
-
|
|
745
|
+
...
|
|
801
746
|
|
|
802
|
-
@abstractmethod
|
|
803
747
|
def is_metric_enabled(self, metric: str) -> bool:
|
|
804
748
|
"""
|
|
805
749
|
Check if metric is enabled.
|
|
@@ -810,9 +754,8 @@ class IMonitoringConfig(ABC):
|
|
|
810
754
|
Returns:
|
|
811
755
|
True if enabled
|
|
812
756
|
"""
|
|
813
|
-
|
|
757
|
+
...
|
|
814
758
|
|
|
815
|
-
@abstractmethod
|
|
816
759
|
def get_monitoring_config(self) -> dict[str, Any]:
|
|
817
760
|
"""
|
|
818
761
|
Get monitoring configuration.
|
|
@@ -820,9 +763,8 @@ class IMonitoringConfig(ABC):
|
|
|
820
763
|
Returns:
|
|
821
764
|
Monitoring configuration dictionary
|
|
822
765
|
"""
|
|
823
|
-
|
|
766
|
+
...
|
|
824
767
|
|
|
825
|
-
@abstractmethod
|
|
826
768
|
def set_monitoring_config(self, config: dict[str, Any]) -> None:
|
|
827
769
|
"""
|
|
828
770
|
Set monitoring configuration.
|
|
@@ -830,7 +772,7 @@ class IMonitoringConfig(ABC):
|
|
|
830
772
|
Args:
|
|
831
773
|
config: Monitoring configuration
|
|
832
774
|
"""
|
|
833
|
-
|
|
775
|
+
...
|
|
834
776
|
|
|
835
777
|
|
|
836
778
|
# ============================================================================
|
|
@@ -838,8 +780,8 @@ class IMonitoringConfig(ABC):
|
|
|
838
780
|
# ============================================================================
|
|
839
781
|
|
|
840
782
|
@runtime_checkable
|
|
841
|
-
class
|
|
842
|
-
"""Protocol for objects that support performance monitoring."""
|
|
783
|
+
class IMonitorableSimple(Protocol):
|
|
784
|
+
"""Protocol for objects that support performance monitoring (simpler interface than IMonitorable)."""
|
|
843
785
|
|
|
844
786
|
def start_monitoring(self) -> None:
|
|
845
787
|
"""Start performance monitoring."""
|