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:
penggy 2020-04-19 00:11:16 +08:00 committed by GitHub
parent e32b8e44d1
commit 8790094b15
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 5 deletions

View File

@ -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:
{ {

View File

@ -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)

View File

@ -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
} }

View File

@ -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