Loading src/slice/service/slice_grouper/SliceGrouper.py +1 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ class SliceGrouper: def __init__(self) -> None: self._lock = threading.Lock() self._is_enabled = is_slice_grouping_enabled() LOGGER.info('Slice Grouping: {:s}'.format('ENABLED' if self._is_enabled else 'DISABLED')) if not self._is_enabled: return metrics_exporter = MetricsExporter() Loading src/slice/service/slice_grouper/Tools.py +8 −0 Original line number Diff line number Diff line Loading @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. import logging from typing import Dict, List, Optional, Set, Tuple from common.Constants import DEFAULT_CONTEXT_NAME from common.Settings import get_setting Loading @@ -27,7 +28,14 @@ TRUE_VALUES = {'Y', 'YES', 'TRUE', 'T', 'E', 'ENABLE', 'ENABLED'} NO_ISOLATION = IsolationLevelEnum.NO_ISOLATION LOGGER = logging.getLogger(__name__) def is_slice_grouping_enabled() -> bool: # Temporal hack for OFC'23 multi-demo: metricsdb_hostname = get_setting('METRICSDB_HOSTNAME', default='') LOGGER.warning('metricsdb_hostname={:s}'.format(str(metricsdb_hostname))) if '.qdb-sligrp.' in metricsdb_hostname: return True # end hack is_enabled = get_setting(SETTING_NAME_SLICE_GROUPING, default=None) if is_enabled is None: return False str_is_enabled = str(is_enabled).upper() Loading Loading
src/slice/service/slice_grouper/SliceGrouper.py +1 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ class SliceGrouper: def __init__(self) -> None: self._lock = threading.Lock() self._is_enabled = is_slice_grouping_enabled() LOGGER.info('Slice Grouping: {:s}'.format('ENABLED' if self._is_enabled else 'DISABLED')) if not self._is_enabled: return metrics_exporter = MetricsExporter() Loading
src/slice/service/slice_grouper/Tools.py +8 −0 Original line number Diff line number Diff line Loading @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. import logging from typing import Dict, List, Optional, Set, Tuple from common.Constants import DEFAULT_CONTEXT_NAME from common.Settings import get_setting Loading @@ -27,7 +28,14 @@ TRUE_VALUES = {'Y', 'YES', 'TRUE', 'T', 'E', 'ENABLE', 'ENABLED'} NO_ISOLATION = IsolationLevelEnum.NO_ISOLATION LOGGER = logging.getLogger(__name__) def is_slice_grouping_enabled() -> bool: # Temporal hack for OFC'23 multi-demo: metricsdb_hostname = get_setting('METRICSDB_HOSTNAME', default='') LOGGER.warning('metricsdb_hostname={:s}'.format(str(metricsdb_hostname))) if '.qdb-sligrp.' in metricsdb_hostname: return True # end hack is_enabled = get_setting(SETTING_NAME_SLICE_GROUPING, default=None) if is_enabled is None: return False str_is_enabled = str(is_enabled).upper() Loading