feat 接入Prometheus
This commit is contained in:
@@ -9,7 +9,8 @@ log:
|
||||
maxAge: 7
|
||||
|
||||
client:
|
||||
count: 100
|
||||
uid: [ 1,1000000 ]
|
||||
websocket:
|
||||
address: "ws://127.0.0.1"
|
||||
port: 8501
|
||||
address: "wss://www.hlsq.asia/ws/"
|
||||
port: 0
|
||||
@@ -8,6 +8,7 @@ type Config struct {
|
||||
App *config.AppConfig `yaml:"app"`
|
||||
Log *config.LogConfig `yaml:"log"`
|
||||
Client *struct {
|
||||
Count int32 `yaml:"count"`
|
||||
UID []int32 `yaml:"uid"`
|
||||
Websocket *config.AddressConfig `yaml:"websocket"`
|
||||
} `yaml:"client"`
|
||||
|
||||
@@ -9,6 +9,7 @@ log:
|
||||
maxAge: 7
|
||||
|
||||
client:
|
||||
count: 100
|
||||
uid: [ 1,1000000 ]
|
||||
websocket:
|
||||
address: "ws://172.18.28.0"
|
||||
|
||||
@@ -4,6 +4,7 @@ import (
|
||||
"common/utils"
|
||||
"robot/config"
|
||||
"strconv"
|
||||
"time"
|
||||
)
|
||||
|
||||
type Manager struct {
|
||||
@@ -19,8 +20,9 @@ func NewManager(addr string) *Manager {
|
||||
|
||||
func (c *Manager) Start() {
|
||||
cfg := config.Get().Client
|
||||
for i := 0; i < 300; i++ {
|
||||
for i := int32(0); i < cfg.Count; i++ {
|
||||
client := NewClient(c.addr, strconv.Itoa(utils.RandInt(int(cfg.UID[0]), int(cfg.UID[1]))))
|
||||
client.Start()
|
||||
time.Sleep(time.Millisecond * 10)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user