aiomisc 17.7.3__py3-none-any.whl → 17.7.6__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.
aiomisc/recurring.py CHANGED
@@ -48,14 +48,14 @@ class RecurringCallback:
48
48
 
49
49
  def __init__(
50
50
  self, coroutine_func: CallbackType,
51
- *args: Any, **kwargs: Any,
51
+ *args: Any, name: Optional[str] = None, **kwargs: Any,
52
52
  ):
53
53
  self.func: Callable[..., Awaitable[Any]]
54
54
  self.args: Tuple[Any, ...]
55
55
  self.kwargs: Mapping[str, Any]
56
56
  self._statistic: RecurringCallbackStatistic
57
57
 
58
- self.name: str = repr(coroutine_func)
58
+ self.name: str = name or repr(coroutine_func)
59
59
  self._statistic = RecurringCallbackStatistic(name=self.name)
60
60
  self.func = utils.awaitable(coroutine_func)
61
61
  self.args = args
aiomisc/service/carbon.py CHANGED
@@ -50,7 +50,7 @@ class CarbonSender(Service):
50
50
 
51
51
  set_client(client)
52
52
 
53
- self._handle = PeriodicCallback(client.send)
53
+ self._handle = PeriodicCallback(client.send, name="carbon-sender")
54
54
  self._handle.start(self.send_interval, loop=self.loop)
