Commit ff86a96a authored by 神楽坂玲奈's avatar 神楽坂玲奈

history

parent efa5609d
Pipeline #15931 passed with stages
in 25 seconds
......@@ -3,6 +3,7 @@
"server_port": 500,
"port": 495,
"timeout": 10,
"history": 100,
"interval": 1000,
"table": 1,
"proto": 250
......
......@@ -53,11 +53,11 @@ export class Peer implements PeerMessage, PeerQuality, RouterConfig {
this.history.push(undefined);
}
this.history.push(delay);
this.history.splice(0, this.history.length - config.timeout);
this.history.splice(0, this.history.length - config.history);
const history = this.history.filter(s => s !== undefined);
this.reliability = history.length / config.timeout;
this.reliability = history.length / config.history;
this.delay = _.mean(history) || 0;
this.seq = data.seq;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment