MCPcopy Create free account
hub / github.com/e2wugui/zeze / report

Method report

ZezeJava/ZezeJava/src/main/java/Zeze/Arch/LoadBase.java:113–140  ·  view source on GitHub ↗
(int overload, int online, int onlineNew)

Source from the content-addressed store, hash-verified

111 }
112
113 public void report(int overload, int online, int onlineNew) {
114 var load = new BLoad.Data();
115
116 load.setOverload(overload);
117 load.setOnline(online);
118 load.setProposeMaxOnline(getLoadConfig().getProposeMaxOnline());
119 load.setOnlineNew(onlineNew);
120 load.setMaxOnlineNew(getLoadConfig().getMaxOnlineNew());
121 var bb = ByteBuffer.Allocate(256);
122 load.encode(bb);
123
124 // 下面两个报告原则上可以只报告一个。
125 // 当启用LoginQueue,原来的load报告可以去掉了。
126 // 为了兼容,先保留。
127
128 // 向ServiceManager报告load
129 var loadServer = new BServerLoad();
130 loadServer.ip = getServiceIp();
131 loadServer.port = getServicePort();
132 loadServer.param = new Binary(bb);
133
134 //noinspection DataFlowIssue
135 this.zeze.getServiceManager().setServerLoad(loadServer);
136
137 // 向LoginQueueServer报告load。
138 if (loginQueueAgent != null)
139 reportLoginQueueLoad(loginQueueAgent, load);
140 }
141
142 // LinkdLoad 需要重载。
143 protected void reportLoginQueueLoad(LoginQueueAgent loginQueueAgent, BLoad.Data load) {

Callers 1

onTimerTaskMethod · 0.95

Calls 15

setOverloadMethod · 0.95
setOnlineMethod · 0.95
setProposeMaxOnlineMethod · 0.95
getLoadConfigMethod · 0.95
setOnlineNewMethod · 0.95
setMaxOnlineNewMethod · 0.95
AllocateMethod · 0.95
encodeMethod · 0.95
getServiceIpMethod · 0.95
getServicePortMethod · 0.95
reportLoginQueueLoadMethod · 0.95
getProposeMaxOnlineMethod · 0.65

Tested by

no test coverage detected