Adding MC-NIB support
[ric-app/mc.git] / mc-core / mc / queries / addreq_pdf.gsql
1 DEFINE{ query_name 'addreq_pdf_nr_cell'; 
2         max_lfta_disorder '1'; max_hfta_disorder '1';
3         comment 'histogram of neighboring cell RSRP, aggregated by cell id';
4 }
5 PARAM{ window uint;}
6 //      rsrp, rsrq, sinr ranges are 0 .. 127
7 //      for now divide into 5 bins.
8
9 select ($window*(tb+1))/1000 as TS, $window/1000.0 as measurementInterval,
10         physCellId as CELL_ID,
11         count(*) as cnt,
12         sum(GEQ(rsrp, 0)*LEQ(rsrp,37)) as rsrp_vbad,
13         sum(GEQ(rsrp,38)*LEQ(rsrp,52)) as rsrp_bad,
14         sum(GEQ(rsrp,52)*LEQ(rsrp,67)) as rsrp_medium,
15         sum(GEQ(rsrp,68)*LEQ(rsrp,82)) as rsrp_good,
16         sum(GEQ(rsrp,83)*LEQ(rsrp,127)) as rsrp_vgood
17 from SGNB_ADDITION_REQ.sgnb_addreq_for_ue_mn_neigh_ssb
18 //where schemaId = 410
19 group by timestamp_ms/$window as tb, physCellId
20 ;
21
22 DEFINE{ query_name 'addreq_pdf_nr_gnb'; 
23         max_lfta_disorder '1'; max_hfta_disorder '1';
24         comment 'histogram of neighboring cell RSRP, aggregated by GNB, as computed from addition request events.';
25 }
26 PARAM{ window uint;}
27 //      rsrp, rsrq, sinr ranges are 0 .. 127
28 //      for now divide into 5 bins.
29
30 select ($window*(tb+1))/1000 as TS, $window/1000.0 as measurementInterval,
31         gnb_id as GNB_ID,
32         count(*) as cnt,
33         sum(GEQ(rsrp, 0)*LEQ(rsrp,37)) as rsrp_vbad,
34         sum(GEQ(rsrp,38)*LEQ(rsrp,52)) as rsrp_bad,
35         sum(GEQ(rsrp,52)*LEQ(rsrp,67)) as rsrp_medium,
36         sum(GEQ(rsrp,68)*LEQ(rsrp,82)) as rsrp_good,
37         sum(GEQ(rsrp,83)*LEQ(rsrp,127)) as rsrp_vgood
38 from SGNB_ADDITION_REQ.sgnb_addreq_for_ue_mn_neigh_ssb
39 //where schemaId = 410
40 group by timestamp_ms/$window as tb, gnb_id
41