瀏覽代碼

Fix error value type and rename variable in EntranceNode class (#457)

master
mjaow Eric Zhao 5 年之前
父節點
當前提交
30907e4c9d
共有 1 個文件被更改,包括 7 次插入7 次删除
  1. +7
    -7
      sentinel-core/src/main/java/com/alibaba/csp/sentinel/node/EntranceNode.java

+ 7
- 7
sentinel-core/src/main/java/com/alibaba/csp/sentinel/node/EntranceNode.java 查看文件

@@ -44,18 +44,18 @@ public class EntranceNode extends DefaultNode {

@Override
public long avgRt() {
long rt = 0;
long total = 0;
long totalQps = 0;
for (Node node : getChildList()) {
rt += node.avgRt() * node.passQps();
total += node.avgRt() * node.passQps();
totalQps += node.passQps();
}
return rt / (totalQps == 0 ? 1 : totalQps);
return total / (totalQps == 0 ? 1 : totalQps);
}

@Override
public long blockQps() {
int blockQps = 0;
long blockQps = 0;
for (Node node : getChildList()) {
blockQps += node.blockQps();
}
@@ -82,7 +82,7 @@ public class EntranceNode extends DefaultNode {

@Override
public long totalQps() {
int r = 0;
long r = 0;
for (Node node : getChildList()) {
r += node.totalQps();
}
@@ -91,7 +91,7 @@ public class EntranceNode extends DefaultNode {

@Override
public long successQps() {
int r = 0;
long r = 0;
for (Node node : getChildList()) {
r += node.successQps();
}
@@ -100,7 +100,7 @@ public class EntranceNode extends DefaultNode {

@Override
public long passQps() {
int r = 0;
long r = 0;
for (Node node : getChildList()) {
r += node.passQps();
}


Loading…
取消
儲存