testikey.go 608 B

12345678910111213141516171819202122232425262728293031
  1. package main
  2. import (
  3. //"fmt"
  4. //"time"
  5. //"math"
  6. //"strconv"
  7. . "git.wecise.com/wecise/odbserver/odb"
  8. "gitee.com/wecisecode/util/logger"
  9. )
  10. func main() {
  11. class := "/cncc/entity/os/linux"
  12. field := "performance"
  13. name := "fs_used"
  14. labels := map[string]string{
  15. "appSystem": "精卫统一运维平台",
  16. "centerCode": "上海NPC",
  17. "deptName": "运维系统部",
  18. "mountpoint": "/",
  19. "originKpi": "os.linux.fs_used",
  20. }
  21. for i := 0; i < 1000; i++ {
  22. if h, err := NMap2ikey(class, field, name, labels); err != nil {
  23. logger.Error(err)
  24. } else {
  25. logger.Infof("===>%d", int64(h))
  26. }
  27. }
  28. }