internal.go 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. // Copyright 2019 Yunion
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. package measurements
  15. import "yunion.io/x/onecloud/pkg/apis/monitor"
  16. var internalMemstats = SMeasurement{
  17. Context: []SMonitorContext{
  18. {
  19. Name: "internal_memstats",
  20. DisplayName: "Memory usage statistics of telegraf agent",
  21. ResourceType: monitor.METRIC_RES_TYPE_HOST,
  22. Database: monitor.METRIC_DATABASE_TELE,
  23. },
  24. },
  25. Metrics: []SMetric{
  26. {
  27. Name: "alloc_bytes",
  28. DisplayName: "alloc_bytes",
  29. Unit: monitor.METRIC_UNIT_COUNT,
  30. },
  31. {
  32. Name: "frees",
  33. },
  34. {
  35. Name: "heap_alloc_bytes",
  36. },
  37. {
  38. Name: "heap_idle_bytes",
  39. },
  40. {
  41. Name: "heap_in_use_bytes",
  42. },
  43. {
  44. Name: "heap_objects_bytes",
  45. },
  46. {
  47. Name: "heap_released_bytes",
  48. },
  49. {
  50. Name: "heap_sys_bytes",
  51. },
  52. {
  53. Name: "mallocs",
  54. },
  55. {
  56. Name: "num_gc",
  57. },
  58. {
  59. Name: "pointer_lookups",
  60. },
  61. {
  62. Name: "sys_bytes",
  63. },
  64. {
  65. Name: "total_alloc_bytes",
  66. },
  67. },
  68. }
  69. var internalAgent = SMeasurement{
  70. Context: []SMonitorContext{
  71. {
  72. Name: "internal_agent",
  73. DisplayName: "Agent wide statistics of telegraf agent",
  74. ResourceType: monitor.METRIC_RES_TYPE_HOST,
  75. Database: monitor.METRIC_DATABASE_TELE,
  76. },
  77. },
  78. Metrics: []SMetric{
  79. {
  80. Name: "gather_errors",
  81. },
  82. {
  83. Name: "metrics_dropped",
  84. },
  85. {
  86. Name: "metrics_gathered",
  87. },
  88. {
  89. Name: "metrics_written",
  90. },
  91. },
  92. }
  93. var internalGather = SMeasurement{
  94. Context: []SMonitorContext{
  95. {
  96. Name: "internal_gather",
  97. DisplayName: "Gather statistics of telegraf agent",
  98. ResourceType: monitor.METRIC_RES_TYPE_HOST,
  99. Database: monitor.METRIC_DATABASE_TELE,
  100. },
  101. },
  102. Metrics: []SMetric{
  103. {
  104. Name: "gather_time_ns",
  105. },
  106. {
  107. Name: "metrics_gathered",
  108. },
  109. },
  110. }
  111. var internalWrite = SMeasurement{
  112. Context: []SMonitorContext{
  113. {
  114. Name: "internal_write",
  115. DisplayName: "Write statistics of telegraf agent",
  116. ResourceType: monitor.METRIC_RES_TYPE_HOST,
  117. Database: monitor.METRIC_DATABASE_TELE,
  118. },
  119. },
  120. Metrics: []SMetric{
  121. {
  122. Name: "buffer_limit",
  123. },
  124. {
  125. Name: "buffer_size",
  126. },
  127. {
  128. Name: "metrics_added",
  129. },
  130. {
  131. Name: "metrics_written",
  132. },
  133. {
  134. Name: "metrics_dropped",
  135. },
  136. {
  137. Name: "metrics_filtered",
  138. },
  139. {
  140. Name: "write_time_ns",
  141. },
  142. },
  143. }