Files
golang-tests/statistics/main.go
2021-01-25 00:35:43 +08:00

44 lines
657 B
Go

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)
}
}