shadowshell 0.0.33__tar.gz → 0.0.35__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.
- {shadowshell-0.0.33 → shadowshell-0.0.35}/PKG-INFO +1 -1
- {shadowshell-0.0.33 → shadowshell-0.0.35}/pyproject.toml +1 -1
- {shadowshell-0.0.33 → shadowshell-0.0.35}/src/shadowshell/bootstrap.py +19 -13
- {shadowshell-0.0.33 → shadowshell-0.0.35}/src/shadowshell.egg-info/PKG-INFO +1 -1
- {shadowshell-0.0.33 → shadowshell-0.0.35}/README.md +0 -0
- {shadowshell-0.0.33 → shadowshell-0.0.35}/setup.cfg +0 -0
- {shadowshell-0.0.33 → shadowshell-0.0.35}/src/shadowshell/__init__.py +0 -0
- {shadowshell-0.0.33 → shadowshell-0.0.35}/src/shadowshell/configurator.py +0 -0
- {shadowshell-0.0.33 → shadowshell-0.0.35}/src/shadowshell/console_logger.py +0 -0
- {shadowshell-0.0.33 → shadowshell-0.0.35}/src/shadowshell/git_shell.py +0 -0
- {shadowshell-0.0.33 → shadowshell-0.0.35}/src/shadowshell/logger.py +0 -0
- {shadowshell-0.0.33 → shadowshell-0.0.35}/src/shadowshell/logger_factory.py +0 -0
- {shadowshell-0.0.33 → shadowshell-0.0.35}/src/shadowshell/stock_trader.py +0 -0
- {shadowshell-0.0.33 → shadowshell-0.0.35}/src/shadowshell.egg-info/SOURCES.txt +0 -0
- {shadowshell-0.0.33 → shadowshell-0.0.35}/src/shadowshell.egg-info/dependency_links.txt +0 -0
- {shadowshell-0.0.33 → shadowshell-0.0.35}/src/shadowshell.egg-info/requires.txt +0 -0
- {shadowshell-0.0.33 → shadowshell-0.0.35}/src/shadowshell.egg-info/top_level.txt +0 -0
- {shadowshell-0.0.33 → shadowshell-0.0.35}/tests/tests.py +0 -0
|
@@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "shadowshell" # 全局唯一名称(检查PyPI是否被占用)
|
|
7
7
|
#version = "0.0.24" # 版本号(每次更新需递增)
|
|
8
|
-
version = "0.0.
|
|
8
|
+
version = "0.0.35" # 版本号(每次更新需递增)
|
|
9
9
|
authors = [{ name = "shadowshell", email = "shadowshellxyz@foxmail.com" }]
|
|
10
10
|
description = "www.shadowshell.xyz"
|
|
11
11
|
readme = "README.md"
|
|
@@ -72,16 +72,23 @@ class TestTemplate:
|
|
|
72
72
|
self.logger.debug('Nothing')
|
|
73
73
|
return
|
|
74
74
|
|
|
75
|
-
def performance_monitor(
|
|
76
|
-
def
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
75
|
+
def performance_monitor(class_name=None):
|
|
76
|
+
def decorator(func):
|
|
77
|
+
def wrapper(*args, **kwargs):
|
|
78
|
+
start = time.perf_counter()
|
|
79
|
+
try:
|
|
80
|
+
result = func(*args, **kwargs)
|
|
81
|
+
finally:
|
|
82
|
+
elapsed = time.perf_counter() - start
|
|
83
|
+
if (class_name is not None):
|
|
84
|
+
logger.info(f"[PERFORMANCE_MONITOR][{class_name}][{func.__name__}] has ran, time elapsed:{elapsed:.6f}s.")
|
|
85
|
+
else:
|
|
86
|
+
logger.info(f"[PERFORMANCE_MONITOR][{func.__name__}] has ran, time elapsed:{elapsed:.6f}s.")
|
|
87
|
+
return result
|
|
88
|
+
return wrapper
|
|
89
|
+
return decorator
|
|
90
|
+
|
|
91
|
+
def function_monitor(class_name=None):
|
|
85
92
|
def decorator(func):
|
|
86
93
|
def wrapper(*args, **kwargs):
|
|
87
94
|
start = time.perf_counter()
|
|
@@ -93,14 +100,13 @@ def function_monitor(func, clazz=None):
|
|
|
93
100
|
logger.error(sys.exc_info()[0])
|
|
94
101
|
finally:
|
|
95
102
|
elapsed = time.perf_counter() - start
|
|
96
|
-
if (
|
|
97
|
-
logger.info(f"[FUNCTION_MONITOR][{
|
|
103
|
+
if (class_name is not None):
|
|
104
|
+
logger.info(f"[FUNCTION_MONITOR][{class_name}][{func.__name__}] has ran, time elapsed:{elapsed:.6f}s.")
|
|
98
105
|
else:
|
|
99
106
|
logger.info(f"[FUNCTION_MONITOR][{func.__name__}] has ran, time elapsed:{elapsed:.6f}s.")
|
|
100
107
|
return result
|
|
101
108
|
return wrapper
|
|
102
109
|
return decorator
|
|
103
|
-
|
|
104
110
|
|
|
105
111
|
def testserver():
|
|
106
112
|
os.system("ping shadowshell.xyz")
|
|
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
|