Skip to content

Commit 39a9a84

Browse files
committed
<feature>[longjob]: standardize progress detail fields to be unit-agnostic
Resolves: ZSTAC-82318 Change-Id: If68d507a3eeb3f48458d9fbf61c357339688d43b
1 parent 327b1cc commit 39a9a84

3 files changed

Lines changed: 194 additions & 297 deletions

File tree

header/src/main/java/org/zstack/header/core/progress/LongJobProgressDetail.java

Lines changed: 29 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,23 @@ public class LongJobProgressDetail {
2121
/** Human-readable reason for current state. */
2222
private String stateReason;
2323

24-
/** Bytes already processed. */
25-
private Long processedBytes;
24+
/** Amount already processed (unit described by the {@code unit} field). */
25+
private Long processed;
2626

27-
/** Total bytes to process. */
28-
private Long totalBytes;
27+
/** Total amount to process (unit described by the {@code unit} field). */
28+
private Long total;
2929

3030
/** Items already processed (e.g. files, chunks). */
3131
private Long processedItems;
3232

3333
/** Total items to process. */
3434
private Long totalItems;
3535

36-
/** Transfer speed in bytes/s. */
37-
private Long speedBytesPerSecond;
36+
/** Processing speed per second (unit described by the {@code unit} field). */
37+
private Long speed;
38+
39+
/** Unit for processed/total/speed, e.g. "bytes", "items", "steps". */
40+
private String unit;
3841

3942
/** Estimated remaining time in seconds. */
4043
private Long estimatedRemainingSeconds;
@@ -77,20 +80,20 @@ public void setStateReason(String stateReason) {
7780
this.stateReason = stateReason;
7881
}
7982

80-
public Long getProcessedBytes() {
81-
return processedBytes;
83+
public Long getProcessed() {
84+
return processed;
8285
}
8386

84-
public void setProcessedBytes(Long processedBytes) {
85-
this.processedBytes = processedBytes;
87+
public void setProcessed(Long processed) {
88+
this.processed = processed;
8689
}
8790

88-
public Long getTotalBytes() {
89-
return totalBytes;
91+
public Long getTotal() {
92+
return total;
9093
}
9194

92-
public void setTotalBytes(Long totalBytes) {
93-
this.totalBytes = totalBytes;
95+
public void setTotal(Long total) {
96+
this.total = total;
9497
}
9598

9699
public Long getProcessedItems() {
@@ -109,12 +112,20 @@ public void setTotalItems(Long totalItems) {
109112
this.totalItems = totalItems;
110113
}
111114

112-
public Long getSpeedBytesPerSecond() {
113-
return speedBytesPerSecond;
115+
public Long getSpeed() {
116+
return speed;
117+
}
118+
119+
public void setSpeed(Long speed) {
120+
this.speed = speed;
121+
}
122+
123+
public String getUnit() {
124+
return unit;
114125
}
115126

116-
public void setSpeedBytesPerSecond(Long speedBytesPerSecond) {
117-
this.speedBytesPerSecond = speedBytesPerSecond;
127+
public void setUnit(String unit) {
128+
this.unit = unit;
118129
}
119130

120131
public Long getEstimatedRemainingSeconds() {

0 commit comments

Comments
 (0)