통합통계 수정

main
JungJun 2 years ago
parent 5f75853cd6
commit dfa38338c9

@ -5,6 +5,7 @@ import (
"fmt" "fmt"
"io" "io"
"math/rand" "math/rand"
"strings"
"sync" "sync"
"time" "time"
@ -168,8 +169,10 @@ func StatsCommandVG(t *icsnet.IcsTCPNet, bufend string) {
l := icslog.GetIcsLog() l := icslog.GetIcsLog()
statInfos := new(StatInfos) statInfos := new(StatInfos)
s := GetIcsSid() // s := GetIcsSid()
randNum := fmt.Sprintf("%04d", rand.Intn(9999)) rand.Seed(time.Now().UnixNano())
randNum := fmt.Sprintf("%07d", rand.Intn(1000000))
// randNum := fmt.Sprintf("%07d", rand.Intn(9999999))
// defer func() { // defer func() {
// if err := recover(); err != nil { // if err := recover(); err != nil {
@ -199,7 +202,13 @@ func StatsCommandVG(t *icsnet.IcsTCPNet, bufend string) {
statInfos.ChangeByteToString(statReads) statInfos.ChangeByteToString(statReads)
svc := statInfos.SvcType[0:1] svc := statInfos.SvcType[0:1]
seqId := s.Seq + svc + randNum now := fmt.Sprintf("%s", time.Now())
b := now[:23]
c := strings.ReplaceAll(b, "-", "")
d := strings.ReplaceAll(c, ".", "")
e := strings.ReplaceAll(d, " ", "")
nowS := strings.ReplaceAll(e, ":", "")
seqId := nowS + svc + randNum
ghost.M.Lock() ghost.M.Lock()
hostName := ghost.HostName hostName := ghost.HostName
ghost.M.Unlock() ghost.M.Unlock()
@ -273,8 +282,10 @@ func StatsCommandVA(t *icsnet.IcsTCPNet, bufend string) {
l := icslog.GetIcsLog() l := icslog.GetIcsLog()
statInfos := new(StatInfos) statInfos := new(StatInfos)
s := GetIcsSid() // s := GetIcsSid()
randNum := fmt.Sprintf("%04d", rand.Intn(9999)) rand.Seed(time.Now().UnixNano())
randNum := fmt.Sprintf("%07d", rand.Intn(1000000))
// randNum := fmt.Sprintf("%04d", rand.Intn(9999))
defer t.Close() defer t.Close()
@ -288,7 +299,13 @@ func StatsCommandVA(t *icsnet.IcsTCPNet, bufend string) {
statInfos.ChangeByteToString(statReads) statInfos.ChangeByteToString(statReads)
svc := statInfos.SvcType[0:1] svc := statInfos.SvcType[0:1]
seqId := s.Seq + svc + randNum now := fmt.Sprintf("%s", time.Now())
b := now[:23]
c := strings.ReplaceAll(b, "-", "")
d := strings.ReplaceAll(c, ".", "")
e := strings.ReplaceAll(d, " ", "")
nowS := strings.ReplaceAll(e, ":", "")
seqId := nowS + svc + randNum
ghost.M.Lock() ghost.M.Lock()
hostName := ghost.HostName hostName := ghost.HostName
ghost.M.Unlock() ghost.M.Unlock()

Loading…
Cancel
Save