You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

heartReporter.go 974 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. package main
  2. import (
  3. //"context"
  4. //"log"
  5. //"os"
  6. //"io"
  7. //"fmt"
  8. //"path/filepath"
  9. //agentserver "proto"
  10. "encoding/json"
  11. "fmt"
  12. "rabbitmq"
  13. "sync"
  14. "time"
  15. //"google.golang.org/grpc"
  16. )
  17. func heartReport(wg *sync.WaitGroup) {
  18. rabbit1 := rabbitmq.NewRabbitMQSimple("coorQueue")
  19. for {
  20. //挨个ping其他agent(AgentIpList),记录延迟到AgentDelay
  21. agentDelay := []int{10, 100, 200}
  22. //访问ipfs,记录是否能正常访问,记录到ipfsStatus
  23. ipfsStatus := true
  24. //访问自身资源目录(obs,minio等),记录是否正常,记录到localDirStatus
  25. localDirStatus := true
  26. //发送心跳
  27. command := rabbitmq.HeartReport{
  28. Ip: "localhost",
  29. AgentDelay: agentDelay,
  30. IpfsStatus: ipfsStatus,
  31. LocalDirStatus: localDirStatus,
  32. }
  33. c, _ := json.Marshal(command)
  34. b := append([]byte("07"), c...)
  35. fmt.Println(string(b))
  36. rabbit1.PublishSimple(b)
  37. time.Sleep(time.Minute * 5)
  38. }
  39. rabbit1.Destroy()
  40. wg.Done()
  41. }

本项目旨在将云际存储公共基础设施化,使个人及企业可低门槛使用高效的云际存储服务(安装开箱即用云际存储客户端即可,无需关注其他组件的部署),同时支持用户灵活便捷定制云际存储的功能细节。

Contributors (1)