RocMarshal commented on code in PR #27874:
URL: https://github.com/apache/flink/pull/27874#discussion_r3022638611


##########
flink-runtime-web/web-dashboard/src/app/interfaces/job-rescales.ts:
##########
@@ -16,6 +16,76 @@
  * limitations under the License.
  */
 
+export type RescalesHistories = RescalesHistory[];
+
+export interface RescalesHistory {
+  rescaleUuid: string;
+  resourceRequirementsUuid: string;
+  rescaleAttemptId: number;
+  vertices: object;
+  slots: object;
+  schedulerStates: unknown[];
+  startTimestampInMillis: number;
+  endTimestampInMillis: number;
+  terminalState: string;
+  triggerCause: string;
+  terminatedReason: string;
+  expand?: boolean;
+}
+
+export interface RescalesDetailHistory {
+  rescaleUuid: string;
+  resourceRequirementsUuid: string;
+  rescaleAttemptId: number;
+  vertices: { [vertexId: string]: RescaleVertex };
+  slots: { [slotSharingGroupId: string]: RescaleSlot };
+  schedulerStates: SchedulerState[];
+  startTimestampInMillis: number;
+  endTimestampInMillis: number;
+  terminalState: string;
+  triggerCause: string;
+  terminatedReason: string;
+}
+
+export interface RescaleVertex {

Review Comment:
   ->`VertexParallelismRescaleInfo`



##########
flink-runtime-web/web-dashboard/src/app/interfaces/job-rescales.ts:
##########
@@ -16,6 +16,76 @@
  * limitations under the License.
  */
 
+export type RescalesHistories = RescalesHistory[];
+
+export interface RescalesHistory {
+  rescaleUuid: string;
+  resourceRequirementsUuid: string;
+  rescaleAttemptId: number;
+  vertices: object;
+  slots: object;
+  schedulerStates: unknown[];
+  startTimestampInMillis: number;
+  endTimestampInMillis: number;
+  terminalState: string;
+  triggerCause: string;
+  terminatedReason: string;
+  expand?: boolean;
+}
+
+export interface RescalesDetailHistory {
+  rescaleUuid: string;
+  resourceRequirementsUuid: string;
+  rescaleAttemptId: number;
+  vertices: { [vertexId: string]: RescaleVertex };
+  slots: { [slotSharingGroupId: string]: RescaleSlot };
+  schedulerStates: SchedulerState[];
+  startTimestampInMillis: number;
+  endTimestampInMillis: number;
+  terminalState: string;
+  triggerCause: string;
+  terminatedReason: string;
+}

Review Comment:
   - What about renaming it to `JobRescaleDetails(keep the same name as backend 
REST part)`
   - What about merging the two interface into one for reusing( The 
corresponding class in backend is one class.)?  
   
   
   ```
   export interface JobRescaleDetails {
     rescaleUuid: string;
     resourceRequirementsUuid: string;
     rescaleAttemptId: number;
     vertices?: { [vertexId: string]: VertexParallelismRescaleInfo };
     slots?: { [slotSharingGroupId: string]: SlotSharingGroupRescaleInfo };
     schedulerStates?: SchedulerState[];
     startTimestampInMillis: number;
     endTimestampInMillis: number;
     terminalState: string;
     triggerCause: string;
     terminatedReason: string;
   }
   ```



##########
flink-runtime-web/web-dashboard/src/app/interfaces/job-rescales.ts:
##########
@@ -16,6 +16,76 @@
  * limitations under the License.
  */
 
+export type RescalesHistories = RescalesHistory[];
+
+export interface RescalesHistory {
+  rescaleUuid: string;
+  resourceRequirementsUuid: string;
+  rescaleAttemptId: number;
+  vertices: object;
+  slots: object;
+  schedulerStates: unknown[];
+  startTimestampInMillis: number;
+  endTimestampInMillis: number;
+  terminalState: string;
+  triggerCause: string;
+  terminatedReason: string;
+  expand?: boolean;
+}
+
+export interface RescalesDetailHistory {
+  rescaleUuid: string;
+  resourceRequirementsUuid: string;
+  rescaleAttemptId: number;
+  vertices: { [vertexId: string]: RescaleVertex };
+  slots: { [slotSharingGroupId: string]: RescaleSlot };
+  schedulerStates: SchedulerState[];
+  startTimestampInMillis: number;
+  endTimestampInMillis: number;
+  terminalState: string;
+  triggerCause: string;
+  terminatedReason: string;
+}
+
+export interface RescaleVertex {
+  jobVertexId: string;
+  jobVertexName: string;
+  slotSharingGroupId: string;
+  slotSharingGroupName: string;
+  desiredParallelism: number;
+  sufficientParallelism: number;
+  preRescaleParallelism: number;
+  postRescaleParallelism: number;
+}
+
+export interface RescaleSlot {
+  slotSharingGroupId: string;
+  slotSharingGroupName: string;
+  requestResourceProfile: ResourceProfile;
+  desiredSlots: number;
+  minimalRequiredSlots: number;
+  preRescaleSlots: number;
+  postRescaleSlots: number;
+  acquiredResourceProfile: ResourceProfile;
+}
+
+export interface ResourceProfile {

Review Comment:
   -> `ResourceProfileInfo`



##########
flink-runtime-web/web-dashboard/src/app/pages/job/rescales/job-rescales.component.html:
##########
@@ -22,6 +22,319 @@
   [nzAnimated]="{ inkBar: true, tabPane: false }"
   [nzTabBarExtraContent]="extraTemplate"
 >
+  <nz-tab nzTitle="History">
+    <nz-table
+      class="no-border small"
+      [nzSize]="'small'"
+      [nzData]="rescalesHistories || []"
+      [nzFrontPagination]="false"
+      [nzShowPagination]="false"
+    >
+      <thead>
+        <tr>
+          <th nzWidth="70px" nzAlign="center"></th>
+          <th
+            nz-tooltip
+            nzTooltipTitle="The unique ID in Rescale consists of 32 
hexadecimal characters"
+          >
+            <strong>Rescale UUID</strong>
+          </th>
+          <th
+            nz-tooltip
+            nzTooltipTitle="The number ID of Rescale attempts that occurred 
under the same resource requirements"
+          >
+            <strong>Attempt ID</strong>
+          </th>
+          <th
+            nz-tooltip
+            nzTooltipTitle="The unique ID of resource requirements consists of 
32 hexadecimal characters"
+          >
+            <strong>Requirements ID</strong>
+          </th>
+          <th nz-tooltip nzTooltipTitle="The reason that triggers the target 
Rescale">
+            <strong>Trigger Cause</strong>
+          </th>
+          <th nz-tooltip nzTooltipTitle="The end state of the target Rescale">
+            <strong>Terminal State</strong>
+          </th>
+          <th
+            nz-tooltip
+            nzTooltipTitle="The reason for the completion or termination of 
the target Rescale"
+          >
+            <strong>Terminated Reason</strong>
+          </th>
+          <th nz-tooltip nzTooltipTitle="The start time of the target Rescale">
+            <strong>Start Time</strong>
+          </th>
+          <th
+            nz-tooltip
+            nzTooltipTitle="Duration from the start of the rescale to its 
completion or until now"
+          >
+            <strong>Duration</strong>
+          </th>
+          <th nz-tooltip nzTooltipTitle="The end time of the target Rescale">
+            <strong>End Time</strong>
+          </th>
+        </tr>
+      </thead>
+      <tbody>
+        <ng-container *ngFor="let history of rescalesHistories; trackBy: 
trackById">
+          <tr>
+            <td
+              nzShowExpand
+              [(nzExpand)]="history.expand"
+              (nzExpandChange)="onExpandChange(history, $event)"
+            ></td>
+            <td nz-tooltip [nzTooltipTitle]="history.rescaleUuid">
+              {{ truncateUuid(history.rescaleUuid) }}
+            </td>
+            <td>{{ history.rescaleAttemptId }}</td>
+            <td nz-tooltip [nzTooltipTitle]="history.resourceRequirementsUuid">
+              {{ truncateUuid(history.resourceRequirementsUuid) }}

Review Comment:
   `truncateXXX`  nice!



##########
flink-runtime-web/web-dashboard/src/app/interfaces/job-rescales.ts:
##########
@@ -16,6 +16,76 @@
  * limitations under the License.
  */
 
+export type RescalesHistories = RescalesHistory[];
+
+export interface RescalesHistory {
+  rescaleUuid: string;
+  resourceRequirementsUuid: string;
+  rescaleAttemptId: number;
+  vertices: object;
+  slots: object;
+  schedulerStates: unknown[];
+  startTimestampInMillis: number;
+  endTimestampInMillis: number;
+  terminalState: string;
+  triggerCause: string;
+  terminatedReason: string;
+  expand?: boolean;
+}
+
+export interface RescalesDetailHistory {
+  rescaleUuid: string;
+  resourceRequirementsUuid: string;
+  rescaleAttemptId: number;
+  vertices: { [vertexId: string]: RescaleVertex };
+  slots: { [slotSharingGroupId: string]: RescaleSlot };
+  schedulerStates: SchedulerState[];
+  startTimestampInMillis: number;
+  endTimestampInMillis: number;
+  terminalState: string;
+  triggerCause: string;
+  terminatedReason: string;
+}
+
+export interface RescaleVertex {
+  jobVertexId: string;
+  jobVertexName: string;
+  slotSharingGroupId: string;
+  slotSharingGroupName: string;
+  desiredParallelism: number;
+  sufficientParallelism: number;
+  preRescaleParallelism: number;
+  postRescaleParallelism: number;
+}
+
+export interface RescaleSlot {
+  slotSharingGroupId: string;
+  slotSharingGroupName: string;
+  requestResourceProfile: ResourceProfile;
+  desiredSlots: number;
+  minimalRequiredSlots: number;
+  preRescaleSlots: number;
+  postRescaleSlots: number;
+  acquiredResourceProfile: ResourceProfile;
+}
+
+export interface ResourceProfile {
+  cpuCores: number;
+  taskHeapMemory: number;
+  taskOffHeapMemory: number;
+  managedMemory: number;
+  networkMemory: number;
+  extendedResources: { [key: string]: unknown };
+}
+
+export interface SchedulerState {
+  state: string;
+  enterTimestampInMillis: number;
+  leaveTimestampInMillis: number;
+  durationInMillis: number;
+  stringifiedException: string;
+}
+
 export interface RescalesConfig {

Review Comment:
   ```suggestion
   export interface JobRescaleConfigInfo {
   ```
   
   



##########
flink-runtime-web/web-dashboard/src/app/interfaces/job-rescales.ts:
##########
@@ -16,6 +16,76 @@
  * limitations under the License.
  */
 
+export type RescalesHistories = RescalesHistory[];
+
+export interface RescalesHistory {
+  rescaleUuid: string;
+  resourceRequirementsUuid: string;
+  rescaleAttemptId: number;
+  vertices: object;
+  slots: object;
+  schedulerStates: unknown[];
+  startTimestampInMillis: number;
+  endTimestampInMillis: number;
+  terminalState: string;
+  triggerCause: string;
+  terminatedReason: string;
+  expand?: boolean;
+}
+
+export interface RescalesDetailHistory {
+  rescaleUuid: string;
+  resourceRequirementsUuid: string;
+  rescaleAttemptId: number;
+  vertices: { [vertexId: string]: RescaleVertex };
+  slots: { [slotSharingGroupId: string]: RescaleSlot };
+  schedulerStates: SchedulerState[];
+  startTimestampInMillis: number;
+  endTimestampInMillis: number;
+  terminalState: string;
+  triggerCause: string;
+  terminatedReason: string;
+}
+
+export interface RescaleVertex {
+  jobVertexId: string;
+  jobVertexName: string;
+  slotSharingGroupId: string;
+  slotSharingGroupName: string;
+  desiredParallelism: number;
+  sufficientParallelism: number;
+  preRescaleParallelism: number;
+  postRescaleParallelism: number;
+}
+
+export interface RescaleSlot {

Review Comment:
   -> `SlotSharingGroupRescaleInfo`



##########
flink-runtime-web/web-dashboard/src/app/pages/job/rescales/job-rescales.component.html:
##########
@@ -22,6 +22,319 @@
   [nzAnimated]="{ inkBar: true, tabPane: false }"
   [nzTabBarExtraContent]="extraTemplate"
 >
+  <nz-tab nzTitle="History">
+    <nz-table
+      class="no-border small"
+      [nzSize]="'small'"
+      [nzData]="rescalesHistories || []"
+      [nzFrontPagination]="false"
+      [nzShowPagination]="false"
+    >
+      <thead>
+        <tr>
+          <th nzWidth="70px" nzAlign="center"></th>
+          <th
+            nz-tooltip
+            nzTooltipTitle="The unique ID in Rescale consists of 32 
hexadecimal characters"
+          >
+            <strong>Rescale UUID</strong>
+          </th>
+          <th
+            nz-tooltip
+            nzTooltipTitle="The number ID of Rescale attempts that occurred 
under the same resource requirements"
+          >
+            <strong>Attempt ID</strong>
+          </th>
+          <th
+            nz-tooltip
+            nzTooltipTitle="The unique ID of resource requirements consists of 
32 hexadecimal characters"
+          >
+            <strong>Requirements ID</strong>
+          </th>
+          <th nz-tooltip nzTooltipTitle="The reason that triggers the target 
Rescale">
+            <strong>Trigger Cause</strong>
+          </th>
+          <th nz-tooltip nzTooltipTitle="The end state of the target Rescale">
+            <strong>Terminal State</strong>
+          </th>
+          <th
+            nz-tooltip
+            nzTooltipTitle="The reason for the completion or termination of 
the target Rescale"
+          >
+            <strong>Terminated Reason</strong>
+          </th>
+          <th nz-tooltip nzTooltipTitle="The start time of the target Rescale">
+            <strong>Start Time</strong>
+          </th>
+          <th
+            nz-tooltip
+            nzTooltipTitle="Duration from the start of the rescale to its 
completion or until now"
+          >
+            <strong>Duration</strong>
+          </th>
+          <th nz-tooltip nzTooltipTitle="The end time of the target Rescale">
+            <strong>End Time</strong>
+          </th>
+        </tr>
+      </thead>
+      <tbody>
+        <ng-container *ngFor="let history of rescalesHistories; trackBy: 
trackById">
+          <tr>
+            <td
+              nzShowExpand
+              [(nzExpand)]="history.expand"
+              (nzExpandChange)="onExpandChange(history, $event)"
+            ></td>
+            <td nz-tooltip [nzTooltipTitle]="history.rescaleUuid">
+              {{ truncateUuid(history.rescaleUuid) }}
+            </td>
+            <td>{{ history.rescaleAttemptId }}</td>
+            <td nz-tooltip [nzTooltipTitle]="history.resourceRequirementsUuid">
+              {{ truncateUuid(history.resourceRequirementsUuid) }}
+            </td>
+            <td>{{ history.triggerCause }}</td>
+            <td><flink-job-badge 
[state]="history.terminalState"></flink-job-badge></td>
+            <td>{{ history.terminatedReason }}</td>
+            <td>{{ history.startTimestampInMillis | date: 'yyyy-MM-dd 
HH:mm:ss.SSS' }}</td>
+            <td>
+              {{ history.endTimestampInMillis - history.startTimestampInMillis 
| humanizeDuration }}
+            </td>
+            <td>{{ history.endTimestampInMillis | date: 'yyyy-MM-dd 
HH:mm:ss.SSS' }}</td>
+          </tr>
+          <tr [nzExpand]="history.expand">
+            <td colspan="10" *ngIf="history.expand" class="collapse-td">
+              <div class="rescale-details-wrapper">
+                <div class="rescale-details-box">
+                  <h3><strong>Rescale Details</strong></h3>
+                  <p>
+                    Rescale UUID:
+                    {{ truncateUuid(history.rescaleUuid) }}
+                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Attempt ID:
+                    {{ history.rescaleAttemptId }}
+                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
Requirements ID:
+                    {{ truncateUuid(history.resourceRequirementsUuid) }}
+                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Trigger 
Cause:
+                    {{ history.triggerCause }} 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+                    Terminal State:
+                    {{ history.terminalState }} 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+                    Terminal Reason: {{ history.terminatedReason }}
+                  </p>

Review Comment:
   The part could reference the implementation of 
`web-dashboard/src/app/pages/job/checkpoints/job-checkpoints.component.html`
   
   <img width="1281" height="974" alt="Image" 
src="https://github.com/user-attachments/assets/43d19947-aa7c-4a7c-806e-ce4393c1a4cd";
 />
   
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to