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.

unifyops_test.go 1.3 kB

2 years ago
2 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. package unifyops
  2. import (
  3. "fmt"
  4. "testing"
  5. . "github.com/smartystreets/goconvey/convey"
  6. )
  7. func Test_UnifyOps(t *testing.T) {
  8. Convey("测试获取SlwNode信息", t, func() {
  9. cli := NewClient(&Config{
  10. URL: "http://101.201.215.165:6000",
  11. })
  12. slwNodeInfos, err := cli.GetSlwNodeInfo()
  13. So(err, ShouldBeNil)
  14. sNodes := *slwNodeInfos
  15. cpuData, err := cli.GetCPUData(Node{
  16. NodeId: sNodes[0].ID,
  17. })
  18. So(err, ShouldBeNil)
  19. fmt.Printf("cpuData: %v\n", cpuData)
  20. gpuData, err := cli.GetGPUData(Node{
  21. NodeId: sNodes[0].ID,
  22. })
  23. So(err, ShouldBeNil)
  24. fmt.Printf("gpuData: %v\n", gpuData)
  25. npuData, err := cli.GetNPUData(Node{
  26. NodeId: sNodes[0].ID,
  27. })
  28. So(err, ShouldBeNil)
  29. fmt.Printf("npuData: %v\n", npuData)
  30. mluData, err := cli.GetMLUData(Node{
  31. NodeId: sNodes[0].ID,
  32. })
  33. So(err, ShouldBeNil)
  34. fmt.Printf("mluData: %v\n", mluData)
  35. storageData, err := cli.GetStorageData(Node{
  36. NodeId: sNodes[0].ID,
  37. })
  38. So(err, ShouldBeNil)
  39. fmt.Printf("storageData: %v\n", storageData)
  40. memoryData, err := cli.GetMemoryData(Node{
  41. NodeId: sNodes[0].ID,
  42. })
  43. So(err, ShouldBeNil)
  44. fmt.Printf("memoryData: %v\n", memoryData)
  45. indicatorData, err := cli.GetIndicatorData(Node{
  46. NodeId: sNodes[0].ID,
  47. })
  48. So(err, ShouldBeNil)
  49. fmt.Printf("indicatorData: %v\n", indicatorData)
  50. })
  51. }