diff options
author | 2021-03-02 11:45:37 +0100 | |
---|---|---|
committer | 2021-03-03 12:37:18 +0000 | |
commit | 4e16c7100cc7f8dddca051ff393460d7a1a77c98 (patch) | |
tree | dd8ab474f96025a0ec7f7f6fc7507a5663d9b6c6 /adapter/statsclient | |
parent | 4459b648e9fb53c34abbf52a00e63ad384fb9ee2 (diff) |
Provide error counters per worker for statsclient
Instead of a single value, the ErrorCounter now contains
an array representing couter values per workers.
Change-Id: I2b869e5b228bcb3e155b1fef08a4cd00e7d2e16a
Signed-off-by: Vladimir Lavor <vlavor@cisco.com>
Diffstat (limited to 'adapter/statsclient')
-rw-r--r-- | adapter/statsclient/statseg_v1.go | 8 | ||||
-rw-r--r-- | adapter/statsclient/statseg_v2.go | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/adapter/statsclient/statseg_v1.go b/adapter/statsclient/statseg_v1.go index 3d45201..38f51bd 100644 --- a/adapter/statsclient/statseg_v1.go +++ b/adapter/statsclient/statseg_v1.go @@ -113,7 +113,7 @@ func (ss *statSegmentV1) CopyEntryData(statSegDir unsafe.Pointer) adapter.Stat { _, errOffset, _ := ss.getOffsets() offsetVector := unsafe.Pointer(&ss.sharedHeader[errOffset]) - var errData adapter.Counter + var errData []adapter.Counter vecLen := *(*uint32)(vectorLen(offsetVector)) for i := uint32(0); i < vecLen; i++ { @@ -121,7 +121,7 @@ func (ss *statSegmentV1) CopyEntryData(statSegDir unsafe.Pointer) adapter.Stat { offset := uintptr(cb) + uintptr(dirEntry.unionData)*unsafe.Sizeof(adapter.Counter(0)) debugf("error index, cb: %d, offset: %d", cb, offset) val := *(*adapter.Counter)(statSegPointer(unsafe.Pointer(&ss.sharedHeader[0]), offset)) - errData += val + errData = append(errData, val) } return adapter.ErrorStat(errData) @@ -239,14 +239,14 @@ func (ss *statSegmentV1) UpdateEntryData(statSegDir unsafe.Pointer, stat *adapte _, errOffset, _ := ss.getOffsets() offsetVector := unsafe.Pointer(&ss.sharedHeader[errOffset]) - var errData adapter.Counter + var errData []adapter.Counter vecLen := *(*uint32)(vectorLen(unsafe.Pointer(&ss.sharedHeader[errOffset]))) for i := uint32(0); i < vecLen; i++ { cb := *(*uint64)(statSegPointer(offsetVector, uintptr(i)*unsafe.Sizeof(uint64(0)))) offset := uintptr(cb) + uintptr(dirEntry.unionData)*unsafe.Sizeof(adapter.Counter(0)) val := *(*adapter.Counter)(statSegPointer(unsafe.Pointer(&ss.sharedHeader[0]), offset)) - errData += val + errData = append(errData, val) } *stat = adapter.ErrorStat(errData) diff --git a/adapter/statsclient/statseg_v2.go b/adapter/statsclient/statseg_v2.go index d52077f..68411f9 100644 --- a/adapter/statsclient/statseg_v2.go +++ b/adapter/statsclient/statseg_v2.go @@ -105,7 +105,7 @@ func (ss *statSegmentV2) CopyEntryData(statSegDir unsafe.Pointer) adapter.Stat { return nil } vecLen := *(*uint32)(vectorLen(dirVector)) - var errData adapter.Counter + var errData []adapter.Counter for i := uint32(0); i < vecLen; i++ { cb := statSegPointer(dirVector, uintptr(i+1)*unsafe.Sizeof(uint64(0))) cbVal := ss.adjust(vectorLen(cb)) @@ -115,7 +115,7 @@ func (ss *statSegmentV2) CopyEntryData(statSegDir unsafe.Pointer) adapter.Stat { } offset := uintptr(dirEntry.unionData) * unsafe.Sizeof(adapter.Counter(0)) val := *(*adapter.Counter)(statSegPointer(cbVal, offset)) - errData += val + errData = append(errData, val) } return adapter.ErrorStat(errData) @@ -224,7 +224,7 @@ func (ss *statSegmentV2) UpdateEntryData(statSegDir unsafe.Pointer, stat *adapte return nil } vecLen := *(*uint32)(vectorLen(dirVector)) - var errData adapter.Counter + var errData []adapter.Counter for i := uint32(0); i < vecLen; i++ { cb := statSegPointer(dirVector, uintptr(i+1)*unsafe.Sizeof(uint64(0))) cbVal := ss.adjust(vectorLen(cb)) @@ -234,7 +234,7 @@ func (ss *statSegmentV2) UpdateEntryData(statSegDir unsafe.Pointer, stat *adapte } offset := uintptr(dirEntry.unionData) * unsafe.Sizeof(adapter.Counter(0)) val := *(*adapter.Counter)(statSegPointer(cbVal, offset)) - errData += val + errData = append(errData, val) } *stat = adapter.ErrorStat(errData) |