...
- Login to dcae-mongodb container and execute following commands to check if PM data was saved in DB:
- mongo
- use datalake
- db.unauthenticatedperformancemeasurements.find({})
to load sample data:
Code Block title mongodb sample mongodb data 1 linenumbers true collapse true db.unauthenticatedperformancemeasurements.insert({ "event": { "commonEventHeader": { "domain": "perf3gpp", "eventId": "dfe43a5c-0868-4275-b1c9-e45945b6a38c", "eventName": "perf3gpp_CORE-cucpserver2_pmMeasResult", "lastEpochMicrosec": 1610689590387, "priority": "Normal", "reportingEntityName": "", "sequence": 1, "sourceName": "oteNB5309", "startEpochMicrosec": 1610689590387, "version": 4, "vesEventListenerVersion": "7.1", "timeZoneOffset": "UTC+05:00" }, "perf3gppFields": { "perf3gppFieldsVersion": "1.0", "measDataCollection": { "granularityPeriod": 900, "measuredEntityUserName": "", "measuredEntityDn": "cucpserver2", "measuredEntitySoftwareVersion": "r0.1", "measInfoList": [ { "measInfoId": { "sMeasTypesList": "SLICE" }, "measTypes": { "sMeasTypesList": [ "PDUSessionEstSR.00110010" ] }, "measValuesList": [ { "suspectFlag": false, "measResults": [ { "p": 1, "sValue": "166" } ] } ] } ] } } } })
Code Block title mongodb sample data 2 linenumbers true collapse true db.unauthenticatedperformancemeasurements.insert({ "event": { "commonEventHeader": { "domain": "perf3gpp", "eventId": "df069b2e-0993-4aca-9e5e-60a11c6e3399", "eventName": "perf3gpp_CORE-cucpserver2_pmMeasResult", "lastEpochMicrosec": 1606743157915, "priority": "Normal", "reportingEntityName": "", "sequence": 1, "sourceName": "oteNB5309", "startEpochMicrosec": 1606743157914, "version": 4, "vesEventListenerVersion": "7.1", "timeZoneOffset": "UTC+05:00" }, "perf3gppFields": { "perf3gppFieldsVersion": "1.0", "measDataCollection": { "granularityPeriod": 900, "measuredEntityUserName": "", "measuredEntityDn": "cucpserver2", "measuredEntitySoftwareVersion": "r0.1", "measInfoList": [ { "measInfoId": { "sMeasTypesList": "SLICE" }, "measTypes": { "sMeasTypesList": [ "PDUSessionEstSR.00110010" ] }, "measValuesList": [ { "suspectFlag": false, "measResults": [ { "p": 1, "sValue": "188" } ] } ] } ] } } } })
...
- Build presto image and push the images to a exsting repository
- Download and extract presto package version v0.0.2: presto-v0.0.2.tar.gz
- docker build -t presto:v0.0.2 .
- docker tag presto:v0.0.2 registry.baidubce.com/onap/presto:v0.0.2
- docker push registry.baidubce.com/onap/presto:v0.0.2
- Note: Replace the repository path with your own repository.
- Install presto service
- kubectl -n onap run dl-presto --image=presto:v0.0.2 --env="MongoDB_IP=dcae-mongohost" --env="MongoDB_PORT=27017" --image-pull-policy=IfNotPresent
- kubectl expose pod dl-presto --name=dl-presto --port=9000 --target-port=9000 --type=NodePort -n onap
Login to the dev-dcae-datalake-postgres-primary container and execute following sql commands:
Code Block title datalake-db init_data linenumbers true collapse true psql -Udatalake -ddatalake \dt delete from map_db_topic; delete from map_db_design; delete from db; delete from data_exposure ; insert into db (id, db_type_id, enabled, encrypt, name,host,port,database_name) values (2, 'MONGO', true, true, 'MongoDB 1','dcae-mongohost',27017,'datalake'); insert into map_db_topic(db_id,topic_id) select db.id, topic.id from db_type, db, topic where db.db_type_id=db_type.id and db_type.tool=false; update kafka set secure=true, pass='admin_secret' where id=1; insert into topic_name (id) values ('unauthenticated.PERFORMANCE_MEASUREMENTS'); insert into topic(id, topic_name_id,correlate_cleared_message,enabled, message_id_path,data_format) values (6, 'unauthenticated.PERFORMANCE_MEASUREMENTS',true,true,'/event/commonEventHeader','JSON'); insert into data_exposure(id, note,sql_template,db_id) values ('pDUSessionEstSR','pm_message', 'SELECT event.perf3gppFields.measDataCollection.measInfoList[1].measValuesList[1].measResults[1].sValue AS pDUSessionEstSR, event.commonEventHeader.startEpochMicrosec AS timeStamp FROM unauthenticatedperformancemeasurements WHERE any_match(event.perf3gppFields.measDataCollection.measInfoList[1].measTypes.sMeasTypesList, e -> e like ''${id}'') AND event.commonEventHeader.startEpochMicrosec >= ${timeStamp}',2);
- Execute below request to verify:
curl --header "Content-type: application/json" --request POST --data '{"hours":4,"id":"PDUSessionEstSR.00110010","timeStamp":"1606743157914"}' http://dl-des:1681/datalake/v1/exposure/pDUSessionEstSR -i
...