Loading my_deploy.sh +1 −1 Original line number Diff line number Diff line Loading @@ -26,7 +26,7 @@ export TFS_COMPONENTS="context device pathcomp service slice nbi webui" #export TFS_COMPONENTS="${TFS_COMPONENTS} monitoring" # Uncomment to activate Monitoring Framework (new) export TFS_COMPONENTS="${TFS_COMPONENTS} kpi_manager kpi_value_writer kpi_value_api telemetry analytics automation" #export TFS_COMPONENTS="${TFS_COMPONENTS} kpi_manager kpi_value_writer kpi_value_api telemetry analytics automation" # Uncomment to activate QoS Profiles #export TFS_COMPONENTS="${TFS_COMPONENTS} qos_profile" Loading scripts/run_tests_locally-telemetry-emulated.sh +1 −1 Original line number Diff line number Diff line #!/bin/bash # Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) # Copyright 2022-2024 ETSI SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. Loading src/telemetry/backend/driver_api/_Driver.py→src/telemetry/backend/collector_api/_Collector.py +16 −16 Original line number Diff line number Diff line # Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) # Copyright 2022-2024 ETSI SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. Loading @@ -15,7 +15,7 @@ import threading from typing import Any, Iterator, List, Optional, Tuple, Union # Special resource names to request to the driver to retrieve the specified # Special resource names to request to the collector to retrieve the specified # configuration/structural resources. # These resource names should be used with GetConfig() method. RESOURCE_ENDPOINTS = '__endpoints__' Loading @@ -27,16 +27,16 @@ RESOURCE_ACL = '__acl__' RESOURCE_INVENTORY = '__inventory__' class _Driver: class _Collector: def __init__(self, name : str, address: str, port: int, **settings) -> None: """ Initialize Driver. """ Initialize Collector. Parameters: address : str The address of the device port : int The port of the device **settings Extra settings required by the driver. Extra settings required by the collector. """ self._name = name self._address = address Loading Loading @@ -139,7 +139,7 @@ class _Driver: List[Union[bool, Exception]]: """ Subscribe to state information of entire device or selected resources. Subscriptions are incremental. Driver should keep track of requested resources. Collector should keep track of requested resources. Parameters: subscriptions : List[Tuple[str, float, float]] List of tuples, each containing a resource_key pointing the Loading @@ -162,7 +162,7 @@ class _Driver: -> List[Union[bool, Exception]]: """ Unsubscribe from state information of entire device or selected resources. Subscriptions are incremental. Driver should keep track of requested resources. Collector should keep track of requested resources. Parameters: subscriptions : List[str] List of tuples, each containing a resource_key pointing the Loading @@ -188,37 +188,37 @@ class _Driver: Operates as a generator, so this method should be called once and will block until values are available. When values are available, it should yield each of them and block again until new values are available. When the driver is destroyed, GetState() can return instead available. When the collector is destroyed, GetState() can return instead of yield to terminate the loop. Terminate enables to request interruption of the generation. Examples: # keep looping waiting for extra samples (generator loop) terminate = threading.Event() i = 0 for timestamp,resource_key,resource_value in my_driver.GetState(blocking=True, terminate=terminate): for timestamp,resource_key,resource_value in my_collector.GetState(blocking=True, terminate=terminate): process(timestamp, resource_key, resource_value) i += 1 if i == 10: terminate.set() # just retrieve accumulated samples samples = my_driver.GetState(blocking=False, terminate=terminate) samples = my_collector.GetState(blocking=False, terminate=terminate) # or (as classical loop) i = 0 for timestamp,resource_key,resource_value in my_driver.GetState(blocking=False, terminate=terminate): for timestamp,resource_key,resource_value in my_collector.GetState(blocking=False, terminate=terminate): process(timestamp, resource_key, resource_value) i += 1 if i == 10: terminate.set() Parameters: blocking : bool Select the driver behaviour. In both cases, the driver will Select the collector behaviour. In both cases, the collector will first retrieve the samples accumulated and available in the internal queue. Then, if blocking, the driver does not internal queue. Then, if blocking, the collector does not terminate the loop and waits for additional samples to come, thus behaving as a generator. If non-blocking, the driver thus behaving as a generator. If non-blocking, the collector terminates the loop and returns. Non-blocking behaviour can be used for periodically polling the driver, while blocking be used for periodically polling the collector, while blocking can be used when a separate thread is in charge of collecting the samples produced by the driver. collecting the samples produced by the collector. terminate : threading.Event Signals the interruption of the GetState method as soon as possible. Loading src/telemetry/backend/drivers/emulated/__init__.py→src/telemetry/backend/collector_api/__init__.py +1 −1 Original line number Diff line number Diff line # Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) # Copyright 2022-2024 ETSI SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. Loading src/telemetry/backend/driver_api/__init__.py→src/telemetry/backend/collectors/__init__.py +1 −1 Original line number Diff line number Diff line # Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) # Copyright 2022-2024 ETSI SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. Loading Loading
my_deploy.sh +1 −1 Original line number Diff line number Diff line Loading @@ -26,7 +26,7 @@ export TFS_COMPONENTS="context device pathcomp service slice nbi webui" #export TFS_COMPONENTS="${TFS_COMPONENTS} monitoring" # Uncomment to activate Monitoring Framework (new) export TFS_COMPONENTS="${TFS_COMPONENTS} kpi_manager kpi_value_writer kpi_value_api telemetry analytics automation" #export TFS_COMPONENTS="${TFS_COMPONENTS} kpi_manager kpi_value_writer kpi_value_api telemetry analytics automation" # Uncomment to activate QoS Profiles #export TFS_COMPONENTS="${TFS_COMPONENTS} qos_profile" Loading
scripts/run_tests_locally-telemetry-emulated.sh +1 −1 Original line number Diff line number Diff line #!/bin/bash # Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) # Copyright 2022-2024 ETSI SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. Loading
src/telemetry/backend/driver_api/_Driver.py→src/telemetry/backend/collector_api/_Collector.py +16 −16 Original line number Diff line number Diff line # Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) # Copyright 2022-2024 ETSI SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. Loading @@ -15,7 +15,7 @@ import threading from typing import Any, Iterator, List, Optional, Tuple, Union # Special resource names to request to the driver to retrieve the specified # Special resource names to request to the collector to retrieve the specified # configuration/structural resources. # These resource names should be used with GetConfig() method. RESOURCE_ENDPOINTS = '__endpoints__' Loading @@ -27,16 +27,16 @@ RESOURCE_ACL = '__acl__' RESOURCE_INVENTORY = '__inventory__' class _Driver: class _Collector: def __init__(self, name : str, address: str, port: int, **settings) -> None: """ Initialize Driver. """ Initialize Collector. Parameters: address : str The address of the device port : int The port of the device **settings Extra settings required by the driver. Extra settings required by the collector. """ self._name = name self._address = address Loading Loading @@ -139,7 +139,7 @@ class _Driver: List[Union[bool, Exception]]: """ Subscribe to state information of entire device or selected resources. Subscriptions are incremental. Driver should keep track of requested resources. Collector should keep track of requested resources. Parameters: subscriptions : List[Tuple[str, float, float]] List of tuples, each containing a resource_key pointing the Loading @@ -162,7 +162,7 @@ class _Driver: -> List[Union[bool, Exception]]: """ Unsubscribe from state information of entire device or selected resources. Subscriptions are incremental. Driver should keep track of requested resources. Collector should keep track of requested resources. Parameters: subscriptions : List[str] List of tuples, each containing a resource_key pointing the Loading @@ -188,37 +188,37 @@ class _Driver: Operates as a generator, so this method should be called once and will block until values are available. When values are available, it should yield each of them and block again until new values are available. When the driver is destroyed, GetState() can return instead available. When the collector is destroyed, GetState() can return instead of yield to terminate the loop. Terminate enables to request interruption of the generation. Examples: # keep looping waiting for extra samples (generator loop) terminate = threading.Event() i = 0 for timestamp,resource_key,resource_value in my_driver.GetState(blocking=True, terminate=terminate): for timestamp,resource_key,resource_value in my_collector.GetState(blocking=True, terminate=terminate): process(timestamp, resource_key, resource_value) i += 1 if i == 10: terminate.set() # just retrieve accumulated samples samples = my_driver.GetState(blocking=False, terminate=terminate) samples = my_collector.GetState(blocking=False, terminate=terminate) # or (as classical loop) i = 0 for timestamp,resource_key,resource_value in my_driver.GetState(blocking=False, terminate=terminate): for timestamp,resource_key,resource_value in my_collector.GetState(blocking=False, terminate=terminate): process(timestamp, resource_key, resource_value) i += 1 if i == 10: terminate.set() Parameters: blocking : bool Select the driver behaviour. In both cases, the driver will Select the collector behaviour. In both cases, the collector will first retrieve the samples accumulated and available in the internal queue. Then, if blocking, the driver does not internal queue. Then, if blocking, the collector does not terminate the loop and waits for additional samples to come, thus behaving as a generator. If non-blocking, the driver thus behaving as a generator. If non-blocking, the collector terminates the loop and returns. Non-blocking behaviour can be used for periodically polling the driver, while blocking be used for periodically polling the collector, while blocking can be used when a separate thread is in charge of collecting the samples produced by the driver. collecting the samples produced by the collector. terminate : threading.Event Signals the interruption of the GetState method as soon as possible. Loading
src/telemetry/backend/drivers/emulated/__init__.py→src/telemetry/backend/collector_api/__init__.py +1 −1 Original line number Diff line number Diff line # Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) # Copyright 2022-2024 ETSI SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. Loading
src/telemetry/backend/driver_api/__init__.py→src/telemetry/backend/collectors/__init__.py +1 −1 Original line number Diff line number Diff line # Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) # Copyright 2022-2024 ETSI SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. Loading