Skip to content
This repository was archived by the owner on May 4, 2019. It is now read-only.

Commit a7786d8

Browse files
committed
experiment
1 parent c146efa commit a7786d8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

proteus-client/src/main/java/io/netifi/proteus/rsocket/WeightedReconnectingRSocket.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,7 @@ private synchronized long instantaneous(long now) {
483483
private synchronized long start() {
484484
long now = Clock.now();
485485
pending += 1;
486+
stamp = now;
486487
return now;
487488
}
488489

@@ -542,6 +543,11 @@ public long lastTimeUsedMillis() {
542543
public double availability() {
543544
if (Clock.now() - stamp > tau) {
544545
recordError(1.0);
546+
double m = interArrivalTime.value();
547+
if (m > 0) {
548+
m *= 0.5;
549+
record(m);
550+
}
545551
}
546552
return availability * errorPercentage.value();
547553
}

0 commit comments

Comments
 (0)