Browse Source

忽略生成的可执行文件

master
xyiege 3 months ago
parent
commit
8137029762
  1. 18
      aufs/core/dtmem.go
  2. 3
      scagent/.gitignore

18
aufs/core/dtmem.go

@ -4,6 +4,7 @@ import (
"encoding/json"
"fmt"
"net/http"
"net/rpc/jsonrpc"
"runtime"
)
@ -17,6 +18,23 @@ func Dtmem(w http.ResponseWriter, r *http.Request) {
var m runtime.MemStats
runtime.ReadMemStats(&m)
// 测试JSONRPC
service := "192.168.66.16:9098"
client, err := jsonrpc.Dial("tcp", service)
if err != nil {
fmt.Fprintf(w, "jsonrpc dial faild %v", err)
return
}
// 调用远程方法
var reply int
err = client.Call("Service.GetFilePath", "hello", &reply)
if err != nil {
fmt.Fprintf(w, "jsonrpc call faild %v", err)
return
}
// 打印返回值
fmt.Fprintf(w, "jsonrpc call success, reply: %d", reply)
dtm := Dtm{
TotalAlloc: fmt.Sprintf("%d", m.TotalAlloc),

3
scagent/.gitignore

@ -1 +1,2 @@
logs/
logs/
scagent
Loading…
Cancel
Save