55
55
  log.info(
56
56
  "Periodic carbon metrics sender started. Send to %s://%s:%d with "
@@ -14,10 +14,11 @@ class PeriodicService(Service):
14
14
 
15
15
  interval: Union[int, float]
16
16
  delay: Union[int, float] = 0
17
+ name: str = "carbon-sender"
17
18
 
18
- def __init__(self, **kwargs: Any):
19
+ def __init__(self, *, name: Optional[str] = None, **kwargs: Any):
19
20
  super().__init__(**kwargs)
20
- self.periodic = PeriodicCallback(self.callback)
21
+ self.periodic = PeriodicCallback(self.callback, name=self.name)
21
22
 
22
23
  async def start(self) -> None:
23
24
  assert self.interval, f"Interval illegal interval {self.interval!r}"
@@ -9,17 +9,19 @@ from .base import Service
9
9
 
10
10
 
11
11
  class Profiler(Service):
12
- profiler = None # type: cProfile.Profile
13
- periodic = None # type: PeriodicCallback
12
+ profiler: cProfile.Profile
13
+ periodic: PeriodicCallback
14
14
 
15
- order = "cumulative" # type: str
15
+ order: str = "cumulative"
16
16
 
17
- path = None # type: str
18
- logger = None # type: logging.Logger
17
+ path: Optional[str] = None
18
+ logger: logging.Logger
19
19
 
20
- interval = 10 # type: int
21
- top_results = 10 # type: int
22
- log = logging.getLogger(__name__) # type: logging.Logger
20
+ interval: int = 10
21
+ top_results: int = 10
22
+ log: logging.Logger = logging.getLogger(__name__)
23
+
24
+ name: str = "profiler"
23
25
 
24
26
  async def start(self) -> None:
25
27
  self.logger = self.log.getChild(str(id(self)))
@@ -37,6 +37,7 @@ class SDWatchdogService(Service):
37
37
  socket_addr: Optional[str]
38
38
  watchdog_interval: Optional[TimeoutType] = None
39
39
  watchdog_timer: PeriodicCallback
40
+ name: str = "systemd-watchdog"
40
41
 
41
42
  def __init__(
42
43
  self,
@@ -86,7 +87,9 @@ class SDWatchdogService(Service):
86
87
  sock.close()
87
88
 
88
89
  async def start(self) -> None:
89
- self.watchdog_timer = PeriodicCallback(self.send, "WATCHDOG=1")
90
+ self.watchdog_timer = PeriodicCallback(
91
+ self.send, "WATCHDOG=1", name=self.name,
92
+ )
90
93
 
91
94
  if self.is_connected and self.watchdog_interval is not None:
92
95
  if self.watchdog_interval != WATCHDOG_INTERVAL:
aiomisc/service/tracer.py CHANGED
@@ -28,6 +28,7 @@ class MemoryTracer(Service):
28
28
  top_results: int = 20
29
29
 
30
30
  group_by: GroupBy = GroupBy.lineno
31
+ name: str = "memory-tracer"
31
32
 
32
33
  STAT_FORMAT: str = (
33
34
  "%(count)8s | "
@@ -41,7 +42,7 @@ class MemoryTracer(Service):
41
42
  log.warning("Start memory tracer")
42
43
  tracemalloc.start()
43
44
 
44
- self._tracer = PeriodicCallback(self.show_stats)
45
+ self._tracer = PeriodicCallback(self.show_stats, name=self.name)
45
46
  self._log = log.getChild(str(id(self)))
46
47
 
47
48
  self._snapshot_on_start = self.take_snapshot()
aiomisc/version.py CHANGED
@@ -2,5 +2,5 @@
2
2
  # BY: poem-plugins "git" plugin
3
3
  # NEVER EDIT THIS FILE MANUALLY
4
4
 
5
- version_info = (17, 7, 3)
6
- __version__ = "17.7.3"
5
+ version_info = (17, 7, 6)
6
+ __version__ = "17.7.6"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: aiomisc
3
- Version: 17.7.3
3
+ Version: 17.7.6
4
4
  Summary: aiomisc - miscellaneous utils for asyncio
5
5
  License: MIT
6
6
  Author: Dmitry Orlov
@@ -17,12 +17,12 @@ aiomisc/plugins/__main__.py,sha256=y3mykRQmimDRHb_PvY4n08vegjWTjd9CONFbCecAxxw,1
17
17
  aiomisc/pool.py,sha256=kmTEziX7U1kXxmNsTEain9Jkzn8ZbFubuCYWaozZoRk,5764
18
18
  aiomisc/process_pool.py,sha256=3O5FSIVQ6r-jf07Oyjs8Zt0wTL6cNZpV-tENwuQB63Y,3468
19
19
  aiomisc/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
20
- aiomisc/recurring.py,sha256=LJ13P_OhZM6mVOed8iUrS-M9PXY12516XBZcFtO7XtI,4923
20
+ aiomisc/recurring.py,sha256=KjqirbRscmNUk53xn0zyGCq2hmQZkceLERJngRyrzNQ,4959
21
21
  aiomisc/service/__init__.py,sha256=_JSkI4Q78UljG4CvhK6He2UGLxJaQS6cVwZ9QT0cSWo,607
22
22
  aiomisc/service/aiohttp.py,sha256=Lfw1dm77zscBZP0H4sKYlVye7RfE0EPWeSSX5V-mvD0,4091
23
23
  aiomisc/service/asgi.py,sha256=S6ejgg7GpHfUzuj46g8QuLXTHn0YWwqI_pAGbXfoNjE,1583
24
24
  aiomisc/service/base.py,sha256=6xvD27Sh2jy-4JWer6n31FuSq798DZhLI730YYGQbYc,4322
25
- aiomisc/service/carbon.py,sha256=o7x2LYUOfCcWYDAP9EFdCTtsduXhqkyMAuIqVio9YsM,1743
25
+ aiomisc/service/carbon.py,sha256=ox63wkSEPcXtEk-h0HG0CvLeFAUEC_D2bAkwkrBTQQw,1765
26
26
  aiomisc/service/cron.py,sha256=VM-FjdAhy_zFkU-YTdpBSxF79upvrsCo-3kdI9cZTOo,1975
27
27
  aiomisc/service/dns/__init__.py,sha256=RT8_0H8LrQe8sz2xvA2BvLi6CiJVZeVFltNRAx9MN7o,254
28
28
  aiomisc/service/dns/records.py,sha256=VE65kDSJ3Fg3-V60-AQQY2OxR89_ggaAc38k7vKUatM,8771
@@ -31,21 +31,21 @@ aiomisc/service/dns/store.py,sha256=PCYp-H1UoFzUVaYfSnK78_TG3fw1CeIzg-ndMgu_cE4,
31
31
  aiomisc/service/dns/tree.py,sha256=q9VRcVxggrClUHyGZZqqSByMaHdU4nYPC1NdT17cVWM,1575
32
32
  aiomisc/service/dns/zone.py,sha256=6Xmrl_leLalSiRQWWNuwGtZVw31Y93i9K2j0JU1vt-4,2174
33
33
  aiomisc/service/grpc_server.py,sha256=G1iRGX3jAfv3fpzNnw_n6UuhORmIZK4cz6aAi7t7qcU,4553
34
- aiomisc/service/periodic.py,sha256=BEKGWxWDOX11sfo7MFYp-hiB5iZ4-c2BRsjS56k5B-0,1241
34
+ aiomisc/service/periodic.py,sha256=B9qWHn5Fy2lQjmtg1mx9gKyB1ZpySjxAz07B1f29Gv8,1320
35
35
  aiomisc/service/process.py,sha256=mZf8muZJNWQo95pUmzchMk08MJMhLifFK8m4CnNX49k,4477
36
- aiomisc/service/profiler.py,sha256=6KiJsU7tD5eO4YKZXYujV2E8P-G8GUqLAGIl0AuPNG4,1503
36
+ aiomisc/service/profiler.py,sha256=cqLCImHD2w1QZsu8cjliqeENsYd9p9tNzQa0KvdJCQ4,1406
37
37
  aiomisc/service/raven.py,sha256=VHqnXWx-_r71_pjFniIB_E4CgT2reuRD1EB4yEC0hzE,12214
38
- aiomisc/service/sdwatchdog.py,sha256=6AMI0MP5deZKEmxguE3w68dapW4xFLRYgx9rgBk5mRw,4473
38
+ aiomisc/service/sdwatchdog.py,sha256=LSzSYYyGJy7PxOMTpAIDJ95sbFilm9N9wGWdxqIPyf4,4547
39
39
  aiomisc/service/tcp.py,sha256=gIdm4wXT191TMpL3Yzm_I7y--1kVxBLioN5lBP8mlhs,5507
40
40
  aiomisc/service/tls.py,sha256=EyWADLNV4P0BSXE8sALXwZUTHo6zjstMS7ecka-bBmU,9337
41
- aiomisc/service/tracer.py,sha256=_dxk5y2JEteki9J1OXnOkI-EowD9vakSfsLaRDB4uMQ,2826
41
+ aiomisc/service/tracer.py,sha256=S8HXRsUEEuCHbP8zlx409rUZJ0fEC6enCP3a0LXyeHk,2874
42
42
  aiomisc/service/udp.py,sha256=_uHzMAkpd7y-yt3tE9jN2llEETG7r47g2DF1SO7xyig,3616
43
43
  aiomisc/service/uvicorn.py,sha256=I2KYQL9ysFFqQHPYK00G4EoceA7J9p9Or6v1ATpLGw8,4324
44
44
  aiomisc/signal.py,sha256=_iiC2jukXg7-LLirIl1YATlKIIsKLbmTNFr1Ezheu7g,1728
45
45
  aiomisc/thread_pool.py,sha256=591u5HV1aBmBRcaVm4kAtMLPZOb6veqhT9wkts_knqE,14017
46
46
  aiomisc/timeout.py,sha256=5jNDooLW4MAe6ZUIKhkiX29CoyI0zlXd-dZoZwQPxak,920
47
47
  aiomisc/utils.py,sha256=6yTfTpeRCVzfZp-MJCmB1oayOHUBVwQwzC3U5PBAjn8,11919
48
- aiomisc/version.py,sha256=Y_Hh7bO575bzAAjob0MVcTO2snhkxY071G3VN3jeJlY,154
48
+ aiomisc/version.py,sha256=YI34KPi_H6LenySy7eI58YD0-14CihMIxH8wh6xWhvc,154
49
49
  aiomisc/worker_pool.py,sha256=GA91KdOrBlqHthbVSTxu_d6BsBIbl-uKqW2NxqSafG0,11107
50
50
  aiomisc_log/__init__.py,sha256=N3g8Ea1YE2dWPDd-MwohuAn3Y0pBxSyL4l4Jsxqkv0Q,4854
51
51
  aiomisc_log/enum.py,sha256=_zfCZPYCGyI9KL6TqHiYVlOfA5U5MCbsuCuDKxDHdxg,1549
@@ -63,8 +63,8 @@ aiomisc_worker/process_inner.py,sha256=8ZtjCSLrgySW57OIbuGrpEWxfysRLYKx1or1YaAqx
63
63
  aiomisc_worker/protocol.py,sha256=1smmlBbdreSmnrxuhHaUMUC10FO9xMIEcedhweQJX_A,2705
64
64
  aiomisc_worker/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
65
65
  aiomisc_worker/worker.py,sha256=f8nCFhlKh84UUBUaEgCllwMRvVZiD8_UUXaeit6g3T8,3236
66
- aiomisc-17.7.3.dist-info/COPYING,sha256=Ky_8CQMaIixfyOreUBsl0hKN6A5fLnPF8KPQ9molMYA,1125
67
- aiomisc-17.7.3.dist-info/METADATA,sha256=NphOM-GzSvENM9m8BK0lptTofiQqACJiag1UC9atxyE,15685
68
- aiomisc-17.7.3.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
69
- aiomisc-17.7.3.dist-info/entry_points.txt,sha256=KRsSPCwKJyGTWrvzpwbS0yIDwzsgDA2X6f0CBWYmNao,55
70
- aiomisc-17.7.3.dist-info/RECORD,,
66
+ aiomisc-17.7.6.dist-info/COPYING,sha256=Ky_8CQMaIixfyOreUBsl0hKN6A5fLnPF8KPQ9molMYA,1125
67
+ aiomisc-17.7.6.dist-info/METADATA,sha256=q9kYWUbdnfq7cyVD5KJ3ini3EnRpI8gpbXj-1KZYv9E,15685
68
+ aiomisc-17.7.6.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
69
+ aiomisc-17.7.6.dist-info/entry_points.txt,sha256=KRsSPCwKJyGTWrvzpwbS0yIDwzsgDA2X6f0CBWYmNao,55
70
+ aiomisc-17.7.6.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 2.1.1
2
+ Generator: poetry-core 2.1.2
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any