[RICPLT-2585 / RICPLT-1528] Fix E2TermInit payload / xAppMock fixes
[ric-plt/e2mgr.git] / tools / xappmock / models / process_result.go
index eb9543f..8847d2d 100644 (file)
 
 package models
 
-import "fmt"
+import (
+       "fmt"
+       "go.uber.org/atomic"
+       "time"
+)
 
 type ProcessStats struct {
-       SentCount               int
-       SentErrorCount          int
-       ReceivedExpectedCount   int
-       ReceivedUnexpectedCount int
-       ReceivedErrorCount      int
+       SentCount               atomic.Int32
+       SentErrorCount          atomic.Int32
+       ReceivedExpectedCount   atomic.Int32
+       ReceivedUnexpectedCount atomic.Int32
+       ReceivedErrorCount      atomic.Int32
 }
 
 type ProcessResult struct {
-       Stats ProcessStats
-       Err   error
+       StartTime *time.Time
+       Stats     ProcessStats
+       Err       error
 }
 
-func (pr ProcessResult) String() string {
-       return fmt.Sprintf("\nNumber of sent messages: %d\nNumber of send errors: %d\n" +
-               "Number of expected received messages: %d\nNumber of unexpected received messages: %d\n" +
-               "Number of receive errors: %d\n", pr.Stats.SentCount, pr.Stats.SentErrorCount, pr.Stats.ReceivedExpectedCount, pr.Stats.ReceivedUnexpectedCount, pr.Stats.ReceivedErrorCount)
+func (ps ProcessStats) String() string {
+       return fmt.Sprintf("sent messages: %d | send errors: %d | expected received messages: %d | unexpected received messages: %d | receive errors: %d",
+               ps.SentCount, ps.SentErrorCount, ps.ReceivedExpectedCount, ps.ReceivedUnexpectedCount, ps.ReceivedErrorCount)
 }