feat: add statictics

This commit is contained in:
2021-01-25 00:35:43 +08:00
parent cbbacf075d
commit c10ff6a81e

43
statistics/main.go Normal file
View File

@@ -0,0 +1,43 @@
package main
import (
"fmt"
"sync"
)
type ChannelItem struct {
tag string
upBytes uint64
downBytes uint64
}
type DurationChannelItems struct {
durationTag string
channelItemMap map[string]ChannelItem
}
var durationChannelItemsMap = map[string]DurationChannelItems{}
var durationChannelItemsMapLock = sync.RWMutex{}
type CountItem struct {
tag string
timestamp uint64
upBytes uint64
downBytes uint64
}
var countItemChan = make(chan CountItem)
// var countItemChan = make(ChannelItem, 0)
func main() {
}
func collectCountItem() {
for {
countItem := <-countItemChan
// TODO ...
fmt.Printf("%v\n", countItem)
}
}