Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
G
getty
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wei.xuan
getty
Commits
a57b22ed
Commit
a57b22ed
authored
Jan 11, 2020
by
AlexStocks
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Imp: enlarge time wheel span from 2m to 15m
parent
2f6fb032
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
426 deletions
+17
-426
change_log.md
change_log.md
+0
-417
client.go
client.go
+1
-1
server.go
server.go
+1
-1
session.go
session.go
+15
-7
No files found.
change_log.md
deleted
100644 → 0
View file @
2f6fb032
This diff is collapsed.
Click to expand it.
client.go
View file @
a57b22ed
...
@@ -24,9 +24,9 @@ import (
...
@@ -24,9 +24,9 @@ import (
import
(
import
(
"github.com/dubbogo/gost/bytes"
"github.com/dubbogo/gost/bytes"
"github.com/dubbogo/gost/net"
"github.com/gorilla/websocket"
"github.com/gorilla/websocket"
perrors
"github.com/pkg/errors"
perrors
"github.com/pkg/errors"
"github.com/dubbogo/gost/net"
)
)
const
(
const
(
...
...
server.go
View file @
a57b22ed
...
@@ -23,9 +23,9 @@ import (
...
@@ -23,9 +23,9 @@ import (
)
)
import
(
import
(
"github.com/dubbogo/gost/net"
"github.com/gorilla/websocket"
"github.com/gorilla/websocket"
perrors
"github.com/pkg/errors"
perrors
"github.com/pkg/errors"
"github.com/dubbogo/gost/net"
)
)
var
(
var
(
...
...
session.go
View file @
a57b22ed
...
@@ -36,6 +36,8 @@ const (
...
@@ -36,6 +36,8 @@ const (
pendingDuration
=
3e9
pendingDuration
=
3e9
defaultQLen
=
1024
defaultQLen
=
1024
maxIovecNum
=
10
maxIovecNum
=
10
MaxWheelTimeSpan
=
900e9
// 900s, 15 minute
defaultSessionName
=
"session"
defaultSessionName
=
"session"
defaultTCPSessionName
=
"tcp-session"
defaultTCPSessionName
=
"tcp-session"
defaultUDPSessionName
=
"udp-session"
defaultUDPSessionName
=
"udp-session"
...
@@ -49,9 +51,15 @@ const (
...
@@ -49,9 +51,15 @@ const (
/////////////////////////////////////////
/////////////////////////////////////////
var
(
var
(
wheel
=
gxtime
.
NewWheel
(
gxtime
.
TimeMillisecondDuration
(
100
),
1200
)
// wheel longest span is 2 minute
wheel
*
gxtime
.
Wheel
)
)
func
init
()
{
span
:=
100e6
// 100ms
buckets
:=
MaxWheelTimeSpan
/
span
wheel
=
gxtime
.
NewWheel
(
time
.
Duration
(
span
),
int
(
buckets
))
// wheel longest span is 15 minute
}
func
GetTimeWheel
()
*
gxtime
.
Wheel
{
func
GetTimeWheel
()
*
gxtime
.
Wheel
{
return
wheel
return
wheel
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment