Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
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
b11bcf8e
Commit
b11bcf8e
authored
Sep 10, 2016
by
alexstocks
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add test examples
parent
81c7e8fe
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
18 additions
and
3 deletions
+18
-3
config.go
echo/client/app/config.go
+2
-0
main.go
echo/client/app/main.go
+3
-0
version.go
echo/client/app/version.go
+1
-1
config.toml
echo/client/profiles/test/config.toml
+3
-1
config.go
echo/server/app/config.go
+1
-0
server.go
echo/server/app/server.go
+5
-0
version.go
echo/server/app/version.go
+1
-1
config.toml
echo/server/profiles/test/config.toml
+2
-0
getty-benchmark.doc
tests/getty-benchmark.doc
+0
-0
No files found.
echo/client/app/config.go
View file @
b11bcf8e
...
...
@@ -50,6 +50,8 @@ type (
// Config holds supported types by the multiconfig package
Config
struct
{
// local
AppName
string
`default:"echo-client"`
LocalHost
string
`default:"127.0.0.1"`
// server
...
...
echo/client/app/main.go
View file @
b11bcf8e
...
...
@@ -47,6 +47,8 @@ func main() {
initProfiling
()
initClient
()
gocolor
.
Info
(
"%s starts successfull! its version=%s
\n
"
,
conf
.
AppName
,
Version
)
log
.
Info
(
"%s starts successfull! its version=%s
\n
"
,
conf
.
AppName
,
Version
)
go
test
()
...
...
@@ -168,5 +170,6 @@ func test() {
echo
()
}
cost
=
counter
.
Count
()
log
.
Info
(
"after loop %d times, echo cost %d ms"
,
conf
.
EchoTimes
,
cost
/
1e6
)
gocolor
.
Info
(
"after loop %d times, echo cost %d ms"
,
conf
.
EchoTimes
,
cost
/
1e6
)
}
echo/client/app/version.go
View file @
b11bcf8e
...
...
@@ -10,5 +10,5 @@
package
main
var
(
Version
=
"0.3.0
4
"
Version
=
"0.3.0
7
"
)
echo/client/profiles/test/config.toml
View file @
b11bcf8e
# toml configure file
# toml中key的首字母可以小写,但是对应的golang中的struct成员首字母必须大写
AppName
=
"ECHO-CLIENT"
# host
LocalHost
=
"127.0.0.1"
...
...
@@ -25,7 +27,7 @@ SessionTimeout = "20s"
# client echo request string
EchoString
=
"Hello, getty!"
# 发送echo请求次数
EchoTimes
=
10000
0
EchoTimes
=
10000
# app fail fast
FailFastTimeout
=
"3s"
...
...
echo/server/app/config.go
View file @
b11bcf8e
...
...
@@ -51,6 +51,7 @@ type (
// Config holds supported types by the multiconfig package
Config
struct
{
// local address
AppName
string
`default:"echo-server"`
Host
string
`default:"127.0.0.1"`
Ports
[]
string
`default:["10000"]`
ProfilePort
int
`default:"10086"`
...
...
echo/server/app/server.go
View file @
b11bcf8e
...
...
@@ -24,6 +24,7 @@ import (
import
(
"github.com/AlexStocks/getty"
"github.com/AlexStocks/gocolor"
log
"github.com/AlexStocks/log4go"
)
...
...
@@ -51,6 +52,10 @@ func main() {
initProfiling
()
initServer
()
gocolor
.
Info
(
"%s starts successfull! its version=%s, its listen ends=%s:%s
\n
"
,
conf
.
AppName
,
Version
,
conf
.
Host
,
conf
.
Ports
)
log
.
Info
(
"%s starts successfull! its version=%s, its listen ends=%s:%s
\n
"
,
conf
.
AppName
,
Version
,
conf
.
Host
,
conf
.
Ports
)
initSignal
()
}
...
...
echo/server/app/version.go
View file @
b11bcf8e
...
...
@@ -10,5 +10,5 @@
package
main
var
(
Version
=
"0.3.0
4
"
Version
=
"0.3.0
7
"
)
echo/server/profiles/test/config.toml
View file @
b11bcf8e
# toml configure file
# toml中key的首字母可以小写,但是对应的golang中的struct成员首字母必须大写
AppName
=
"ECHO-SERVER"
# Host = "127.0.0.1"
Host
=
"192.168.35.1"
Ports
=
[
"10000"
,
"20000"
]
...
...
tests/getty-benchmark.doc
0 → 100644
View file @
b11bcf8e
File added
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