Adding additional KPIs, adding required documentation
[ric-app/mc.git] / mc-core / mc / queries / reconfig_status.gsql
1 DEFINE{query_name 'reconfig_status_start';}
2 PARAM{ window uint; }
3 select timestamp_ms as timestamp,
4         non_temporal(timestamp_ms) as start_time,
5         0ULL as end_time,
6         id_MeNB_UE_X2AP_ID as eUE_ID,
7         gnb_id,
8         0 as event_type
9 from SGNB_ADDITION_REQ.sgnb_addreq_for_ue
10 where schemaId=401
11 ;
12
13 DEFINE{query_name 'reconfig_status_success';}
14 PARAM{ window uint; }
15 select timestamp_ms as timestamp,
16         0ULL as start_time,
17         non_temporal(timestamp_ms) as end_time,
18         id_MeNB_UE_X2AP_ID as eUE_ID,
19         gnb_id,
20         1 as event_type
21 from RECONCOMPLETE.reconfig_success
22 where schemaId=101
23 ;
24
25 DEFINE{query_name 'reconfig_status_events';}
26 PARAM{ window uint; }
27 merge p1.timestamp : p2.timestamp
28 from reconfig_status_start p1, reconfig_status_success p2
29 ;
30
31
32 DEFINE{query_name 'reconfig_status_merge';
33         max_lfta_disorder '1'; max_hfta_disorder '1';
34 }
35 PARAM{ window uint; }
36 select eUE_ID, gnb_id, TB,
37         max(start_time) as max_start_time,
38         max(end_time) as max_end_time
39 from reconfig_status_events
40 group by eUE_ID, gnb_id, timestamp / $window as TB
41 ;
42
43 DEFINE{query_name 'reconfig_status_success_rate';
44         max_lfta_disorder '1'; max_hfta_disorder '1';
45 }
46 PARAM{ window uint; }
47 select gnb_id as GNB_ID,
48         ($window*(TB+1))/1000 as TS, 
49              $window/1000.0 as measurementInterval,
50         count(*) as total_reconfiguration_requests,
51         sum(GEQ(max_end_time,ULLONG(1))) as successful_reconfiguration_requests,
52         FLOAT(sum(GEQ(max_end_time,ULLONG(1))))/count(*) as success_rate
53 from reconfig_status_merge
54 group by gnb_id, TB
55 ;
56
57 // ----------------------------------------------
58 //      Merge in reconfig_reject causes and aggregate with this.
59 DEFINE{query_name 'reconfig_status_reject_cause';
60         max_lfta_disorder '1'; max_hfta_disorder '1';
61 }
62 PARAM{ window uint; }
63 Select gnb_id, TB,
64         count(*) as total_reconfig_reject,
65         sum(GEQ(UINT(cause_radio_network),0)) as count_radio_network,
66         sum(GEQ(UINT(cause_transport),0)) as count_transport,
67         sum(GEQ(UINT(cause_protocol),0)) as count_protocol,
68         sum(GEQ(UINT(cause_misc),0)) as count_misc
69 from ADDREQREJECT.sgnb_add_req_reject
70 where schemaId=701
71 group by gnb_id, timestamp_ms / $window as TB
72 ;
73
74 DEFINE{query_name 'reconfig_complete_reject_cause';
75         max_lfta_disorder '1'; max_hfta_disorder '1';
76 }
77 PARAM{ window uint; }
78 Select gnb_id, TB,
79         count(*) as total_reconfig_reject,
80         sum(GEQ(UINT(cause_radio_network),0)) as count_radio_network,
81         sum(GEQ(UINT(cause_transport),0)) as count_transport,
82         sum(GEQ(UINT(cause_protocol),0)) as count_protocol,
83         sum(GEQ(UINT(cause_misc),0)) as count_misc
84 from RECONCOMPLETE.reconfig_reject
85 where schemaId=102
86 group by gnb_id, timestamp_ms / $window as TB
87 ;
88
89 DEFINE{query_name 'reconfig_reject_merge';}
90 PARAM{ window uint; }
91 merge p1.TB : p2.TB
92 from reconfig_status_reject_cause p1, reconfig_complete_reject_cause p2
93 ;
94
95 DEFINE{query_name 'reconfig_reject_cause';
96         max_lfta_disorder '1'; max_hfta_disorder '1';
97 }
98 PARAM{ window uint; }
99 Select gnb_id as GNB_ID, ($window*(TB+1))/1000 as TS, 
100              $window/1000.0 as measurementInterval,
101         sum(total_reconfig_refuse) as total_reconfig_refuse,
102         sum(count_radio_network) as count_radio_network,
103         sum(count_transport) as count_transport,
104         sum(count_protocol) as count_protocol,
105         sum(count_misc) as count_misc
106 from reconfig_cause_merge
107 group by gnb_id, TB
108 ;
109
110 // ----------------------------------------------
111
112 DEFINE{query_name 'mod_status_refuse_cause';
113         max_lfta_disorder '1'; max_hfta_disorder '1';
114 }
115 PARAM{ window uint; }
116 Select gnb_id as GNB_ID, ($window*(TB+1))/1000 as TS, 
117              $window/1000.0 as measurementInterval,
118         count(*) as total_reconfig_refuse,
119         sum(GEQ(UINT(cause_radio_network),0)) as count_radio_network,
120         sum(GEQ(UINT(cause_transport),0)) as count_transport,
121         sum(GEQ(UINT(cause_protocol),0)) as count_protocol,
122         sum(GEQ(UINT(cause_misc),0)) as count_misc
123 from SGNBMODREFUSE.sgnb_mod_refuse
124 where schemaId=1401
125 group by gnb_id, timestamp_ms / $window as TB
126 ;
127
128 // ----------------------------------------------
129 DEFINE{query_name 'release_rqd_cause';
130         max_lfta_disorder '1'; max_hfta_disorder '1';
131 }
132 PARAM{ window uint; }
133 Select gnb_id, TB,
134         count(*) as total_reconfig_refuse,
135         sum(GEQ(UINT(cause_radio_network),0)) as count_radio_network,
136         sum(GEQ(UINT(cause_transport),0)) as count_transport,
137         sum(GEQ(UINT(cause_protocol),0)) as count_protocol,
138         sum(GEQ(UINT(cause_misc),0)) as count_misc
139 from SGNBRELEASERQD.SgNB_release_rqd
140 where schemaId=1001
141 group by gnb_id, timestamp_ms / $window as TB
142 ;
143
144 DEFINE{query_name 'release_request_cause';
145         max_lfta_disorder '1'; max_hfta_disorder '1';
146 }
147 PARAM{ window uint; }
148 Select gnb_id, TB,
149         count(*) as total_reconfig_refuse,
150         sum(GEQ(UINT(cause_radio_network),0)) as count_radio_network,
151         sum(GEQ(UINT(cause_transport),0)) as count_transport,
152         sum(GEQ(UINT(cause_protocol),0)) as count_protocol,
153         sum(GEQ(UINT(cause_misc),0)) as count_misc
154 from RELREQ.release_req
155 where schemaId=801
156 group by gnb_id, timestamp_ms / $window as TB
157 ;
158
159 DEFINE{query_name 'reconfig_cause_merge';}
160 PARAM{ window uint; }
161 merge p1.TB : p2.TB
162 from release_rqd_cause p1, release_request_cause p2
163 ;
164
165 DEFINE{query_name 'release_cause';
166         max_lfta_disorder '1'; max_hfta_disorder '1';
167 }
168 PARAM{ window uint; }
169 Select gnb_id as GNB_ID, ($window*(TB+1))/1000 as TS, 
170              $window/1000.0 as measurementInterval,
171         sum(total_reconfig_refuse) as total_reconfig_refuse,
172         sum(count_radio_network) as count_radio_network,
173         sum(count_transport) as count_transport,
174         sum(count_protocol) as count_protocol,
175         sum(count_misc) as count_misc
176 from reconfig_cause_merge
177 group by gnb_id, TB
178
179