-
Notifications
You must be signed in to change notification settings - Fork 0
/
latencyeval.go
39 lines (33 loc) · 963 Bytes
/
latencyeval.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package main
import (
"fmt"
"time"
)
func getLatency(dtStart time.Time, dtEnd time.Time, protocolTypeID int) (*int, *int, error) {
isUE := false
isReceived := false
enbSentTmp, err := serv.apiConn.GetPacketsStatus(&isUE, &isReceived, &dtStart, &dtEnd, &protocolTypeID, nil, nil)
if err != nil {
return nil, nil, err
}
isUE = true
isReceived = true
ueRecvTmp, err := serv.apiConn.GetPacketsStatus(&isUE, &isReceived, &dtStart, &dtEnd, &protocolTypeID, nil, nil)
if err != nil {
return nil, nil, err
}
fmt.Println(len(*enbSentTmp), len(*ueRecvTmp))
enbSent := serv.apiConn.ExcludeNullPacketID(enbSentTmp)
ueRecv := serv.apiConn.ExcludeNullPacketID(ueRecvTmp)
cntOk, cntLost, _, _ := serv.apiConn.CalculateLatency(&enbSent, &ueRecv)
// First report dtStart
// Last report dtEnd
// totalCount
// lostCount
// latencyMoments []
// statsInfo {min, max, avg, std}
// isUl
// ProtocolTypeID
// totalSize
return &cntOk, &cntLost, err
}