[
https://issues.apache.org/jira/browse/FLINK-25801?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Flink Jira Bot updated FLINK-25801:
-----------------------------------
Labels: pull-request-available stale-major (was: pull-request-available)
I am the [Flink Jira Bot|https://github.com/apache/flink-jira-bot/] and I help
the community manage its development. I see this issues has been marked as
Major but is unassigned and neither itself nor its Sub-Tasks have been updated
for 60 days. I have gone ahead and added a "stale-major" to the issue". If this
ticket is a Major, please either assign yourself or give an update. Afterwards,
please remove the label or in 7 days the issue will be deprioritized.
> add cpu processor metric of taskmanager
> ---------------------------------------
>
> Key: FLINK-25801
> URL: https://issues.apache.org/jira/browse/FLINK-25801
> Project: Flink
> Issue Type: Improvement
> Components: Runtime / Metrics
> Reporter: 王俊博
> Priority: Major
> Labels: pull-request-available, stale-major
>
> flink process add cpu load metric, with user know environment of cpu
> processor they can determine that their job is io bound /cpu bound . But
> flink doesn't add container access cpu processor metric, if cpu environment
> of taskmanager is different(Cpu cores), it's hard to calculate cpu used of
> flink.
>
> {code:java}
> //代码占位符
> metrics.<Double, Gauge<Double>>gauge("Load", mxBean::getProcessCpuLoad);
> metrics.<Long, Gauge<Long>>gauge("Time", mxBean::getProcessCpuTime); {code}
> Spark give totalCores to show Number of cores available in this executor in
> ExecutorSummary.
> [https://spark.apache.org/docs/3.1.1/monitoring.html#:~:text=totalCores,in%20this%20executor.]
> {code:java}
> //代码占位符
> val sb = new StringBuilder
> sb.append(s"""spark_info{version="$SPARK_VERSION_SHORT",
> revision="$SPARK_REVISION"} 1.0\n""")
> val store = uiRoot.asInstanceOf[SparkUI].store
> store.executorList(true).foreach { executor =>
> val prefix = "metrics_executor_"
> val labels = Seq(
> "application_id" -> store.applicationInfo.id,
> "application_name" -> store.applicationInfo.name,
> "executor_id" -> executor.id
> ).map { case (k, v) => s"""$k="$v"""" }.mkString("{", ", ", "}")
> sb.append(s"${prefix}rddBlocks$labels ${executor.rddBlocks}\n")
> sb.append(s"${prefix}memoryUsed_bytes$labels ${executor.memoryUsed}\n")
> sb.append(s"${prefix}diskUsed_bytes$labels ${executor.diskUsed}\n")
> sb.append(s"${prefix}totalCores$labels ${executor.totalCores}\n")
> }{code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)