JoeOLeary | 924ab47 | 2019-02-15 13:46:01 +0000 | [diff] [blame] | 1 | <#ftl ns_prefixes={"D":"http://www.3gpp.org/ftp/specs/archive/32_series/32.435#measCollec"}> |
| 2 | <#-- |
| 3 | ============LICENSE_START======================================================= |
| 4 | Copyright (C) 2019 Nordix Foundation. |
Stanislav Marszalek | 1f08f4c | 2021-08-10 10:09:05 +0200 | [diff] [blame^] | 5 | Copyright (C) 2021 Samsung Electronics. |
JoeOLeary | 924ab47 | 2019-02-15 13:46:01 +0000 | [diff] [blame] | 6 | ================================================================================ |
| 7 | Licensed under the Apache License, Version 2.0 (the "License"); |
| 8 | you may not use this file except in compliance with the License. |
| 9 | You may obtain a copy of the License at |
| 10 | |
| 11 | http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | |
| 13 | Unless required by applicable law or agreed to in writing, software |
| 14 | distributed under the License is distributed on an "AS IS" BASIS, |
| 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 | See the License for the specific language governing permissions and |
| 17 | limitations under the License. |
| 18 | |
| 19 | SPDX-License-Identifier: Apache-2.0 |
| 20 | ============LICENSE_END========================================================= |
| 21 | --> |
emartin | 91c6030 | 2019-05-07 10:41:55 +0000 | [diff] [blame] | 22 | <#compress> |
JoeOLeary | 924ab47 | 2019-02-15 13:46:01 +0000 | [diff] [blame] | 23 | <#assign fileHeader = xml.measCollecFile.fileHeader> |
| 24 | <#assign fileFooter = xml.measCollecFile.fileFooter> |
| 25 | <#assign measData = xml.measCollecFile.measData> |
| 26 | <#setting datetime_format="iso"> |
| 27 | { |
| 28 | "event": { |
| 29 | "commonEventHeader": <@commonEventHeader/> |
| 30 | <#if measData?has_content>, |
| 31 | "perf3gppFields": <@perf3gppFields/> |
| 32 | </#if> |
| 33 | } |
| 34 | } |
| 35 | |
| 36 | |
| 37 | <#macro commonEventHeader> |
| 38 | { |
| 39 | "domain": "perf3gpp", |
| 40 | "eventId": "${eventId}", |
| 41 | "sequence": 0, |
| 42 | "eventName": "perf3gpp_${metadata.productName}-${metadata.vendorName}_pmMeasResult", |
| 43 | "sourceName": "${metadata.sourceName}", |
| 44 | "reportingEntityName": "", |
| 45 | "priority": "Normal", |
| 46 | "startEpochMicrosec": ${fileHeader.measCollec.@beginTime?datetime?long?c}, |
| 47 | "lastEpochMicrosec": ${fileFooter.measCollec.@endTime?datetime?long?c}, |
| 48 | "version": "4.0", |
| 49 | "vesEventListenerVersion": "7.1", |
| 50 | "timeZoneOffset": "${metadata.timeZoneOffset}" |
| 51 | } |
| 52 | </#macro> |
| 53 | |
| 54 | |
| 55 | <#macro measTypes measInfo> |
| 56 | { |
| 57 | "sMeasTypesList":[ |
| 58 | <#if measInfo.measType?has_content> |
| 59 | <#list measInfo.measType as measType> |
| 60 | "${measType}"<#sep>,</#sep> |
| 61 | </#list> |
| 62 | <#else> |
| 63 | <#list measInfo.measTypes?split(" ") as measType> |
| 64 | "${measType}"<#sep>,</#sep> |
| 65 | </#list> |
| 66 | </#if> |
| 67 | ] |
| 68 | } |
| 69 | </#macro> |
| 70 | |
| 71 | |
| 72 | <#macro measValuesList measInfo> |
| 73 | [ |
JoeOLeary | b49956c | 2019-03-13 16:26:21 +0000 | [diff] [blame] | 74 | <#list measInfo.measValue as measValue> |
JoeOLeary | 924ab47 | 2019-02-15 13:46:01 +0000 | [diff] [blame] | 75 | { |
JoeOLeary | b49956c | 2019-03-13 16:26:21 +0000 | [diff] [blame] | 76 | "measObjInstId": "${measValue.@measObjLdn[0]!}", |
| 77 | "suspectFlag": "${measValue.suspect[0]! "false"}", |
JoeOLeary | 924ab47 | 2019-02-15 13:46:01 +0000 | [diff] [blame] | 78 | "measResults": [ |
JoeOLeary | b49956c | 2019-03-13 16:26:21 +0000 | [diff] [blame] | 79 | <#if measValue.r?has_content> |
| 80 | <#list measValue.r as r> |
JoeOLeary | 924ab47 | 2019-02-15 13:46:01 +0000 | [diff] [blame] | 81 | { |
| 82 | "p": ${r.@p}, |
| 83 | "sValue": "${r}" |
| 84 | }<#sep>,</#sep> |
| 85 | </#list> |
| 86 | <#else> |
JoeOLeary | b49956c | 2019-03-13 16:26:21 +0000 | [diff] [blame] | 87 | <#list measValue.measResults?split(" ") as r> |
JoeOLeary | 924ab47 | 2019-02-15 13:46:01 +0000 | [diff] [blame] | 88 | { |
| 89 | "p":${r?index+1}, |
| 90 | "sValue": "${r}" |
| 91 | }<#sep>,</#sep> |
| 92 | </#list> |
| 93 | </#if> |
| 94 | ] |
| 95 | } |
JoeOLeary | b49956c | 2019-03-13 16:26:21 +0000 | [diff] [blame] | 96 | <#sep>,</#sep> |
| 97 | </#list> |
JoeOLeary | 924ab47 | 2019-02-15 13:46:01 +0000 | [diff] [blame] | 98 | ] |
| 99 | </#macro> |
| 100 | |
| 101 | |
| 102 | <#macro measInfoList> |
| 103 | [ |
| 104 | <#list measData.measInfo as measInfo> |
| 105 | { |
| 106 | "measInfoId": { |
| 107 | "sMeasInfoId": "${measInfo.@measInfoId[0]!}" |
| 108 | }, |
| 109 | "measTypes": <@measTypes measInfo/>, |
| 110 | "measValuesList": <@measValuesList measInfo/> |
| 111 | }<#sep>,</#sep> |
| 112 | </#list> |
| 113 | ] |
| 114 | </#macro> |
| 115 | |
| 116 | |
| 117 | <#macro measDataCollection> |
| 118 | { |
Stanislav Marszalek | 1f08f4c | 2021-08-10 10:09:05 +0200 | [diff] [blame^] | 119 | "granularityPeriod": ${measData.measInfo.granPeriod.@durationInSeconds[0]!}, |
JoeOLeary | 924ab47 | 2019-02-15 13:46:01 +0000 | [diff] [blame] | 120 | "measuredEntityUserName": "${measData.managedElement.@userLabel[0]!}", |
emartin | ea5f0af | 2019-04-15 11:03:19 +0000 | [diff] [blame] | 121 | "measuredEntityDn": "${measData.managedElement.@localDn[0]!}", |
JoeOLeary | b49956c | 2019-03-13 16:26:21 +0000 | [diff] [blame] | 122 | "measuredEntitySoftwareVersion": "${measData.managedElement.@swVersion[0]!}", |
JoeOLeary | 924ab47 | 2019-02-15 13:46:01 +0000 | [diff] [blame] | 123 | "measInfoList": <@measInfoList/> |
| 124 | } |
| 125 | </#macro> |
| 126 | |
| 127 | |
| 128 | <#macro perf3gppFields> |
| 129 | { |
| 130 | "perf3gppFieldsVersion": "1.0", |
| 131 | "measDataCollection": <@measDataCollection/> |
| 132 | } |
| 133 | </#macro> |
emartin | 91c6030 | 2019-05-07 10:41:55 +0000 | [diff] [blame] | 134 | </#compress> |