container.go 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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 containerCpu = SMeasurement{
  17. Context: []SMonitorContext{
  18. {
  19. "container_cpu", "Container cpu", monitor.METRIC_RES_TYPE_CONTAINER,
  20. monitor.METRIC_DATABASE_TELE,
  21. },
  22. },
  23. Metrics: []SMetric{
  24. {
  25. "usage_rate", "Container cpu usage rate", monitor.METRIC_UNIT_PERCENT,
  26. },
  27. },
  28. }
  29. var containerMem = SMeasurement{
  30. Context: []SMonitorContext{
  31. {
  32. "container_mem", "Container memory", monitor.METRIC_RES_TYPE_CONTAINER, monitor.METRIC_DATABASE_TELE,
  33. },
  34. },
  35. Metrics: []SMetric{
  36. {
  37. "usage_rate", "Container memory usage rate", monitor.METRIC_UNIT_PERCENT,
  38. },
  39. {
  40. "working_set_rate", "Container memory working set usage rate", monitor.METRIC_UNIT_PERCENT,
  41. },
  42. {
  43. "usage_bytes", "Container memory usage bytes", monitor.METRIC_UNIT_BYTE,
  44. },
  45. {
  46. "working_set_bytes", "Container memory working set bytes", monitor.METRIC_UNIT_BYTE,
  47. },
  48. },
  49. }
  50. var containerProcess = SMeasurement{
  51. Context: []SMonitorContext{
  52. {
  53. Name: "container_process",
  54. DisplayName: "Container process",
  55. ResourceType: monitor.METRIC_RES_TYPE_CONTAINER,
  56. Database: monitor.METRIC_DATABASE_TELE,
  57. },
  58. },
  59. Metrics: newCadvisorProcessMetrics("Container"),
  60. }
  61. var containerDiskIo = SMeasurement{
  62. Context: []SMonitorContext{
  63. {
  64. Name: "container_diskio",
  65. DisplayName: "Container diskio",
  66. ResourceType: monitor.METRIC_RES_TYPE_CONTAINER,
  67. Database: monitor.METRIC_DATABASE_TELE,
  68. },
  69. },
  70. Metrics: newCadvisorDiskIoMetrics("Container"),
  71. }