https://github.com/txchen/servertrack
simple service in golang
https://github.com/txchen/servertrack
Last synced: 2 months ago
JSON representation
simple service in golang
- Host: GitHub
- URL: https://github.com/txchen/servertrack
- Owner: txchen
- Created: 2015-04-07T06:16:34.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2015-04-09T00:30:41.000Z (about 11 years ago)
- Last Synced: 2025-04-27T11:02:36.712Z (about 1 year ago)
- Language: Go
- Size: 137 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# servertrack
To build:
```bash
$ go get
$ go build
```
To run without build:
```bash
$ go run main.go stat.go template.go
```
To run tests:
```bash
$ go get github.com/stretchr/testify/assert
$ go test -v
$ go test -v -race
```
To run benchmark test:
```bash
$ go test -bench=.
```
The server would listen on port 30000, it has two apis:
* GET: http://localhost:30000/load?servername=xxxxx
* POST: http://localhost:30000/load?servername=yyyyy&cpuload=xx.xx&ramload=yy.yy
To load some data into the service, there is one script:
```bash
$ go get github.com/jawher/mow.cli
$ go run scripts/loadtest.go -h
# for example
$ go run scripts/loadtest.go -s host1 -d 20150404 -c=20000
# or, you can run multiple instances together
$ go run scripts/loadtest.go -s host2 -d 20150307 -c=10000 -t=3 & \
go run scripts/loadtest.go -s host2 -d 20150303 -c=10000 -t=3 & \
go run scripts/loadtest.go -s host3 -d 20150302 -c=10000 -t=3
```