Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lizhongxiao
OpenXG-RAN
Commits
afb1bed3
Unverified
Commit
afb1bed3
authored
Oct 26, 2023
by
Adrian Lita
Committed by
Angelo Athanassopoulos
Dec 06, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added configurable pm_data reporting
parent
266fd1a6
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
47 additions
and
11 deletions
+47
-11
docker/config/config.json
docker/config/config.json
+2
-1
docker/config/pmData-measData.xml
docker/config/pmData-measData.xml
+1
-1
src/common/config.c
src/common/config.c
+9
-0
src/common/config.h
src/common/config.h
+1
-0
src/pm_data/pm_data.c
src/pm_data/pm_data.c
+31
-8
src/pm_data/pm_data.h
src/pm_data/pm_data.h
+3
-1
No files found.
docker/config/config.json
View file @
afb1bed3
...
...
@@ -26,7 +26,8 @@
"username"
:
"sample1"
,
"password"
:
"sample1"
,
"file-expiry"
:
86400
"file-expiry"
:
86400
,
"pm-data-interval"
:
30
},
"alarms"
:
{
...
...
docker/config/pmData-measData.xml
View file @
afb1bed3
...
...
@@ -11,7 +11,7 @@ xsi:schemaLocation="http://www.3gpp.org/ftp/specs/archive/32_series/32.435#measC
<managedElement
localDn=
"ManagedElement=@node-id@"
userLabel=
""
/>
<measInfo>
<job
jobId=
"1"
/>
<granPeriod
duration=
"PT
900
S"
endTime=
"@end-time@"
/>
<granPeriod
duration=
"PT
@log-period@
S"
endTime=
"@end-time@"
/>
<repPeriod
duration=
"P1D"
/>
<measType
p=
"1"
>
DRB.MeanActiveUeDl
</measType>
<measType
p=
"2"
>
DRB.MaxActiveUeDl
</measType>
...
...
src/common/config.c
View file @
afb1bed3
...
...
@@ -317,6 +317,13 @@ int config_init(const char *filename) {
}
config
.
ves
.
file_expiry
=
object
->
valueint
;
object
=
cJSON_GetObjectItem
(
top
,
"pm-data-interval"
);
if
(
object
==
0
)
{
log_error
(
"config json parser error: pm-data-interval"
);
goto
failure
;
}
config
.
ves
.
pm_data_interval
=
object
->
valueint
;
top
=
cJSON_GetObjectItem
(
cjson
,
"alarms"
);
if
(
top
==
0
)
{
log_error
(
"config json parse error: alarms"
);
...
...
@@ -583,6 +590,7 @@ config_t *config_get() {
goto
failure
;
}
c
->
ves
.
file_expiry
=
config
.
ves
.
file_expiry
;
c
->
ves
.
pm_data_interval
=
config
.
ves
.
pm_data_interval
;
c
->
alarms
.
internal_connection_lost_timeout
=
config
.
alarms
.
internal_connection_lost_timeout
;
c
->
alarms
.
load_downlink_exceeded_warning_threshold
=
config
.
alarms
.
load_downlink_exceeded_warning_threshold
;
...
...
@@ -716,6 +724,7 @@ void config_print(const config_t *cconfig) {
log
(
"- ves.username: %s"
,
cconfig
->
ves
.
username
);
log
(
"- ves.password: %s"
,
cconfig
->
ves
.
password
);
log
(
"- ves.file_expiry: %d"
,
cconfig
->
ves
.
file_expiry
);
log
(
"- ves.pm_data_interval: %d"
,
cconfig
->
ves
.
pm_data_interval
);
log
(
"- alarms.internal_connection_lost_timeout: %d"
,
cconfig
->
alarms
.
internal_connection_lost_timeout
);
log
(
"- alarms.load_downlink_exceeded_warning_threshold: %d"
,
cconfig
->
alarms
.
load_downlink_exceeded_warning_threshold
);
log
(
"- alarms.load_downlink_exceeded_warning_timeout: %d"
,
cconfig
->
alarms
.
load_downlink_exceeded_warning_timeout
);
...
...
src/common/config.h
View file @
afb1bed3
...
...
@@ -45,6 +45,7 @@ typedef struct config_ves {
char
*
password
;
int
file_expiry
;
int
pm_data_interval
;
}
config_ves_t
;
typedef
struct
config
{
...
...
src/pm_data/pm_data.c
View file @
afb1bed3
...
...
@@ -33,19 +33,20 @@
#include <stdlib.h>
#include <time.h>
#define PM_DATA_FEED_PERIOD (1)
#define PM_DATA_FEED_LOG_PERIOD (15*60)
#define PM_DATA_ROTATE (24*60*60)
#define PM_DATA_PATH "/ftp"
// pm data log rotate command; 1440 min = 24 h rotation
#define PM_DATA_ROLL_COMMAND "find "PM_DATA_PATH" -mindepth 1 -mmin +1440 -delete"
#define PM_DATA_ACCUMULATOR_LEN (PM_DATA_FEED_LOG_PERIOD / PM_DATA_FEED_PERIOD)
static
int
pm_data_feed_period
=
1
;
static
int
pm_data_feed_log_period
=
15
*
60
;
// default 900 sec
static
int
pm_data_accumulator_size
=
1
;
static
char
*
ves_template_pm_data
=
0
;
static
pm_data_info_t
pm_data_info
=
{
0
};
static
pm_data_t
pm_data_accumulator
[
PM_DATA_ACCUMULATOR_LEN
]
;
static
pm_data_t
*
pm_data_accumulator
=
0
;
static
int
pm_data_accumulator_len
=
0
;
static
time_t
pm_data_start_time
=
0
;
...
...
@@ -55,6 +56,15 @@ static int pm_data_notification_id = 1;
static
int
pm_data_write
(
long
int
start_time
,
long
int
end_time
,
char
*
filename
,
int
meanActiveUe
,
int
maxActiveUe
);
int
pm_data_init
(
const
config_t
*
config
)
{
pm_data_feed_log_period
=
config
->
ves
.
pm_data_interval
;
pm_data_accumulator_size
=
pm_data_feed_log_period
/
pm_data_feed_period
;
pm_data_accumulator
=
(
pm_data_t
*
)
malloc
(
sizeof
(
pm_data_t
)
*
pm_data_accumulator_size
);
if
(
pm_data_accumulator
==
0
)
{
log_error
(
"malloc failed"
);
goto
failure
;
}
pm_data_accumulator_len
=
0
;
pm_data_start_time
=
time
(
0
);
if
(
pm_data_start_time
==
-
1
)
{
...
...
@@ -74,6 +84,9 @@ int pm_data_init(const config_t *config) {
return
0
;
failure:
free
(
pm_data_accumulator
);
pm_data_accumulator
=
0
;
free
(
ves_template_pm_data
);
ves_template_pm_data
=
0
;
return
1
;
...
...
@@ -95,6 +108,8 @@ failure:
}
int
pm_data_free
()
{
free
(
pm_data_accumulator
);
pm_data_accumulator
=
0
;
free
(
ves_template_pm_data
);
ves_template_pm_data
=
0
;
free
(
pm_data_info
.
vendor
);
...
...
@@ -115,7 +130,7 @@ void pm_data_loop() {
return
;
}
if
((
timestamp
/
PM_DATA_FEED_LOG_PERIOD
)
!=
(
pm_data_start_time
/
PM_DATA_FEED_LOG_PERIOD
))
{
if
((
timestamp
/
pm_data_feed_log_period
)
!=
(
pm_data_start_time
/
pm_data_feed_log_period
))
{
int
rc
;
char
*
filename
=
0
;
char
*
full_path
=
0
;
...
...
@@ -205,7 +220,7 @@ int pm_data_feed(const pm_data_t *pm_data) {
memcpy
(
&
pm_data_accumulator
[
pm_data_accumulator_len
],
pm_data
,
sizeof
(
pm_data_t
));
pm_data_accumulator_len
++
;
if
(
pm_data_accumulator_len
>=
PM_DATA_ACCUMULATOR_LEN
)
{
if
(
pm_data_accumulator_len
>=
pm_data_accumulator_size
)
{
pm_data_accumulator_len
=
0
;
}
...
...
@@ -251,10 +266,18 @@ static int pm_data_write(long int start_time, long int end_time, char *filename,
sprintf
(
end_time_full
,
"%04d-%02d-%02dT%02d:%02d:%02d+00:00"
,
ptm
->
tm_year
+
1900
,
ptm
->
tm_mon
+
1
,
ptm
->
tm_mday
,
ptm
->
tm_hour
,
ptm
->
tm_min
,
ptm
->
tm_sec
);
const
char
*
suspect
=
""
;
if
(
end_time
-
start_time
<
PM_DATA_FEED_LOG_PERIOD
)
{
if
(
(
end_time
-
start_time
)
<
pm_data_feed_log_period
)
{
suspect
=
"<suspect>true</suspect>"
;
}
char
log_period
[
16
];
sprintf
(
log_period
,
"%d"
,
pm_data_feed_log_period
);
content
=
str_replace_inplace
(
content
,
"@log-period@"
,
log_period
);
if
(
content
==
0
)
{
log_error
(
"str_replace_inplace() failed"
);
goto
failure
;
}
content
=
str_replace_inplace
(
content
,
"@suspect@"
,
suspect
);
if
(
content
==
0
)
{
log_error
(
"str_replace_inplace() failed"
);
...
...
src/pm_data/pm_data.h
View file @
afb1bed3
...
...
@@ -23,6 +23,8 @@
#pragma once
#include "common/config.h"
typedef
struct
pm_data
{
int
numUes
;
int
load
;
...
...
@@ -32,7 +34,7 @@ typedef struct pm_data_info {
char
*
vendor
;
}
pm_data_info_t
;
int
pm_data_init
();
int
pm_data_init
(
const
config_t
*
config
);
int
pm_data_set_info
(
const
pm_data_info_t
*
info
);
int
pm_data_free
();
void
pm_data_loop
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment