Metric.php 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. <?php
  2. /*
  3. * Copyright 2014 Google Inc.
  4. *
  5. * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  6. * use this file except in compliance with the License. You may obtain a copy of
  7. * the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  13. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  14. * License for the specific language governing permissions and limitations under
  15. * the License.
  16. */
  17. namespace Google\Service\Dataproc;
  18. class Metric extends \Google\Collection
  19. {
  20. /**
  21. * Required unspecified metric source.
  22. */
  23. public const METRIC_SOURCE_METRIC_SOURCE_UNSPECIFIED = 'METRIC_SOURCE_UNSPECIFIED';
  24. /**
  25. * Monitoring agent metrics. If this source is enabled, Dataproc enables the
  26. * monitoring agent in Compute Engine, and collects monitoring agent metrics,
  27. * which are published with an agent.googleapis.com prefix.
  28. */
  29. public const METRIC_SOURCE_MONITORING_AGENT_DEFAULTS = 'MONITORING_AGENT_DEFAULTS';
  30. /**
  31. * HDFS metric source.
  32. */
  33. public const METRIC_SOURCE_HDFS = 'HDFS';
  34. /**
  35. * Spark metric source.
  36. */
  37. public const METRIC_SOURCE_SPARK = 'SPARK';
  38. /**
  39. * YARN metric source.
  40. */
  41. public const METRIC_SOURCE_YARN = 'YARN';
  42. /**
  43. * Spark History Server metric source.
  44. */
  45. public const METRIC_SOURCE_SPARK_HISTORY_SERVER = 'SPARK_HISTORY_SERVER';
  46. /**
  47. * Hiveserver2 metric source.
  48. */
  49. public const METRIC_SOURCE_HIVESERVER2 = 'HIVESERVER2';
  50. /**
  51. * hivemetastore metric source
  52. */
  53. public const METRIC_SOURCE_HIVEMETASTORE = 'HIVEMETASTORE';
  54. /**
  55. * flink metric source
  56. */
  57. public const METRIC_SOURCE_FLINK = 'FLINK';
  58. protected $collection_key = 'metricOverrides';
  59. /**
  60. * Optional. Specify one or more Custom metrics
  61. * (https://cloud.google.com/dataproc/docs/guides/dataproc-
  62. * metrics#custom_metrics) to collect for the metric course (for the SPARK
  63. * metric source (any Spark metric
  64. * (https://spark.apache.org/docs/latest/monitoring.html#metrics) can be
  65. * specified).Provide metrics in the following format: METRIC_SOURCE:
  66. * INSTANCE:GROUP:METRIC Use camelcase as appropriate.Examples:
  67. * yarn:ResourceManager:QueueMetrics:AppsCompleted
  68. * spark:driver:DAGScheduler:job.allJobs
  69. * sparkHistoryServer:JVM:Memory:NonHeapMemoryUsage.committed
  70. * hiveserver2:JVM:Memory:NonHeapMemoryUsage.used Notes: Only the specified
  71. * overridden metrics are collected for the metric source. For example, if one
  72. * or more spark:executive metrics are listed as metric overrides, other SPARK
  73. * metrics are not collected. The collection of the metrics for other enabled
  74. * custom metric sources is unaffected. For example, if both SPARK and YARN
  75. * metric sources are enabled, and overrides are provided for Spark metrics
  76. * only, all YARN metrics are collected.
  77. *
  78. * @var string[]
  79. */
  80. public $metricOverrides;
  81. /**
  82. * Required. A standard set of metrics is collected unless metricOverrides are
  83. * specified for the metric source (see Custom metrics
  84. * (https://cloud.google.com/dataproc/docs/guides/dataproc-
  85. * metrics#custom_metrics) for more information).
  86. *
  87. * @var string
  88. */
  89. public $metricSource;
  90. /**
  91. * Optional. Specify one or more Custom metrics
  92. * (https://cloud.google.com/dataproc/docs/guides/dataproc-
  93. * metrics#custom_metrics) to collect for the metric course (for the SPARK
  94. * metric source (any Spark metric
  95. * (https://spark.apache.org/docs/latest/monitoring.html#metrics) can be
  96. * specified).Provide metrics in the following format: METRIC_SOURCE:
  97. * INSTANCE:GROUP:METRIC Use camelcase as appropriate.Examples:
  98. * yarn:ResourceManager:QueueMetrics:AppsCompleted
  99. * spark:driver:DAGScheduler:job.allJobs
  100. * sparkHistoryServer:JVM:Memory:NonHeapMemoryUsage.committed
  101. * hiveserver2:JVM:Memory:NonHeapMemoryUsage.used Notes: Only the specified
  102. * overridden metrics are collected for the metric source. For example, if one
  103. * or more spark:executive metrics are listed as metric overrides, other SPARK
  104. * metrics are not collected. The collection of the metrics for other enabled
  105. * custom metric sources is unaffected. For example, if both SPARK and YARN
  106. * metric sources are enabled, and overrides are provided for Spark metrics
  107. * only, all YARN metrics are collected.
  108. *
  109. * @param string[] $metricOverrides
  110. */
  111. public function setMetricOverrides($metricOverrides)
  112. {
  113. $this->metricOverrides = $metricOverrides;
  114. }
  115. /**
  116. * @return string[]
  117. */
  118. public function getMetricOverrides()
  119. {
  120. return $this->metricOverrides;
  121. }
  122. /**
  123. * Required. A standard set of metrics is collected unless metricOverrides are
  124. * specified for the metric source (see Custom metrics
  125. * (https://cloud.google.com/dataproc/docs/guides/dataproc-
  126. * metrics#custom_metrics) for more information).
  127. *
  128. * Accepted values: METRIC_SOURCE_UNSPECIFIED, MONITORING_AGENT_DEFAULTS,
  129. * HDFS, SPARK, YARN, SPARK_HISTORY_SERVER, HIVESERVER2, HIVEMETASTORE, FLINK
  130. *
  131. * @param self::METRIC_SOURCE_* $metricSource
  132. */
  133. public function setMetricSource($metricSource)
  134. {
  135. $this->metricSource = $metricSource;
  136. }
  137. /**
  138. * @return self::METRIC_SOURCE_*
  139. */
  140. public function getMetricSource()
  141. {
  142. return $this->metricSource;
  143. }
  144. }
  145. // Adding a class alias for backwards compatibility with the previous class name.
  146. class_alias(Metric::class, 'Google_Service_Dataproc_Metric');