Initial commit of mc-core part of mc xApp codebase
[ric-app/mc.git] / mc-core / mc / queries / rrcx_pdf_cell.gsql
1
2 DEFINE{ query_name 'rrcx_pdf_neigh_cell_csi'; }
3 PARAM{ window uint;}
4 //      rsrp, rsrq, sinr ranges are 0 .. 127
5 //      for now divide into 5 bins.
6
7 select ($window*(tb+1))/1000 as TS, $window/1000.0 as measurementInterval,
8         physCellId as CELL_ID,
9         count(*) as cnt,
10         sum(GEQ(rsrp, 0)*LEQ(rsrp,37)) as rsrp_vbad,
11         sum(GEQ(rsrp,38)*LEQ(rsrp,52)) as rsrp_bad,
12         sum(GEQ(rsrp,52)*LEQ(rsrp,67)) as rsrp_medium,
13         sum(GEQ(rsrp,68)*LEQ(rsrp,82)) as rsrp_good,
14         sum(GEQ(rsrp,83)*LEQ(rsrp,127)) as rsrp_vgood
15 from RRCXFER.neighbor_beam_csi
16 where schemaId = 5
17 group by timestamp_ms/$window as tb, physCellId
18 ;
19
20 DEFINE{ query_name 'rrcx_pdf_neigh_gnb_csi'; }
21 PARAM{ window uint;}
22 //      rsrp, rsrq, sinr ranges are 0 .. 127
23 //      for now divide into 5 bins.
24
25 select ($window*(tb+1))/1000 as TS, $window/1000.0 as measurementInterval,
26         gnb_id as GNB_ID,
27         count(*) as cnt,
28         sum(GEQ(rsrp, 0)*LEQ(rsrp,37)) as rsrp_vbad,
29         sum(GEQ(rsrp,38)*LEQ(rsrp,52)) as rsrp_bad,
30         sum(GEQ(rsrp,52)*LEQ(rsrp,67)) as rsrp_medium,
31         sum(GEQ(rsrp,68)*LEQ(rsrp,82)) as rsrp_good,
32         sum(GEQ(rsrp,83)*LEQ(rsrp,127)) as rsrp_vgood
33 from RRCXFER.neighbor_beam_csi
34 where schemaId = 5
35 group by timestamp_ms/$window as tb, gnb_id
36 ;
37
38
39 DEFINE{ query_name 'rrcx_pdf_neigh_cell_ssb'; }
40 PARAM{ window uint;}
41 //      rsrp, rsrq, sinr ranges are 0 .. 127
42 //      for now divide into 5 bins.
43
44 select ($window*(tb+1))/1000 as TS, $window/1000.0 as measurementInterval,
45         physCellId as CELL_ID,
46         count(*) as cnt,
47         sum(GEQ(rsrp, 0)*LEQ(rsrp,37)) as rsrp_vbad,
48         sum(GEQ(rsrp,38)*LEQ(rsrp,52)) as rsrp_bad,
49         sum(GEQ(rsrp,52)*LEQ(rsrp,67)) as rsrp_medium,
50         sum(GEQ(rsrp,68)*LEQ(rsrp,82)) as rsrp_good,
51         sum(GEQ(rsrp,83)*LEQ(rsrp,127)) as rsrp_vgood
52 from RRCXFER.neighbor_beam_ssb
53 where schemaId = 5
54 group by timestamp_ms/$window as tb, physCellId
55 ;
56
57 DEFINE{ query_name 'rrcx_pdf_neigh_gnb_ssb'; }
58 PARAM{ window uint;}
59 //      rsrp, rsrq, sinr ranges are 0 .. 127
60 //      for now divide into 5 bins.
61
62 select ($window*(tb+1))/1000 as TS, $window/1000.0 as measurementInterval,
63         gnb_id as GNB_ID,
64         count(*) as cnt,
65         sum(GEQ(rsrp, 0)*LEQ(rsrp,37)) as rsrp_vbad,
66         sum(GEQ(rsrp,38)*LEQ(rsrp,52)) as rsrp_bad,
67         sum(GEQ(rsrp,52)*LEQ(rsrp,67)) as rsrp_medium,
68         sum(GEQ(rsrp,68)*LEQ(rsrp,82)) as rsrp_good,
69         sum(GEQ(rsrp,83)*LEQ(rsrp,127)) as rsrp_vgood
70 from RRCXFER.neighbor_beam_ssb
71 where schemaId = 5
72 group by timestamp_ms/$window as tb, gnb_id
73 ;
74
75
76
77 DEFINE{ query_name 'rrcx_pdf_serv_cell'; }
78 PARAM{ window uint;}
79 //      rsrp, rsrq, sinr ranges are 0 .. 127
80 //      for now divide into 5 bins.
81
82 select ($window*(tb+1))/1000 as TS, $window/1000.0 as measurementInterval,
83         physCellId as CELL_ID,
84         count(*) as cnt,
85         sum(GEQ(rsrp, 0)*LEQ(rsrp,21)) as rsrp_vbad,
86         sum(GEQ(rsrp,22)*LEQ(rsrp,36)) as rsrp_bad,
87         sum(GEQ(rsrp,37)*LEQ(rsrp,51)) as rsrp_medium,
88         sum(GEQ(rsrp,52)*LEQ(rsrp,66)) as rsrp_good,
89         sum(GEQ(rsrp,67)*LEQ(rsrp,127)) as rsrp_vgood
90 from RRCXFER.serv_nr_cell
91 where schemaId = 1
92 group by timestamp_ms/$window as tb, physCellId
93 ;
94
95 DEFINE{ query_name 'rrcx_pdf_serv_gnb'; }
96 PARAM{ window uint;}
97 //      rsrp, rsrq, sinr ranges are 0 .. 127
98 //      for now divide into 5 bins.
99
100 select ($window*(tb+1))/1000 as TS, $window/1000.0 as measurementInterval,
101         gnb_id as GNB_ID,
102         count(*) as cnt,
103         sum(GEQ(rsrp, 0)*LEQ(rsrp,21)) as rsrp_vbad,
104         sum(GEQ(rsrp,22)*LEQ(rsrp,36)) as rsrp_bad,
105         sum(GEQ(rsrp,37)*LEQ(rsrp,51)) as rsrp_medium,
106         sum(GEQ(rsrp,52)*LEQ(rsrp,66)) as rsrp_good,
107         sum(GEQ(rsrp,67)*LEQ(rsrp,127)) as rsrp_vgood
108 from RRCXFER.serv_nr_cell
109 where schemaId = 1
110 group by timestamp_ms/$window as tb, gnb_id
111