mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-19 04:57:54 +00:00
use the generic version of the correct types for samples
This commit is contained in:
parent
98634ae5cb
commit
c737bcdb6f
@ -5,6 +5,7 @@ Ported to Python 3.
|
|||||||
from collections import deque
|
from collections import deque
|
||||||
from time import process_time
|
from time import process_time
|
||||||
import time
|
import time
|
||||||
|
from typing import Deque, Tuple
|
||||||
|
|
||||||
from twisted.application import service
|
from twisted.application import service
|
||||||
from twisted.application.internet import TimerService
|
from twisted.application.internet import TimerService
|
||||||
@ -21,7 +22,7 @@ class CPUUsageMonitor(service.MultiService):
|
|||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
service.MultiService.__init__(self)
|
service.MultiService.__init__(self)
|
||||||
self.samples: list[tuple[float, float]] = deque([], self.HISTORY_LENGTH + 1)
|
self.samples: Deque[Tuple[float, float]] = deque([], self.HISTORY_LENGTH + 1)
|
||||||
# we provide 1min, 5min, and 15min moving averages
|
# we provide 1min, 5min, and 15min moving averages
|
||||||
TimerService(self.POLL_INTERVAL, self.check).setServiceParent(self)
|
TimerService(self.POLL_INTERVAL, self.check).setServiceParent(self)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user