def __init__(self, average_class=EWMA): self.counter = Atomic(0) self.start_time = time() self.last_tick = Atomic(self.start_time) self.interval = EWMA.INTERVAL self.m1_rate = EWMA.m1() self.m5_rate = EWMA.m5() self.m15_rate = EWMA.m15()
def __init__(self, average_class=EWMA): self.counter = AtomicLong(0) self.start_time = now() self.last_tick = AtomicLong(self.start_time) self.interval = EWMA.INTERVAL self.m1_rate = EWMA.m1() self.m5_rate = EWMA.m5() self.m15_rate = EWMA.m15()
def __init__(self, average_class=EWMA): self.counter = AtomicLong(0) self.start_time = now() self.last_tick = AtomicLong(self.start_time) self.interval = EWMA.INTERVAL self.minute1_rate = EWMA.m1() self.minute5_rate = EWMA.m5() self.minute15_rate = EWMA.m15()
def __init__(self, average_class=EWMA): self.counter = Atomic(0) self.start_time = time.time() self.m1_rate = EWMA.m1() self.m5_rate = EWMA.m5() self.m15_rate = EWMA.m15() self.task = PeriodicTask(interval=average_class.INTERVAL, target=self.tick) self.task.start()