Commit 81b25ce0 authored by Andrea Sgambelluri's avatar Andrea Sgambelluri
Browse files

working closed loop and threshold

parent 362464e1
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@
    "analyzer":{
        "operation_mode": "ANALYZEROPERATIONMODE_STREAMING",
        "parameters": {
            "thresholds": "{\"task_type\": \"AggregationHandler\",\"task_parameter\": [ {\"avg\": [-5, -25]}]}"
            "thresholds": "{\"task_type\": \"AggregationHandler\",\"task_parameter\": [ {\"last\": [-20, 5]}]}"
        },
        "input_kpi_ids": [
            {"kpi_id": { "uuid": "6e22f180-ba28-4641-b190-2287bf447777"}}
+14 −0
Original line number Diff line number Diff line
@@ -20,6 +20,20 @@ cd src/
CRDB_SQL_ADDRESS=$(kubectl get service --namespace ${CRDB_NAMESPACE} cockroachdb-public -o 'jsonpath={.spec.clusterIP}')
export CRDB_URI="cockroachdb://tfs:tfs123@${CRDB_SQL_ADDRESS}:26257/tfs_kpi_mgmt?sslmode=require"

#added for kafka exposure
export KFK_SERVER_ADDRESS='127.0.0.1:9094'

kubectl port-forward -n kafka service/kafka-public 9094:9094 > /dev/null 2>&1 &
KAFKA_PF_PID=$!

# Function to cleanup port-forward on exit
cleanup() {
    # echo "Cleaning up Kafka port-forward (PID: ${KAFKA_PF_PID})..."
    kill ${KAFKA_PF_PID} 2>/dev/null || true
    wait ${KAFKA_PF_PID} 2>/dev/null || true
}


IP_KPI=$(kubectl get all --all-namespaces | grep service/kpi-managerservice | awk '{print $4}')
export IP_KPI
echo "KPI Manager Service IP: ${IP_KPI}"
+2 −2
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@ def create_kpi_descriptor_request(descriptor_name: str = "Test_name"):
    _create_kpi_request.device_id.device_uuid.uuid         = "ddb3ef8e-ee65-5cf9-9d21-dac56a27f85b"         # confirm for TFS
    _create_kpi_request.service_id.service_uuid.uuid       = "b2a60c5b-8c46-5707-a64a-9c6539d395f2"
    # _create_kpi_request.slice_id.slice_uuid.uuid           = 'SLC1'
    _create_kpi_request.endpoint_id.endpoint_uuid.uuid     = "<>"
    _create_kpi_request.endpoint_id.endpoint_uuid.uuid     = "2"
    # _create_kpi_request.connection_id.connection_uuid.uuid = 'CON1' 
    # _create_kpi_request.link_id.link_uuid.uuid             = 'LNK1' 
    return _create_kpi_request
@@ -35,7 +35,7 @@ devices = {
        'kpi'        : KPI.KPISAMPLETYPE_OPTICAL_TOTAL_INPUT_POWER,
        #'resource': 'oc-wave-router:wavelength-router/fsmgon:optical-bands/optical-band[index=4]/state/optical-power-total-input/instant',
        'resource'   : 'wavelength-router',            #TODO: verify resource name form mg-on model
        'endpoint'   : '1',
        'endpoint'   : '2',
        'skip_verify': True
    },
}
+1 −1
Original line number Diff line number Diff line
@@ -104,7 +104,7 @@ def test_Complete_MGON_Integration(kpi_manager_client, telemetry_frontend_client
    collector_thread = threading.Thread(
        target=_service.GenericCollectorHandler,
        args=(
            _coll_id, _collector, None, _duration, _interval,
            _coll_id, _collector, "6e22f180-ba28-4641-b190-2287bf447777", _duration, _interval,
            None, None, None, "43813baf-195e-5da6-af20-b3d0922e71a7", stop_event
        ),
        daemon=False