I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Unverified Commit 37beb532 authored by zzz's avatar zzz
Browse files

Profiles: Remove 30m tunnel history rates

to save a large amount of space.
30m rates were almost always within 10% of the 60m rates,
so we clearly don't need both.
Keep 60m because that's what we publish in the netdb.
Adjust rate weighting in CapacityCalculator accordingly.
parent 019a8b66
No related branches found
No related tags found
No related merge requests found
......@@ -192,12 +192,12 @@ class ProfileOrganizerRenderer {
ok = false;
}
RateAverages ra = RateAverages.getTemp();
Rate failed = prof.getTunnelHistory().getFailedRate().getRate(30*60*1000);
Rate failed = prof.getTunnelHistory().getFailedRate().getRate(60*60*1000);
long fails = failed.computeAverages(ra, false).getTotalEventCount();
if (ok && fails == 0) {
buf.append(_t("OK"));
} else if (fails > 0) {
Rate accepted = prof.getTunnelCreateResponseTime().getRate(30*60*1000);
Rate accepted = prof.getTunnelCreateResponseTime().getRate(60*60*1000);
long total = fails + accepted.computeAverages(ra, false).getTotalEventCount();
if (total / fails <= 10) // hide if < 10%
buf.append(' ').append(fails).append('/').append(total).append(' ').append(_t("Test Fails"));
......
......@@ -49,7 +49,6 @@ class CapacityCalculator {
if (capacity10m <= 0) {
capacity = 0;
} else {
double capacity30m = estimateCapacity(acceptStat, rejectStat, failedStat, 30*60*1000);
double capacity60m = estimateCapacity(acceptStat, rejectStat, failedStat, 60*60*1000);
double capacity1d = estimateCapacity(acceptStat, rejectStat, failedStat, 24*60*60*1000);
......@@ -62,10 +61,9 @@ class CapacityCalculator {
capacity10m /= 4;
}
capacity = capacity10m * periodWeight(10*60*1000) +
capacity30m * periodWeight(30*60*1000) +
capacity60m * periodWeight(60*60*1000) +
capacity1d * periodWeight(24*60*60*1000);
capacity = capacity10m * 0.4 +
capacity60m * 0.5 +
capacity1d * 0.1;
}
}
......@@ -182,14 +180,4 @@ class CapacityCalculator {
return 0.0d;
}
}
private static double periodWeight(int period) {
switch (period) {
case 10*60*1000: return .4;
case 30*60*1000: return .3;
case 60*60*1000: return .2;
case 24*60*60*1000: return .1;
default: throw new IllegalArgumentException("undefined period passed, period [" + period + "]???");
}
}
}
......@@ -29,7 +29,7 @@ public class TunnelHistory {
private final RateStat _rejectRate;
private final RateStat _failRate;
private final String _statGroup;
static final long[] RATES = new long[] { 10*60*1000l, 30*60*1000l, 60*60*1000l, 24*60*60*1000l };
static final long[] RATES = new long[] { 10*60*1000l, 60*60*1000l, 24*60*60*1000l };
/** probabalistic tunnel rejection due to a flood of requests - infrequent */
public static final int TUNNEL_REJECT_PROBABALISTIC_REJECT = 10;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment