You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by ta...@apache.org on 2024/01/23 05:49:18 UTC
(flink) branch master updated: [FLINK-34029][runtime-web] Support different profiling mode on Flink WEB
This is an automated email from the ASF dual-hosted git repository.
tangyun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git
The following commit(s) were added to refs/heads/master by this push:
new 4db6e72ed76 [FLINK-34029][runtime-web] Support different profiling mode on Flink WEB
4db6e72ed76 is described below
commit 4db6e72ed766791d25ee0379c7c29d1b4e2c08df
Author: Yu Chen <yu...@gmail.com>
AuthorDate: Thu Jan 11 13:27:45 2024 +0800
[FLINK-34029][runtime-web] Support different profiling mode on Flink WEB
---
.../profiler/job-manager-profiler.component.html | 52 ++++++++++++++++
.../profiler/job-manager-profiler.component.ts | 2 +-
.../profiler/task-manager-profiler.component.html | 70 ++++++++++++++++++++++
.../profiler/task-manager-profiler.component.ts | 8 ++-
4 files changed, 129 insertions(+), 3 deletions(-)
diff --git a/flink-runtime-web/web-dashboard/src/app/pages/job-manager/profiler/job-manager-profiler.component.html b/flink-runtime-web/web-dashboard/src/app/pages/job-manager/profiler/job-manager-profiler.component.html
index 9d1e62788f4..16429b41fe0 100644
--- a/flink-runtime-web/web-dashboard/src/app/pages/job-manager/profiler/job-manager-profiler.component.html
+++ b/flink-runtime-web/web-dashboard/src/app/pages/job-manager/profiler/job-manager-profiler.component.html
@@ -31,6 +31,58 @@
></nz-input-number>
</nz-form-control>
</nz-form-item>
+ <nz-form-item>
+ <nz-form-label nzFor="mode">Profiling Mode</nz-form-label>
+ <nz-form-control>
+ <nz-select
+ [(ngModel)]="selectMode"
+ nzPlaceHolder="Profiling Mode"
+ name="mode"
+ style="width: 200px"
+ >
+ <nz-option nzCustomContent nzValue="CPU" nzLabel="CPU">
+ <span
+ nz-tooltip
+ nzTooltipTitle="In this mode profiler collects stack trace samples that include Java methods, native calls, JVM code and kernel functions."
+ >
+ CPU
+ </span>
+ </nz-option>
+ <nz-option nzCustomContent nzValue="LOCK" nzLabel="Lock">
+ <span
+ nz-tooltip
+ nzTooltipTitle="In lock profiling mode the top frame is the class of lock/monitor, and the counter is number of nanoseconds it took to enter this lock/monitor."
+ >
+ Lock
+ </span>
+ </nz-option>
+ <nz-option nzCustomContent nzValue="WALL" nzLabel="Wall-Clock">
+ <span
+ nz-tooltip
+ nzTooltipTitle="Wall-Clock option tells async-profiler to sample all threads equally every given period of time regardless of thread status: Running, Sleeping or Blocked. For instance, this can be helpful when profiling application start-up time."
+ >
+ Wall-Clock
+ </span>
+ </nz-option>
+ <nz-option nzCustomContent nzValue="ALLOC" nzLabel="Allocation">
+ <span
+ nz-tooltip
+ nzTooltipTitle="In allocation profiling mode the top frame of every call trace is the class of the allocated object, and the counter is the heap pressure (the total size of allocated TLABs or objects outside TLAB)."
+ >
+ Allocation
+ </span>
+ </nz-option>
+ <nz-option nzCustomContent nzValue="ITIMER" nzLabel="ITIMER">
+ <span
+ nz-tooltip
+ nzTooltipTitle="You can fall back to itimer profiling mode. It is similar to cpu mode, but does not require perf_events support. As a drawback, there will be no kernel stack traces."
+ >
+ ITIMER
+ </span>
+ </nz-option>
+ </nz-select>
+ </nz-form-control>
+ </nz-form-item>
<nz-form-item>
<nz-form-control>
<button
diff --git a/flink-runtime-web/web-dashboard/src/app/pages/job-manager/profiler/job-manager-profiler.component.ts b/flink-runtime-web/web-dashboard/src/app/pages/job-manager/profiler/job-manager-profiler.component.ts
index c17e88bba5b..d5d8eb28c85 100644
--- a/flink-runtime-web/web-dashboard/src/app/pages/job-manager/profiler/job-manager-profiler.component.ts
+++ b/flink-runtime-web/web-dashboard/src/app/pages/job-manager/profiler/job-manager-profiler.component.ts
@@ -68,7 +68,7 @@ export class JobManagerProfilerComponent implements OnInit, OnDestroy {
isLoading = true;
isCreating = false;
duration = 30;
- selectMode = 'CPU';
+ selectMode = 'ITIMER';
isEnabled = false;
formatterDuration = (value: number): string => `${value} s`;
parserDuration = (value: string): string => value.replace(' s', '');
diff --git a/flink-runtime-web/web-dashboard/src/app/pages/task-manager/profiler/task-manager-profiler.component.html b/flink-runtime-web/web-dashboard/src/app/pages/task-manager/profiler/task-manager-profiler.component.html
index 6124cd2a374..175cf546064 100644
--- a/flink-runtime-web/web-dashboard/src/app/pages/task-manager/profiler/task-manager-profiler.component.html
+++ b/flink-runtime-web/web-dashboard/src/app/pages/task-manager/profiler/task-manager-profiler.component.html
@@ -31,6 +31,58 @@
></nz-input-number>
</nz-form-control>
</nz-form-item>
+ <nz-form-item>
+ <nz-form-label nzFor="mode">Profiling Mode</nz-form-label>
+ <nz-form-control>
+ <nz-select
+ [(ngModel)]="selectMode"
+ nzPlaceHolder="Profiling Mode"
+ name="mode"
+ style="width: 200px"
+ >
+ <nz-option nzCustomContent nzValue="CPU" nzLabel="CPU">
+ <span
+ nz-tooltip
+ nzTooltipTitle="In this mode profiler collects stack trace samples that include Java methods, native calls, JVM code and kernel functions."
+ >
+ CPU
+ </span>
+ </nz-option>
+ <nz-option nzCustomContent nzValue="LOCK" nzLabel="Lock">
+ <span
+ nz-tooltip
+ nzTooltipTitle="In lock profiling mode the top frame is the class of lock/monitor, and the counter is number of nanoseconds it took to enter this lock/monitor."
+ >
+ Lock
+ </span>
+ </nz-option>
+ <nz-option nzCustomContent nzValue="WALL" nzLabel="Wall-Clock">
+ <span
+ nz-tooltip
+ nzTooltipTitle="Wall-Clock option tells async-profiler to sample all threads equally every given period of time regardless of thread status: Running, Sleeping or Blocked. For instance, this can be helpful when profiling application start-up time."
+ >
+ Wall-Clock
+ </span>
+ </nz-option>
+ <nz-option nzCustomContent nzValue="ALLOC" nzLabel="Allocation">
+ <span
+ nz-tooltip
+ nzTooltipTitle="In allocation profiling mode the top frame of every call trace is the class of the allocated object, and the counter is the heap pressure (the total size of allocated TLABs or objects outside TLAB)."
+ >
+ Allocation
+ </span>
+ </nz-option>
+ <nz-option nzCustomContent nzValue="ITIMER" nzLabel="ITIMER">
+ <span
+ nz-tooltip
+ nzTooltipTitle="You can fall back to itimer profiling mode. It is similar to cpu mode, but does not require perf_events support. As a drawback, there will be no kernel stack traces."
+ >
+ ITIMER
+ </span>
+ </nz-option>
+ </nz-select>
+ </nz-form-control>
+ </nz-form-item>
<nz-form-item>
<nz-form-control>
<button
@@ -43,6 +95,24 @@
>
Create Profiling Instance
</button>
+ <i
+ class="header-icon"
+ style="margin-left: 10px"
+ nz-icon
+ nz-tooltip
+ [nzTooltipTitle]="titleTemplate"
+ nzTooltipTitle=""
+ nzType="info-circle"
+ ></i>
+ <ng-template #titleTemplate>
+ <span>
+ Please refer to
+ <a href="https://github.com/async-profiler/async-profiler/wiki">
+ async-profiler's wiki
+ </a>
+ for more detailed info of this feature.
+ </span>
+ </ng-template>
</nz-form-control>
</nz-form-item>
</form>
diff --git a/flink-runtime-web/web-dashboard/src/app/pages/task-manager/profiler/task-manager-profiler.component.ts b/flink-runtime-web/web-dashboard/src/app/pages/task-manager/profiler/task-manager-profiler.component.ts
index 1bfb50ec137..e8abb2353ac 100644
--- a/flink-runtime-web/web-dashboard/src/app/pages/task-manager/profiler/task-manager-profiler.component.ts
+++ b/flink-runtime-web/web-dashboard/src/app/pages/task-manager/profiler/task-manager-profiler.component.ts
@@ -31,11 +31,13 @@ import { NzAlertModule } from 'ng-zorro-antd/alert';
import { NzButtonModule } from 'ng-zorro-antd/button';
import { NzCardModule } from 'ng-zorro-antd/card';
import { NzFormModule } from 'ng-zorro-antd/form';
+import { NzIconModule } from 'ng-zorro-antd/icon';
import { NzInputNumberModule } from 'ng-zorro-antd/input-number';
import { NzMessageModule, NzMessageService } from 'ng-zorro-antd/message';
import { NzSelectModule } from 'ng-zorro-antd/select';
import { NzSpaceModule } from 'ng-zorro-antd/space';
import { NzTableModule } from 'ng-zorro-antd/table';
+import { NzToolTipModule } from 'ng-zorro-antd/tooltip';
@Component({
selector: 'flink-task-manager-profiler',
@@ -55,7 +57,9 @@ import { NzTableModule } from 'ng-zorro-antd/table';
CommonModule,
NzSpaceModule,
HumanizeWatermarkToDatetimePipe,
- NzSelectModule
+ NzSelectModule,
+ NzToolTipModule,
+ NzIconModule
],
standalone: true
})
@@ -65,7 +69,7 @@ export class TaskManagerProfilerComponent implements OnInit, OnDestroy {
isLoading = true;
isCreating = false;
duration = 30;
- selectMode = 'CPU';
+ selectMode = 'ITIMER';
isEnabled = false;
formatterDuration = (value: number): string => `${value} s`;
parserDuration = (value: string): string => value.replace(' s', '');