Skip to content

Commit

Permalink
[METRICS] rewrite NetworkMetrics by java 17 record (#1749)
Browse files Browse the repository at this point in the history
  • Loading branch information
chia7712 authored May 15, 2023
1 parent 63235ae commit 6fec319
Showing 1 changed file with 1 addition and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,27 +132,11 @@ public Histogram fetch(MBeanClient mBeanClient) {
return new Histogram(mBeanClient.bean(ALL.get(this)));
}

public static class Histogram implements HasHistogram {

private final BeanObject beanObject;

public Histogram(BeanObject beanObject) {
this.beanObject = beanObject;
}
public record Histogram(BeanObject beanObject) implements HasHistogram {

public Request type() {
return ofAlias(beanObject.properties().get("request"));
}

@Override
public String toString() {
return beanObject().toString();
}

@Override
public BeanObject beanObject() {
return beanObject;
}
}
}

Expand Down

0 comments on commit 6fec319

Please sign in to comment.