blob: 4d3b9b763b7b636395e3037d6d05ec96a972bdb7 [file] [log] [blame]
JoeOLeary924ab472019-02-15 13:46:01 +00001<#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 Marszalek1f08f4c2021-08-10 10:09:05 +02005 Copyright (C) 2021 Samsung Electronics.
JoeOLeary924ab472019-02-15 13:46:01 +00006 ================================================================================
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 -->
emartin91c60302019-05-07 10:41:55 +000022<#compress>
JoeOLeary924ab472019-02-15 13:46:01 +000023<#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[
JoeOLearyb49956c2019-03-13 16:26:21 +000074<#list measInfo.measValue as measValue>
JoeOLeary924ab472019-02-15 13:46:01 +000075 {
JoeOLearyb49956c2019-03-13 16:26:21 +000076 "measObjInstId": "${measValue.@measObjLdn[0]!}",
77 "suspectFlag": "${measValue.suspect[0]! "false"}",
JoeOLeary924ab472019-02-15 13:46:01 +000078 "measResults": [
JoeOLearyb49956c2019-03-13 16:26:21 +000079 <#if measValue.r?has_content>
80 <#list measValue.r as r>
JoeOLeary924ab472019-02-15 13:46:01 +000081 {
82 "p": ${r.@p},
83 "sValue": "${r}"
84 }<#sep>,</#sep>
85 </#list>
86 <#else>
JoeOLearyb49956c2019-03-13 16:26:21 +000087 <#list measValue.measResults?split(" ") as r>
JoeOLeary924ab472019-02-15 13:46:01 +000088 {
89 "p":${r?index+1},
90 "sValue": "${r}"
91 }<#sep>,</#sep>
92 </#list>
93 </#if>
94 ]
95 }
JoeOLearyb49956c2019-03-13 16:26:21 +000096<#sep>,</#sep>
97</#list>
JoeOLeary924ab472019-02-15 13:46:01 +000098]
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 Marszalek1f08f4c2021-08-10 10:09:05 +0200119 "granularityPeriod": ${measData.measInfo.granPeriod.@durationInSeconds[0]!},
JoeOLeary924ab472019-02-15 13:46:01 +0000120 "measuredEntityUserName": "${measData.managedElement.@userLabel[0]!}",
emartinea5f0af2019-04-15 11:03:19 +0000121 "measuredEntityDn": "${measData.managedElement.@localDn[0]!}",
JoeOLearyb49956c2019-03-13 16:26:21 +0000122 "measuredEntitySoftwareVersion": "${measData.managedElement.@swVersion[0]!}",
JoeOLeary924ab472019-02-15 13:46:01 +0000123 "measInfoList": <@measInfoList/>
124}
125</#macro>
126
127
128<#macro perf3gppFields>
129{
130 "perf3gppFieldsVersion": "1.0",
131 "measDataCollection": <@measDataCollection/>
132}
133</#macro>
emartin91c60302019-05-07 10:41:55 +0000134</#compress>