Unverified Commit 87189d12 authored by Xin.Zh's avatar Xin.Zh Committed by GitHub

Merge pull request #65 from georgehao/improve/delte-handleLoop

feat: go fmt
parents 78fbb15a 372309a4
......@@ -48,8 +48,10 @@ var (
var taskPool gxsync.GenericTaskPool
const CronPeriod = 20e9
const WritePkgTimeout = 1e8
const (
CronPeriod = 20e9
WritePkgTimeout = 1e8
)
func main() {
flag.Parse()
......@@ -80,9 +82,9 @@ func main() {
)
var tmpSession getty.Session
var NewHelloClientSession = func(session getty.Session) (err error) {
var pkgHandler = &PackageHandler{}
var EventListener = &MessageHandler{}
NewHelloClientSession := func(session getty.Session) (err error) {
pkgHandler := &PackageHandler{}
EventListener := &MessageHandler{}
EventListener.SessionOnOpen = func(session getty.Session) {
tmpSession = session
......@@ -173,7 +175,6 @@ func main() {
log.Printf("throughput (TPS) : %d\n", int64(n*m)*1000/totalT)
log.Printf("mean: %.f ns, median: %.f ns, max: %.f ns, min: %.f ns, p99: %.f ns\n", mean, median, max, min, p99)
log.Printf("mean: %d ms, median: %d ms, max: %d ms, min: %d ms, p99: %d ms\n", int64(mean/1000000), int64(median/1000000), int64(max/1000000), int64(min/1000000), int64(p99/1000000))
}
type MessageHandler struct {
......
......@@ -45,8 +45,10 @@ var (
var taskPool gxsync.GenericTaskPool
const CronPeriod = 20e9
const WritePkgTimeout = 1e8
const (
CronPeriod = 20e9
WritePkgTimeout = 1e8
)
func main() {
flag.Parse()
......@@ -63,9 +65,9 @@ func main() {
)
var tmpSession getty.Session
var NewHelloClientSession = func(session getty.Session) (err error) {
var pkgHandler = &PackageHandler{}
var EventListener = &MessageHandler{}
NewHelloClientSession := func(session getty.Session) (err error) {
pkgHandler := &PackageHandler{}
EventListener := &MessageHandler{}
EventListener.SessionOnOpen = func(session getty.Session) {
tmpSession = session
......
......@@ -43,9 +43,7 @@ var (
pprofPort = flag.Int("pprof_port", 65432, "pprof http port")
)
var (
taskPool gxsync.GenericTaskPool
)
var taskPool gxsync.GenericTaskPool
const CronPeriod = 20e9
......@@ -75,8 +73,8 @@ func main() {
}
func NewHelloServerSession(session getty.Session) (err error) {
var pkgHandler = &PackageHandler{}
var EventListener = &MessageHandler{}
pkgHandler := &PackageHandler{}
EventListener := &MessageHandler{}
tcpConn, ok := session.Conn().(*net.TCPConn)
if !ok {
......
......@@ -34,17 +34,13 @@ import (
uatomic "go.uber.org/atomic"
)
var (
launchTime = time.Now()
)
var launchTime = time.Now()
/////////////////////////////////////////
// getty connection
/////////////////////////////////////////
var (
connID uatomic.Uint32
)
var connID uatomic.Uint32
type gettyConn struct {
id uint32
......
......@@ -58,9 +58,7 @@ const (
// session
/////////////////////////////////////////
var (
defaultTimerWheel *gxtime.TimerWheel
)
var defaultTimerWheel *gxtime.TimerWheel
func init() {
gxtime.InitDefaultTimerWheel()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment