change collector readme, fix url path (#98)
* change collector readme, fix url path * add error return * fix word mistake * optimization code
This commit is contained in:
parent
e32b8e44d1
commit
8790094b15
|
@ -9,7 +9,7 @@ linux 服务器基础资源采集agent
|
||||||
#### 上报数据
|
#### 上报数据
|
||||||
|
|
||||||
```
|
```
|
||||||
POST /api/push
|
POST /api/collector/push
|
||||||
|
|
||||||
request body:
|
request body:
|
||||||
// endpoint 可以填ip或者hostname, 如果ip是在运维平台是唯一表示, 那就填ip, hostname类同
|
// endpoint 可以填ip或者hostname, 如果ip是在运维平台是唯一表示, 那就填ip, hostname类同
|
||||||
|
@ -38,7 +38,7 @@ response body:
|
||||||
#### 获取已生效的采集策略
|
#### 获取已生效的采集策略
|
||||||
|
|
||||||
```
|
```
|
||||||
GET /api/stra
|
GET /api/collector/stra
|
||||||
|
|
||||||
response body:
|
response body:
|
||||||
{
|
{
|
||||||
|
|
|
@ -93,6 +93,9 @@ func UnTarGz(srcFilePath string, destDirPath string) error {
|
||||||
|
|
||||||
// Gzip reader
|
// Gzip reader
|
||||||
gr, err := gzip.NewReader(fr)
|
gr, err := gzip.NewReader(fr)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
// Tar reader
|
// Tar reader
|
||||||
tr := tar.NewReader(gr)
|
tr := tar.NewReader(gr)
|
||||||
|
|
|
@ -156,6 +156,5 @@ func function(pc uintptr) []byte {
|
||||||
}
|
}
|
||||||
|
|
||||||
func timeFormat(t time.Time) string {
|
func timeFormat(t time.Time) string {
|
||||||
var timeString = t.Format("2006/01/02 - 15:04:05")
|
return t.Format("2006/01/02 - 15:04:05")
|
||||||
return timeString
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -168,7 +168,7 @@ func (cp *ConnPools) UpdatePools(addrs []string) []string {
|
||||||
return newAddrs
|
return newAddrs
|
||||||
}
|
}
|
||||||
|
|
||||||
// RpcCient implements the io.Closer interface
|
// RpcClient implements the io.Closer interface
|
||||||
type RpcClient struct {
|
type RpcClient struct {
|
||||||
cli *rpc.Client
|
cli *rpc.Client
|
||||||
name string
|
name string
|
||||||
|
|
Loading…
Reference in New Issue