Skip to content

Commit

Permalink
fix: resource output json error (#5160)
Browse files Browse the repository at this point in the history
Co-authored-by: west <[email protected]>
  • Loading branch information
cwmore and WestEnlarged authored Aug 23, 2024
1 parent 074ae7e commit 0d1c3f8
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public int compare(Resource r) {

@Override
public String toJson() {
return String.format(" \"cpu\":%s ", cores);
return String.format(" {\"cpu\":%s} ", cores);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public String toJson() {
public String toString() {
return String.format(
"Number of instances(实例数):%d,(RAM)内存:%s ,cpu: %s",
this.getInstances(), this.getMemory(), this.getCores());
this.getInstances(), ByteTimeUtils.bytesToString(this.getMemory()), this.getCores());
}

public long getMemory() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public int compare(Resource r) {
@Override
public String toJson() {
return String.format(
"{\"memory\":%s,\"cpu\":%d}", ByteTimeUtils.bytesToString(this.memory), this.cores);
"{\"memory\":\"%s\",\"cpu\":%d}", ByteTimeUtils.bytesToString(this.memory), this.cores);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public boolean equalsTo(Resource resource) {

@Override
public String toJson() {
return " \"memory\":\"" + ByteTimeUtils.bytesToString(memory) + " ";
return " {\"memory\":\"" + ByteTimeUtils.bytesToString(memory) + "\"} ";
}

@Override
Expand Down

0 comments on commit 0d1c3f8

Please sign in to comment.