From f2a940a4e0a8a9ff7368db1d33f117c76530cfd9 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Thu, 24 Jun 2021 12:08:23 -0400 Subject: [PATCH] agent: Add IBatchableTelem IBatchableTelem adds two methods to the ITelem interface. These methods allow a telemetry object to mange batches of telemetry entries, rather than just one. --- .../telemetry/i_batchable_telem.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 monkey/infection_monkey/telemetry/i_batchable_telem.py diff --git a/monkey/infection_monkey/telemetry/i_batchable_telem.py b/monkey/infection_monkey/telemetry/i_batchable_telem.py new file mode 100644 index 000000000..3cb82fd44 --- /dev/null +++ b/monkey/infection_monkey/telemetry/i_batchable_telem.py @@ -0,0 +1,16 @@ +from __future__ import annotations + +import abc +from typing import Iterable + +from infection_monkey.telemetry.i_telem import ITelem + + +class IBatchableTelem(ITelem, metaclass=abc.ABCMeta): + @abc.abstractmethod + def get_telemetry_entries(self) -> Iterable: + pass + + @abc.abstractmethod + def add_telemetry_to_batch(self, telemetry: IBatchableTelem): + pass