}
var ueMetrics UeMetricsEntry
- if isUeExist, _ := c.client.Exists(strconv.FormatInt(ueID, 10)).Result(); isUeExist == 1 {
- ueJsonStr, _ := c.client.Get(strconv.FormatInt(ueID, 10)).Result()
+ if isUeExist, _ := c.client.Exists("{TS-UE-metrics}," + strconv.FormatInt(ueID, 10)).Result(); isUeExist == 1 {
+ ueJsonStr, _ := c.client.Get("{TS-UE-metrics}," + strconv.FormatInt(ueID, 10)).Result()
json.Unmarshal([]byte(ueJsonStr), &ueMetrics)
}
ueMetrics.UeID = ueID
log.Printf("UeID: %d", ueMetrics.UeID)
- ueMetrics.ServingCellID = servingCellID
+ ueMetrics.ServingCellID = servingCellID
log.Printf("ServingCellID: %s", ueMetrics.ServingCellID)
+ ueMetrics.MeasPeriodRF = 20
if flag {
timestampPRB = timestamp
log.Printf("Failed to marshal UeMetrics with UE ID [%d]: %v", ueID, err)
continue
}
- err = c.client.Set(strconv.FormatInt(ueID, 10), newUeJsonStr, 0).Err()
+ err = c.client.Set("{TS-UE-metrics}," + strconv.FormatInt(ueID, 10), newUeJsonStr, 0).Err()
if err != nil {
xapp.Logger.Error("Failed to set UeMetrics into redis with UE ID [%d]: %v", ueID, err)
log.Printf("Failed to set UeMetrics into redis with UE ID [%d]: %v", ueID, err)
}
var ueMetrics UeMetricsEntry
- if isUeExist, _ := c.client.Exists(strconv.FormatInt(ueID, 10)).Result(); isUeExist == 1 {
- ueJsonStr, _ := c.client.Get(strconv.FormatInt(ueID, 10)).Result()
+ if isUeExist, _ := c.client.Exists("{TS-UE-metrics}," + strconv.FormatInt(ueID, 10)).Result(); isUeExist == 1 {
+ ueJsonStr, _ := c.client.Get("{TS-UE-metrics}," + strconv.FormatInt(ueID, 10)).Result()
json.Unmarshal([]byte(ueJsonStr), &ueMetrics)
}
ueMetrics.MeasTimeRF.TVsec = timestamp.TVsec
ueMetrics.MeasTimeRF.TVnsec = timestamp.TVnsec
+ ueMetrics.MeasPeriodPDCP = 20
+ ueMetrics.MeasPeriodPRB = 20
+
if ueResourceReportItem.ServingCellRF != nil {
err = json.Unmarshal(ueResourceReportItem.ServingCellRF.Buf, &ueMetrics.ServingCellRF)
log.Printf("ueMetrics.ServingCellRF: %+v", ueMetrics.ServingCellRF)
log.Printf("Failed to marshal UeMetrics with UE ID [%d]: %v", ueID, err)
continue
}
- err = c.client.Set(strconv.FormatInt(ueID, 10), newUeJsonStr, 0).Err()
+ err = c.client.Set("{TS-UE-metrics}," + strconv.FormatInt(ueID, 10), newUeJsonStr, 0).Err()
if err != nil {
xapp.Logger.Error("Failed to set UeMetrics into redis with UE ID [%d]: %v", ueID, err)
log.Printf("Failed to set UeMetrics into redis with UE ID [%d]: %v", ueID, err)
}
var ueMetrics UeMetricsEntry
- if isUeExist, _ := c.client.Exists(strconv.FormatInt(ueID, 10)).Result(); isUeExist == 1 {
- ueJsonStr, _ := c.client.Get(strconv.FormatInt(ueID, 10)).Result()
+ if isUeExist, _ := c.client.Exists("{TS-UE-metrics}," + strconv.FormatInt(ueID, 10)).Result(); isUeExist == 1 {
+ ueJsonStr, _ := c.client.Get("{TS-UE-metrics}," + strconv.FormatInt(ueID, 10)).Result()
json.Unmarshal([]byte(ueJsonStr), &ueMetrics)
}
log.Printf("Failed to marshal UeMetrics with UE ID [%d]: %v", ueID, err)
continue
}
- err = c.client.Set(strconv.FormatInt(ueID, 10), newUeJsonStr, 0).Err()
+ err = c.client.Set("{TS-UE-metrics}," + strconv.FormatInt(ueID, 10), newUeJsonStr, 0).Err()
if err != nil {
xapp.Logger.Error("Failed to set UeMetrics into redis with UE ID [%d]: %v", ueID, err)
log.Printf("Failed to set UeMetrics into redis with UE ID [%d]: %v", ueID, err)
if flag {
var cellMetrics CellMetricsEntry
- if isCellExist, _ := c.client.Exists(cellIDHdr).Result(); isCellExist == 1 {
- cellJsonStr, _ := c.client.Get(cellIDHdr).Result()
+ if isCellExist, _ := c.client.Exists("{TS-cell-metrics}," + cellIDHdr).Result(); isCellExist == 1 {
+ cellJsonStr, _ := c.client.Get("{TS-cell-metrics}," + cellIDHdr).Result()
json.Unmarshal([]byte(cellJsonStr), &cellMetrics)
}
+ cellMetrics.MeasPeriodPDCP = 20
+ cellMetrics.MeasPeriodPRB = 20
+ cellMetrics.CellID = cellIDHdr
+
if timestampPDCPBytes != nil {
cellMetrics.MeasTimestampPDCPBytes.TVsec = timestampPDCPBytes.TVsec
cellMetrics.MeasTimestampPDCPBytes.TVnsec = timestampPDCPBytes.TVnsec
log.Printf("Failed to marshal CellMetrics with CellID [%s]: %v", cellIDHdr, err)
continue
}
- err = c.client.Set(cellIDHdr, newCellJsonStr, 0).Err()
+ err = c.client.Set("{TS-cell-metrics}," + cellIDHdr, newCellJsonStr, 0).Err()
if err != nil {
xapp.Logger.Error("Failed to set CellMetrics into redis with CellID [%s]: %v", cellIDHdr, err)
log.Printf("Failed to set CellMetrics into redis with CellID [%s]: %v", cellIDHdr, err)
}
type CellMetricsEntry struct {
- MeasTimestampPDCPBytes Timestamp `json:"Meas-Timestamp-PDCP-Bytes"`
- PDCPBytesDL int64 `json:"PDCP-Bytes-DL"`
- PDCPBytesUL int64 `json:"PDCP-Bytes-UL"`
- MeasTimestampPRB Timestamp `json:"Meas-Timestamp-PRB"`
- AvailPRBDL int64 `json:"Avail-PRB-DL"`
- AvailPRBUL int64 `json:"Avail-PRB-UL"`
+ MeasTimestampPDCPBytes Timestamp `json:"MeasTimestampPDCPBytes"`
+ CellID string `json:"CellID"`
+ PDCPBytesDL int64 `json:"PDCPBytesDL"`
+ PDCPBytesUL int64 `json:"PDCPBytesUL"`
+ MeasTimestampPRB Timestamp `json:"MeasTimestampAvailPRB"`
+ AvailPRBDL int64 `json:"AvailPRBDL"`
+ AvailPRBUL int64 `json:"AvailPRBUL"`
+ MeasPeriodPDCP int64 `json:"MeasPeriodPDCPBytes"`
+ MeasPeriodPRB int64 `json:"MeasPeriodAvailPRB"`
}
type CellRFType struct {
type NeighborCellRFType struct {
CellID string `json:"CID"`
- CellRF CellRFType `json:"Cell-RF"`
+ CellRF CellRFType `json:"CellRF"`
}
type UeMetricsEntry struct {
- UeID int64 `json:"UE ID"`
- ServingCellID string `json:"Serving Cell ID"`
- MeasTimestampPDCPBytes Timestamp `json:"Meas-Timestamp-PDCP-Bytes"`
- PDCPBytesDL int64 `json:"PDCP-Bytes-DL"`
- PDCPBytesUL int64 `json:"PDCP-Bytes-UL"`
- MeasTimestampPRB Timestamp `json:"Meas-Timestamp-PRB"`
- PRBUsageDL int64 `json:"PRB-Usage-DL"`
- PRBUsageUL int64 `json:"PRB-Usage-UL"`
- MeasTimeRF Timestamp `json:"Meas-Time-RF"`
- ServingCellRF CellRFType `json:"servingCellRfReport"`
- NeighborCellsRF []NeighborCellRFType `json:"neighbourCellList"`
+ UeID int64 `json:"UEID"`
+ ServingCellID string `json:"ServingCellID"`
+ MeasTimestampPDCPBytes Timestamp `json:"MeasTimestampUEPDCPBytes"`
+ PDCPBytesDL int64 `json:"UEPDCPBytesDL"`
+ PDCPBytesUL int64 `json:"UEPDCPBytesUL"`
+ MeasTimestampPRB Timestamp `json:"MeasTimestampUEPRBUsage"`
+ PRBUsageDL int64 `json:"UEPRBUsageDL"`
+ PRBUsageUL int64 `json:"UEPRBUsageUL"`
+ MeasTimeRF Timestamp `json:"MeasTimestampRF"`
+ MeasPeriodRF int64 `json:"MeasPeriodRF"`
+ MeasPeriodPDCP int64 `json:"MeasPeriodUEPDCPBytes"`
+ MeasPeriodPRB int64 `json:"MeasPeriodUEPRBUsage"`
+ ServingCellRF CellRFType `json:"ServingCellRF"`
+ NeighborCellsRF []NeighborCellRFType `json:"NeighborCellRF"`
}