Commit ed77dac8 authored by Waleed Akbar's avatar Waleed Akbar
Browse files

Update the messages format

parent 1c15a21a
Loading
Loading
Loading
Loading
+12 −5
Original line number Diff line number Diff line
@@ -12,20 +12,27 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import uuid
import random
from common.proto import telemetry_frontend_pb2
from common.proto.kpi_sample_types_pb2 import KpiSampleType

def create_collector_id():
    _collector_id                   = telemetry_frontend_pb2.CollectorId()
    _collector_id.collector_id.uuid = uuid.uuid4()
    return _collector_id

def create_collector_id(coll_id_str : str):
    _collector_id                   = telemetry_frontend_pb2.CollectorId()
    _collector_id.collector_id.uuid = str(coll_id_str)
    return _collector_id

def create_collector_request(coll_id_str :  str):
def create_collector_request():
    _create_collector_request                                = telemetry_frontend_pb2.Collector()
    _create_collector_request.collector_id.collector_id.uuid = str(coll_id_str)
    _create_collector_request.kpi_id.kpi_id.uuid             = 'KPIid' + str(coll_id_str)
    _create_collector_request.duration_s                     = float(-1)
    _create_collector_request.interval_s                     = float(-1)
    _create_collector_request.collector_id.collector_id.uuid = str(uuid.uuid4())
    _create_collector_request.kpi_id.kpi_id.uuid             = str(uuid.uuid4())
    _create_collector_request.duration_s                     = float(random.randint(8, 16))
    _create_collector_request.interval_s                     = float(random.randint(2, 3))
    return _create_collector_request

def create_collector_request_a():