* Console:

- countries.txt: Convert to mixed case, include in update
      - netdb.jsp: Hide all routers by default, sort and tag country names
      - oldstats.jsp: Move to stats.jsp
      - profiles.jsp: Show new DBH times instead of counts
    * Profiles:
      - Track last good and bad lookup times
        and last good and bad store times,
        to prep for floodfill changes
      - Don't reset last-heard-about at router startup
    * Checklist and Android readme fixups
This commit is contained in:
zzz
2009-11-07 19:32:00 +00:00
parent 827a92ef2f
commit a0b4b7db86
18 changed files with 442 additions and 312 deletions

View File

@ -1,9 +1,13 @@
These instructions are for the 1.5 SDK.
These instructions are for the 1.5 Android SDK.
The build file is not compatible with the 1.1 SDK any more.
1.6 and 2.0 SDKs are untested.
#Unzip the android SDK in ../../
#So then the android tools will be in ../../android-sdk-linux_x86-1.5_r2/tools/
# create a file local.properties with the following line:
# sdk-location=/path/to/your/android-sdk-linux_x86-1.5_r2
#then build the android apk file:
ant debug

View File

@ -19,6 +19,20 @@ CLASS=net.i2p.router.web.messages
TMPFILE=build/javafiles.txt
export TZ=UTC
#
# generate strings/Countries.java from ../../../installer/resources/countries.txt
#
CFILE=../../../installer/resources/countries.txt
JFILE=build/Countries.java
if [ $CFILE -nt $JFILE -o ! -s $JFILE ]
then
mkdir -p build
echo '// Automatically generated pseudo-java for xgettext - do not edit' > $JFILE
echo '// Translators may wish to translate a few of these, do not bother to translate all of them!!' >> $JFILE
sed 's/..,\(..*\)/_("\1");/' $CFILE >> $JFILE
fi
JPATHS="src ../jsp/WEB-INF strings $JFILE"
for i in ../locale/messages_*.po
do
# get language
@ -26,7 +40,7 @@ do
LG=${LG%.po}
# make list of java files newer than the .po file
find src ../jsp/WEB-INF strings -name *.java -newer $i > $TMPFILE
find $JPATHS -name *.java -newer $i > $TMPFILE
if [ -s build/obj/net/i2p/router/web/messages_$LG.class -a \
build/obj/net/i2p/router/web/messages_$LG.class -nt $i -a \
! -s $TMPFILE ]
@ -48,7 +62,7 @@ do
# In a jsp, you must use a helper or handler that has the context set.
# To start a new translation, copy the header from an old translation to the new .po file,
# then ant distclean updater.
find src ../jsp/WEB-INF strings -name *.java > $TMPFILE
find $JPATHS -name *.java > $TMPFILE
xgettext -f $TMPFILE -F -L java --from-code=UTF-8 \
--keyword=_ --keyword=_x --keyword=intl._ --keyword=intl.title \
--keyword=handler._ --keyword=formhandler._ \

View File

@ -8,6 +8,20 @@ CLASS=net.i2p.router.web.messages
TMPFILE=build/javafiles.txt
export TZ=UTC
#
# generate strings/Countries.java from ../../../installer/resources/countries.txt
#
CFILE=../../../installer/resources/countries.txt
JFILE=build/Countries.java
if [ $CFILE -nt $JFILE -o ! -s $JFILE ]
then
mkdir -p build
echo '// Automatically generated pseudo-java for xgettext - do not edit' > $JFILE
echo '// Translators may wish to translate a few of these, do not bother to translate all of them!!' >> $JFILE
sed 's/..,\(..*\)/_("\1");/' $CFILE >> $JFILE
fi
JPATHS="src ../jsp/WEB-INF strings $JFILE"
for i in ../locale/messages_*.po
do
# get language
@ -15,7 +29,7 @@ do
LG=${LG%.po}
# make list of java files newer than the .po file
find src ../jsp/WEB-INF strings -name *.java -newer $i > $TMPFILE
find $JPATHS -name *.java -newer $i > $TMPFILE
if [ -s build/obj/net/i2p/router/web/messages_$LG.class -a \
build/obj/net/i2p/router/web/messages_$LG.class -nt $i -a \
! -s $TMPFILE ]
@ -37,7 +51,7 @@ do
# In a jsp, you must use a helper or handler that has the context set.
# To start a new translation, copy the header from an old translation to the new .po file,
# then ant distclean updater.
find src ../jsp/WEB-INF strings -name *.java > $TMPFILE
find $JPATHS -name *.java > $TMPFILE
xgettext -f $TMPFILE -F -L java --from-code=UTF-8 \
--keyword=_ --keyword=_x --keyword=intl._ --keyword=intl.title \
--keyword=handler._ --keyword=formhandler._ \

View File

@ -7,13 +7,17 @@ import java.io.OutputStreamWriter;
public class NetDbHelper extends HelperBase {
private String _routerPrefix;
private boolean _full = false;
private int _full;
private boolean _lease = false;
public NetDbHelper() {}
public void setRouter(String r) { _routerPrefix = r; }
public void setFull(String f) { _full = "1".equals(f); }
public void setFull(String f) {
try {
_full = Integer.parseInt(f);
} catch (NumberFormatException nfe) {}
}
public void setLease(String l) { _lease = "1".equals(l); }
public String getNetDbSummary() {

View File

@ -77,10 +77,6 @@ public class NetDbRenderer {
out.flush();
}
public void renderStatusHTML(Writer out) throws IOException {
renderStatusHTML(out, true);
}
public void renderLeaseSetHTML(Writer out) throws IOException {
StringBuilder buf = new StringBuilder(4*1024);
buf.append("<h2>" + _("Network Database Contents") + "</h2>\n");
@ -131,7 +127,10 @@ public class NetDbRenderer {
out.flush();
}
public void renderStatusHTML(Writer out, boolean full) throws IOException {
/**
* @param mode 0: our info and charts only; 1: full routerinfos and charts; 2: abbreviated routerinfos and charts
*/
public void renderStatusHTML(Writer out, int mode) throws IOException {
out.write("<h2>" + _("Network Database Contents") + " (<a href=\"netdb.jsp?l=1\">" + _("View LeaseSets") + "</a>)</h2>\n");
if (!_context.netDb().isInitialized()) {
out.write(_("Not initialized"));
@ -139,13 +138,16 @@ public class NetDbRenderer {
return;
}
boolean full = mode == 1;
boolean shortStats = mode == 2;
boolean showStats = full || shortStats;
Hash us = _context.routerHash();
out.write("<a name=\"routers\" ></a><h3>" + _("Routers") + " (<a href=\"netdb.jsp");
if (full)
out.write("#routers\" >" + _("view without"));
if (full || !showStats)
out.write("?f=2#routers\" >" + _("Show all routers"));
else
out.write("?f=1#routers\" >" + _("view with"));
out.write(' ' + _("stats") + "</a>)</h3>\n");
out.write("?f=1#routers\" >" + _("Show all routers with full stats"));
out.write("</a>)</h3>\n");
StringBuilder buf = new StringBuilder(8192);
RouterInfo ourInfo = _context.router().getRouterInfo();
@ -163,9 +165,11 @@ public class NetDbRenderer {
Hash key = ri.getIdentity().getHash();
boolean isUs = key.equals(us);
if (!isUs) {
renderRouterInfo(buf, ri, false, full);
out.write(buf.toString());
buf.setLength(0);
if (showStats) {
renderRouterInfo(buf, ri, false, full);
out.write(buf.toString());
buf.setLength(0);
}
String routerVersion = ri.getOption("router.version");
if (routerVersion != null)
versions.increment(routerVersion);
@ -194,14 +198,14 @@ public class NetDbRenderer {
List<String> countryList = new ArrayList(countries.objects());
if (countryList.size() > 0) {
Collections.sort(countryList);
Collections.sort(countryList, new CountryComparator());
buf.append("<table>\n");
buf.append("<tr><th align=\"left\">" + _("Country") + "</th><th>" + _("Count") + "</th></tr>\n");
for (String country : countryList) {
int num = countries.count(country);
buf.append("<tr><td><img height=\"11\" width=\"16\" alt=\"").append(country.toUpperCase()).append("\"");
buf.append(" src=\"/flags.jsp?c=").append(country).append("\"> ");
buf.append(_context.commSystem().getCountryName(country));
buf.append(_(_context.commSystem().getCountryName(country)));
buf.append("</td><td align=\"center\">").append(num).append("</td></tr>\n");
}
buf.append("</table>\n");
@ -211,6 +215,14 @@ public class NetDbRenderer {
out.flush();
}
/** sort by translated country name */
private class CountryComparator implements Comparator {
public int compare(Object l, Object r) {
return _(_context.commSystem().getCountryName((String)l))
.compareTo(_(_context.commSystem().getCountryName((String)r)));
}
}
/**
* Be careful to use stripHTML for any displayed routerInfo data
* to prevent vulnerabilities

View File

@ -171,28 +171,24 @@ class ProfileOrganizerRenderer {
buf.append("<h2>").append(_("Floodfill and Integrated Peers")).append("</h2>\n");
buf.append("<table>");
buf.append("<tr>");
buf.append("<th class=\"smallhead\">Peer</th>");
buf.append("<th class=\"smallhead\">Caps</th>");
buf.append("<th class=\"smallhead\">Integ. Value</th>");
buf.append("<th class=\"smallhead\">Last Heard About</th>");
buf.append("<th class=\"smallhead\">Last Heard From</th>");
// "<th class=\"smallhead\">Last Successful Send</th>" +
buf.append("<th class=\"smallhead\">Last Good Send</th>");
// "<th class=\"smallhead\">Last Failed Send</th>" +
buf.append("<th class=\"smallhead\">Last Bad Send</th>");
buf.append("<th class=\"smallhead\">10m Resp. Time</th>");
buf.append("<th class=\"smallhead\">1h Resp. Time</th>");
buf.append("<th class=\"smallhead\">1d Resp. Time</th>");
// "<th class=\"smallhead\">Successful Lookups</th>" +
buf.append("<th class=\"smallhead\">Good Lookups</th>");
// "<th>Failed Lookups</th>" +
buf.append("<th class=\"smallhead\">Bad Lookups</th>");
buf.append("<th class=\"smallhead\">New Stores</th>");
buf.append("<th class=\"smallhead\">Old Stores</th>");
buf.append("<th class=\"smallhead\">1h Fail Rate</th>");
buf.append("<th class=\"smallhead\">1d Fail Rate</th>");
buf.append("</tr>");
buf.append("<tr>");
buf.append("<th class=\"smallhead\">").append(_("Peer")).append("</th>");
buf.append("<th class=\"smallhead\">").append(_("Caps")).append("</th>");
buf.append("<th class=\"smallhead\">").append(_("Integ. Value")).append("</th>");
buf.append("<th class=\"smallhead\">").append(_("Last Heard About")).append("</th>");
buf.append("<th class=\"smallhead\">").append(_("Last Heard From")).append("</th>");
buf.append("<th class=\"smallhead\">").append(_("Last Good Send")).append("</th>");
buf.append("<th class=\"smallhead\">").append(_("Last Bad Send")).append("</th>");
buf.append("<th class=\"smallhead\">").append(_("10m Resp. Time")).append("</th>");
buf.append("<th class=\"smallhead\">").append(_("1h Resp. Time")).append("</th>");
buf.append("<th class=\"smallhead\">").append(_("1d Resp. Time")).append("</th>");
buf.append("<th class=\"smallhead\">").append(_("Last Good Lookup")).append("</th>");
buf.append("<th class=\"smallhead\">").append(_("Last Bad Lookup")).append("</th>");
buf.append("<th class=\"smallhead\">").append(_("Last Good Store")).append("</th>");
buf.append("<th class=\"smallhead\">").append(_("Last Bad Store")).append("</th>");
buf.append("<th class=\"smallhead\">").append(_("1h Fail Rate")).append("</th>");
buf.append("<th class=\"smallhead\">").append(_("1d Fail Rate")).append("</th>");
buf.append("</tr>");
for (Iterator iter = integratedPeers.iterator(); iter.hasNext();) {
PeerProfile prof = (PeerProfile)iter.next();
Hash peer = prof.getPeer();
@ -221,10 +217,14 @@ class ProfileOrganizerRenderer {
buf.append("<td align=\"right\">").append(avg(prof, 24*60*60*1000l)).append("</td>");
DBHistory dbh = prof.getDBHistory();
if (dbh != null) {
buf.append("<td align=\"right\">").append(dbh.getSuccessfulLookups()).append("</td>");
buf.append("<td align=\"right\">").append(dbh.getFailedLookups()).append("</td>");
buf.append("<td align=\"right\">").append(dbh.getUnpromptedDbStoreNew()).append("</td>");
buf.append("<td align=\"right\">").append(dbh.getUnpromptedDbStoreOld()).append("</td>");
time = now - dbh.getLastLookupSuccessful();
buf.append("<td align=\"right\">").append(DataHelper.formatDuration(time)).append("</td>");
time = now - dbh.getLastLookupFailed();
buf.append("<td align=\"right\">").append(DataHelper.formatDuration(time)).append("</td>");
time = now - dbh.getLastStoreSuccessful();
buf.append("<td align=\"right\">").append(DataHelper.formatDuration(time)).append("</td>");
time = now - dbh.getLastStoreFailed();
buf.append("<td align=\"right\">").append(DataHelper.formatDuration(time)).append("</td>");
buf.append("<td align=\"right\">").append(davg(dbh, 60*60*1000l)).append("</td>");
buf.append("<td align=\"right\">").append(davg(dbh, 24*60*60*1000l)).append("</td>");
} else {
@ -242,13 +242,13 @@ class ProfileOrganizerRenderer {
buf.append("<b>").append(_("Integration")).append(":</b> ").append(num(_organizer.getIntegrationThreshold()))
.append(" (").append(integrated).append(' ').append(_(" well integrated peers")).append(")</p>");
buf.append("<h3>").append(_("Definitions")).append(":</h3><ul>");
buf.append("<li><b>").append(_("groups")).append("</b>: ").append(_("as determined by the profile organizer")).append("</li>");
buf.append("<li><b>").append(_("caps")).append("</b>: ").append(_("capabilities in the netDb, not used to determine profiles")).append("</li>");
buf.append("<li><b>").append(_("speed")).append("</b>: ").append(_("peak throughput (bytes per second) over a 1 minute period that the peer has sustained in a single tunnel")).append("</li>");
buf.append("<li><b>").append(_("capacity")).append("</b>: ").append(_("how many tunnels can we ask them to join in an hour?")).append("</li>");
buf.append("<li><b>").append(_("integration")).append("</b>: ").append(_("how many new peers have they told us about lately?")).append("</li>");
buf.append("<li><b>").append(_("status")).append("</b>: ").append(_("is the peer banned, or unreachable, or failing tunnel tests?")).append("</li>");
buf.append("</ul></i>");
buf.append("<li><b>").append(_("groups")).append("</b>: ").append(_("as determined by the profile organizer")).append("</li>");
buf.append("<li><b>").append(_("caps")).append("</b>: ").append(_("capabilities in the netDb, not used to determine profiles")).append("</li>");
buf.append("<li><b>").append(_("speed")).append("</b>: ").append(_("peak throughput (bytes per second) over a 1 minute period that the peer has sustained in a single tunnel")).append("</li>");
buf.append("<li><b>").append(_("capacity")).append("</b>: ").append(_("how many tunnels can we ask them to join in an hour?")).append("</li>");
buf.append("<li><b>").append(_("integration")).append("</b>: ").append(_("how many new peers have they told us about lately?")).append("</li>");
buf.append("<li><b>").append(_("status")).append("</b>: ").append(_("is the peer banned, or unreachable, or failing tunnel tests?")).append("</li>");
buf.append("</ul></i>");
out.write(buf.toString());
out.flush();
}

View File

@ -29,7 +29,7 @@ public class StatsGenerator {
public void generateStatsPage(Writer out) throws IOException {
StringBuilder buf = new StringBuilder(16*1024);
buf.append("<div class=\"joblog\"><form action=\"/oldstats.jsp\">");
buf.append("<div class=\"joblog\"><form action=\"/stats.jsp\">");
buf.append("<select name=\"go\" onChange='location.href=this.value'>");
out.write(buf.toString());
buf.setLength(0);
@ -39,11 +39,11 @@ public class StatsGenerator {
Map.Entry entry = (Map.Entry)iter.next();
String group = (String)entry.getKey();
Set stats = (Set)entry.getValue();
buf.append("<option value=\"/oldstats.jsp#").append(group).append("\">");
buf.append("<option value=\"/stats.jsp#").append(group).append("\">");
buf.append(group).append("</option>\n");
for (Iterator statIter = stats.iterator(); statIter.hasNext(); ) {
String stat = (String)statIter.next();
buf.append("<option value=\"/oldstats.jsp#");
buf.append("<option value=\"/stats.jsp#");
buf.append(stat);
buf.append("\">...");
buf.append(stat);

View File

@ -118,7 +118,7 @@ public class SummaryBarRenderer {
.append(_("Graphs"))
.append("</a>\n" +
"<a href=\"oldstats.jsp\" target=\"_top\" title=\"")
"<a href=\"stats.jsp\" target=\"_top\" title=\"")
.append(_("Textual router performance statistics"))
.append("\">")
.append(_("Stats"))

View File

@ -410,6 +410,8 @@
<copy file="build/i2ptunnel.war" todir="pkg-temp/webapps/" />
<copy file="build/routerconsole.war" todir="pkg-temp/webapps/" />
<copy file="build/addressbook.war" todir="pkg-temp/webapps/" />
<!-- decapitalized the file in 0.7.8 -->
<copy file="installer/resources/countries.txt" todir="pkg-temp/geoip/" />
</target>
<target name="prepupdateRouter" depends="buildrouter, deletepkg-temp">
<copy file="build/i2p.jar" todir="pkg-temp/lib/" />

View File

@ -8,9 +8,9 @@ Deploy the Jetty archive, a clean checkout lacks it
Change revision in:
history.txt
initialNews.xml
installer/resources/initialNews.xml
installer/install.xml
news.xml
installer/resources/news.xml
router/java/src/net/i2p/router/RouterVersion.java
(change to BUILD = 0 and EXTRA = "")
core/java/src/net/i2p/CoreVersion.java
@ -23,6 +23,8 @@ Verify that no untrusted revisions were inadvertently
blessed by a trusted party:
mtn log --brief --no-graph --to t:i2p-0.7.(xx-1) | cut -d ' ' -f 2- | sort
NOTE: Most tasks below here are now automated by 'ant release'
Build and tag:
ant pkg
mtn ci
@ -60,16 +62,18 @@ Generate PGP signatures:
gpg -b i2pupdate-0.7.xx.zip
gpg -b i2pupdate.sud
(end of tasks automated by 'ant release')
Distribute files to download locations and to www.i2p2.i2p
Website files to change:
Sync with mtn.i2p2.i2p
announcements.html
announcements_de.html
download.html (change SHA256s)
download_de.html (change SHA256s)
announcements_*.html
download.html (change version numbers and SHA256s)
download_*.html (change version numbers and SHA256s)
index.html
index_de.html
index_*.html
hosts.txt (copy from mtn)
release-x.y.z.html (new)
Sync with mtn.i2p2.i2p

View File

@ -1,3 +1,16 @@
2009-11-08 zzz
* Console:
- countries.txt: Convert to mixed case, include in update
- netdb.jsp: Hide all routers by default, sort and tag country names
- oldstats.jsp: Move to stats.jsp
- profiles.jsp: Show new DBH times instead of counts
* Profiles:
- Track last good and bad lookup times
and last good and bad store times,
to prep for floodfill changes
- Don't reset last-heard-about at router startup
* Checklist and Android readme fixups
2009-11-04 zzz
* Build:
- Move some files to installer/resources

View File

@ -1,237 +1,237 @@
AD,ANDORRA
AE,UNITED ARAB EMIRATES
AF,AFGHANISTAN
AG,ANTIGUA AND BARBUDA
AI,ANGUILLA
AL,ALBANIA
AM,ARMENIA
AN,NETHERLANDS ANTILLES
AO,ANGOLA
AQ,ANTARCTICA
AR,ARGENTINA
AS,AMERICAN SAMOA
AT,AUSTRIA
AU,AUSTRALIA
AW,ARUBA
AD,Andorra
AE,United Arab Emirates
AF,Afghanistan
AG,Antigua and Barbuda
AI,Anguilla
AL,Albania
AM,Armenia
AN,Netherlands Antilles
AO,Angola
AQ,Antarctica
AR,Argentina
AS,American Samoa
AT,Austria
AU,Australia
AW,Aruba
AX,
AZ,AZERBAIJAN
BA,BOSNIA AND HERZEGOVINA
BB,BARBADOS
BD,BANGLADESH
BE,BELGIUM
BF,BURKINA FASO
BG,BULGARIA
BH,BAHRAIN
BI,BURUNDI
BJ,BENIN
BM,BERMUDA
BN,BRUNEI DARUSSALAM
BO,BOLIVIA
BR,BRAZIL
BS,BAHAMAS
BT,BHUTAN
BV,BOUVET ISLAND
BW,BOTSWANA
BY,BELARUS
BZ,BELIZE
CA,CANADA
CD,THE DEMOCRATIC REPUBLIC OF THE CONGO
CF,CENTRAL AFRICAN REPUBLIC
CG,CONGO
CH,SWITZERLAND
CI,COTE D'IVOIRE
CK,COOK ISLANDS
CL,CHILE
CM,CAMEROON
CN,CHINA
CO,COLOMBIA
CR,COSTA RICA
CS,SERBIA AND MONTENEGRO
CU,CUBA
CV,CAPE VERDE
CY,CYPRUS
CZ,CZECH REPUBLIC
DE,GERMANY
DJ,DJIBOUTI
DK,DENMARK
DM,DOMINICA
DO,DOMINICAN REPUBLIC
DZ,ALGERIA
EC,ECUADOR
EE,ESTONIA
EG,EGYPT
ER,ERITREA
ES,SPAIN
ET,ETHIOPIA
FI,FINLAND
FJ,FIJI
FK,FALKLAND ISLANDS (MALVINAS)
FM,FEDERATED STATES OF MICRONESIA
FO,FAROE ISLANDS
FR,FRANCE
GA,GABON
GB,UNITED KINGDOM
GD,GRENADA
GE,GEORGIA
GF,FRENCH GUIANA
GH,GHANA
GI,GIBRALTAR
GL,GREENLAND
GM,GAMBIA
GN,GUINEA
GP,GUADELOUPE
GQ,EQUATORIAL GUINEA
GR,GREECE
GS,SOUTH GEORGIA AND THE SOUTH SANDWICH ISLANDS
GT,GUATEMALA
GU,GUAM
GW,GUINEA-BISSAU
GY,GUYANA
HK,HONG KONG
HN,HONDURAS
HR,CROATIA
HT,HAITI
HU,HUNGARY
ID,INDONESIA
IE,IRELAND
IL,ISRAEL
AZ,Azerbaijan
BA,Bosnia and Herzegovina
BB,Barbados
BD,Bangladesh
BE,Belgium
BF,Burkina Faso
BG,Bulgaria
BH,Bahrain
BI,Burundi
BJ,Benin
BM,Bermuda
BN,Brunei Darussalam
BO,Bolivia
BR,Brazil
BS,Bahamas
BT,Bhutan
BV,Bouvet Island
BW,Botswana
BY,Belarus
BZ,Belize
CA,Canada
CD,The Democratic Republic of the Congo
CF,Central African Republic
CG,Congo
CH,Switzerland
CI,Cote D'Ivoire
CK,Cook Islands
CL,Chile
CM,Cameroon
CN,China
CO,Colombia
CR,Costa Rica
CS,Serbia and Montenegro
CU,Cuba
CV,Cape Verde
CY,Cyprus
CZ,Czech Republic
DE,Germany
DJ,Djibouti
DK,Denmark
DM,Dominica
DO,Dominican Republic
DZ,Algeria
EC,Ecuador
EE,Estonia
EG,Egypt
ER,Eritrea
ES,Spain
ET,Ethiopia
FI,Finland
FJ,Fiji
FK,Falkland Islands (Malvinas)
FM,Federated States of Micronesia
FO,Faroe Islands
FR,France
GA,Gabon
GB,United Kingdom
GD,Grenada
GE,Georgia
GF,French Guiana
GH,Ghana
GI,Gibraltar
GL,Greenland
GM,Gambia
GN,Guinea
GP,Guadeloupe
GQ,Equatorial Guinea
GR,Greece
GS,South Georgia and the South Sandwich Islands
GT,Guatemala
GU,Guam
GW,Guinea-Bissau
GY,Guyana
HK,Hong Kong
HN,Honduras
HR,Croatia
HT,Haiti
HU,Hungary
ID,Indonesia
IE,Ireland
IL,Israel
IM,
IN,INDIA
IO,BRITISH INDIAN OCEAN TERRITORY
IQ,IRAQ
IR,ISLAMIC REPUBLIC OF IRAN
IS,ICELAND
IT,ITALY
IN,India
IO,British Indian Ocean Territory
IQ,Iraq
IR,Islamic Republic of Iran
IS,Iceland
IT,Italy
JE,
JM,JAMAICA
JO,JORDAN
JP,JAPAN
KE,KENYA
KG,KYRGYZSTAN
KH,CAMBODIA
KI,KIRIBATI
KM,COMOROS
KN,SAINT KITTS AND NEVIS
KR,REPUBLIC OF KOREA
KW,KUWAIT
KY,CAYMAN ISLANDS
KZ,KAZAKHSTAN
LA,LAO PEOPLE'S DEMOCRATIC REPUBLIC
LB,LEBANON
LC,SAINT LUCIA
LI,LIECHTENSTEIN
LK,SRI LANKA
LR,LIBERIA
LS,LESOTHO
LT,LITHUANIA
LU,LUXEMBOURG
LV,LATVIA
LY,LIBYAN ARAB JAMAHIRIYA
MA,MOROCCO
MC,MONACO
MD,REPUBLIC OF MOLDOVA
JM,Jamaica
JO,Jordan
JP,Japan
KE,Kenya
KG,Kyrgyzstan
KH,Cambodia
KI,Kiribati
KM,Comoros
KN,Saint Kitts and Nevis
KR,Republic of Korea
KW,Kuwait
KY,Cayman Islands
KZ,Kazakhstan
LA,Lao People'S Democratic Republic
LB,Lebanon
LC,Saint Lucia
LI,Liechtenstein
LK,Sri Lanka
LR,Liberia
LS,Lesotho
LT,Lithuania
LU,Luxembourg
LV,Latvia
LY,Libyan Arab Jamahiriya
MA,Morocco
MC,Monaco
MD,Republic of Moldova
ME,
MF,
MG,MADAGASCAR
MH,MARSHALL ISLANDS
MK,THE FORMER YUGOSLAV REPUBLIC OF MACEDONIA
ML,MALI
MM,MYANMAR
MN,MONGOLIA
MO,MACAO
MP,NORTHERN MARIANA ISLANDS
MQ,MARTINIQUE
MR,MAURITANIA
MS,MONTSERRAT
MT,MALTA
MU,MAURITIUS
MV,MALDIVES
MW,MALAWI
MX,MEXICO
MY,MALAYSIA
MZ,MOZAMBIQUE
NA,NAMIBIA
NC,NEW CALEDONIA
NE,NIGER
NF,NORFOLK ISLAND
NG,NIGERIA
NI,NICARAGUA
NL,NETHERLANDS
NO,NORWAY
NP,NEPAL
NR,NAURU
NU,NIUE
NZ,NEW ZEALAND
OM,OMAN
PA,PANAMA
PE,PERU
PF,FRENCH POLYNESIA
PG,PAPUA NEW GUINEA
PH,PHILIPPINES
PK,PAKISTAN
PL,POLAND
PM,SAINT PIERRE AND MIQUELON
PR,PUERTO RICO
PS,PALESTINIAN TERRITORY
PT,PORTUGAL
PW,PALAU
PY,PARAGUAY
QA,QATAR
RE,REUNION
RO,ROMANIA
RS,SERBIA
RU,RUSSIAN FEDERATION
RW,RWANDA
SA,SAUDI ARABIA
SB,SOLOMON ISLANDS
SC,SEYCHELLES
SD,SUDAN
SE,SWEDEN
SG,SINGAPORE
SI,SLOVENIA
SK,SLOVAKIA
SL,SIERRA LEONE
SM,SAN MARINO
SN,SENEGAL
SO,SOMALIA
SR,SURINAME
ST,SAO TOME AND PRINCIPE
SV,EL SALVADOR
SY,SYRIAN ARAB REPUBLIC
SZ,SWAZILAND
TC,TURKS AND CAICOS ISLANDS
TD,CHAD
TF,FRENCH SOUTHERN TERRITORIES
TG,TOGO
TH,THAILAND
TJ,TAJIKISTAN
TK,TOKELAU
TL,TIMOR-LESTE
TM,TURKMENISTAN
TN,TUNISIA
TO,TONGA
TR,TURKEY
TT,TRINIDAD AND TOBAGO
TV,TUVALU
TW,TAIWAN
TZ,UNITED REPUBLIC OF TANZANIA
UA,UKRAINE
UG,UGANDA
UM,UNITED STATES MINOR OUTLYING ISLANDS
US,UNITED STATES
UY,URUGUAY
UZ,UZBEKISTAN
VA,HOLY SEE (VATICAN CITY STATE)
VC,SAINT VINCENT AND THE GRENADINES
VE,VENEZUELA
VG,VIRGIN ISLANDS
VI,VIRGIN ISLANDS
VN,VIET NAM
VU,VANUATU
WF,WALLIS AND FUTUNA
WS,SAMOA
YE,YEMEN
YT,MAYOTTE
ZA,SOUTH AFRICA
ZM,ZAMBIA
ZW,ZIMBABWE
MG,Madagascar
MH,Marshall Islands
MK,The Former Yugoslav Republic of Macedonia
ML,Mali
MM,Myanmar
MN,Mongolia
MO,Macao
MP,Northern Mariana Islands
MQ,Martinique
MR,Mauritania
MS,Montserrat
MT,Malta
MU,Mauritius
MV,Maldives
MW,Malawi
MX,Mexico
MY,Malaysia
MZ,Mozambique
NA,Namibia
NC,New Caledonia
NE,Niger
NF,Norfolk Island
NG,Nigeria
NI,Nicaragua
NL,Netherlands
NO,Norway
NP,Nepal
NR,Nauru
NU,Niue
NZ,New Zealand
OM,Oman
PA,Panama
PE,Peru
PF,French Polynesia
PG,Papua New Guinea
PH,Philippines
PK,Pakistan
PL,Poland
PM,Saint Pierre and Miquelon
PR,Puerto Rico
PS,Palestinian Territory
PT,Portugal
PW,Palau
PY,Paraguay
QA,Qatar
RE,Reunion
RO,Romania
RS,Serbia
RU,Russian Federation
RW,Rwanda
SA,Saudi Arabia
SB,Solomon Islands
SC,Seychelles
SD,Sudan
SE,Sweden
SG,Singapore
SI,Slovenia
SK,Slovakia
SL,Sierra Leone
SM,San Marino
SN,Senegal
SO,Somalia
SR,Suriname
ST,Sao Tome and Principe
SV,El Salvador
SY,Syrian Arab Republic
SZ,Swaziland
TC,Turks and Caicos Islands
TD,Chad
TF,French Southern Territories
TG,Togo
TH,Thailand
TJ,Tajikistan
TK,Tokelau
TL,Timor-Leste
TM,Turkmenistan
TN,Tunisia
TO,Tonga
TR,Turkey
TT,Trinidad and Tobago
TV,Tuvalu
TW,Taiwan
TZ,United Republic of Tanzania
UA,Ukraine
UG,Uganda
UM,United States Minor Outlying Islands
US,United States
UY,Uruguay
UZ,Uzbekistan
VA,Holy See (Vatican City State)
VC,Saint Vincent and the Grenadines
VE,Venezuela
VG,Virgin Islands
VI,Virgin Islands
VN,Viet Nam
VU,Vanuatu
WF,Wallis and Futuna
WS,Samoa
YE,Yemen
YT,Mayotte
ZA,South Africa
ZM,Zambia
ZW,Zimbabwe

View File

@ -18,7 +18,7 @@ public class RouterVersion {
/** deprecated */
public final static String ID = "Monotone";
public final static String VERSION = CoreVersion.VERSION;
public final static long BUILD = 12;
public final static long BUILD = 13;
/** for example "-test" */
public final static String EXTRA = "";
public final static String FULL_VERSION = VERSION + "-" + BUILD + EXTRA;

View File

@ -90,7 +90,9 @@ class TransientDataStore implements DataStore {
DataStructure old = null;
old = _data.put(key, data);
if (data instanceof RouterInfo) {
_context.profileManager().heardAbout(key);
// Don't do this here so we don't reset it at router startup;
// the StoreMessageJob calls this
//_context.profileManager().heardAbout(key);
RouterInfo ri = (RouterInfo)data;
if (old != null) {
RouterInfo ori = (RouterInfo)old;

View File

@ -26,6 +26,10 @@ public class DBHistory {
private long _lookupsReceived;
private long _avgDelayBetweenLookupsReceived;
private long _lastLookupReceived;
private long _lastLookupSuccessful;
private long _lastLookupFailed;
private long _lastStoreSuccessful;
private long _lastStoreFailed;
private long _unpromptedDbStoreNew;
private long _unpromptedDbStoreOld;
private String _statGroup;
@ -50,24 +54,47 @@ public class DBHistory {
createRates(statGroup);
}
/** how many times we have sent them a db lookup and received the value back from them */
/** how many times we have sent them a db lookup and received the value back from them
* @deprecated unused
*/
public long getSuccessfulLookups() { return _successfulLookups; }
/** how many times we have sent them a db lookup and not received the value or a lookup reply */
/** how many times we have sent them a db lookup and not received the value or a lookup reply
* @deprecated unused
*/
public long getFailedLookups() { return _failedLookups; }
/** how many peers that we have never seen before did lookups provide us with? */
/** how many peers that we have never seen before did lookups provide us with?
* @deprecated unused
*/
public long getLookupReplyNew() { return _lookupReplyNew; }
/** how many peers that we have already seen did lookups provide us with? */
/** how many peers that we have already seen did lookups provide us with?
* @deprecated unused
*/
public long getLookupReplyOld() { return _lookupReplyOld; }
/** how many peers that we explicitly asked the peer not to send us did they reply with? */
/** how many peers that we explicitly asked the peer not to send us did they reply with?
* @deprecated unused
*/
public long getLookupReplyDuplicate() { return _lookupReplyDuplicate; }
/** how many peers that were incorrectly formatted / expired / otherwise illegal did lookups provide us with? */
/** how many peers that were incorrectly formatted / expired / otherwise illegal did lookups provide us with?
* @deprecated unused
*/
public long getLookupReplyInvalid() { return _lookupReplyInvalid; }
/** how many lookups this peer has sent us? */
/** how many lookups this peer has sent us?
* @deprecated unused
*/
public long getLookupsReceived() { return _lookupsReceived; }
/** how frequently do they send us lookup requests? */
/** how frequently do they send us lookup requests?
* @deprecated unused
*/
public long getAvgDelayBetweenLookupsReceived() { return _avgDelayBetweenLookupsReceived; }
/** when did they last send us a request? */
/** when did they last send us a request?
* @deprecated unused
*/
public long getLastLookupReceived() { return _lastLookupReceived; }
public long getLastLookupSuccessful() { return _lastLookupSuccessful; }
public long getLastLookupFailed() { return _lastLookupFailed; }
public long getLastStoreSuccessful() { return _lastStoreSuccessful; }
public long getLastStoreFailed() { return _lastStoreFailed; }
/** how many times have they sent us data we didn't ask for and that we've never seen? */
public long getUnpromptedDbStoreNew() { return _unpromptedDbStoreNew; }
/** how many times have they sent us data we didn't ask for but that we have seen? */
@ -87,14 +114,37 @@ public class DBHistory {
*/
public void lookupSuccessful() {
_successfulLookups++;
_lastLookupSuccessful = _context.clock().now();
}
/**
* Note that the peer failed to respond to the db lookup in any way
*/
public void lookupFailed() {
_failedLookups++;
_failedLookupRate.addData(1, 0);
_lastLookupFailed = _context.clock().now();
}
/**
* Note that we successfully stored to a floodfill peer and verified the result
* by asking another floodfill peer
*
*/
public void storeSuccessful() {
_lastStoreSuccessful = _context.clock().now();
}
/**
* Note that floodfill verify failed
*/
public void storeFailed() {
// Fixme, redefined this to include both lookup and store fails,
// need to fix the javadocs
_failedLookupRate.addData(1, 0);
_lastStoreFailed = _context.clock().now();
}
/**
* Receive a lookup reply from the peer, where they gave us the specified info
*
@ -186,7 +236,7 @@ public class DBHistory {
_invalidReplyRate.store(out, "dbHistory.invalidReplyRate");
}
private void add(StringBuilder buf, String name, long val, String description) {
private static void add(StringBuilder buf, String name, long val, String description) {
buf.append("# ").append(name.toUpperCase()).append(NL).append("# ").append(description).append(NL);
buf.append("dbHistory.").append(name).append('=').append(val).append(NL).append(NL);
}
@ -224,8 +274,8 @@ public class DBHistory {
_failedLookupRate = new RateStat("dbHistory.failedLookupRate", "How often does this peer to respond to a lookup?", statGroup, new long[] { 60*1000l, 60*60*1000l, 24*60*60*1000l });
if (_invalidReplyRate == null)
_invalidReplyRate = new RateStat("dbHistory.invalidReplyRate", "How often does this peer give us a bad (nonexistant, forged, etc) peer?", statGroup, new long[] { 30*60*1000l, 60*60*1000l, 24*60*60*1000l });
_failedLookupRate.setStatLog(_context.statManager().getStatLog());
_invalidReplyRate.setStatLog(_context.statManager().getStatLog());
_failedLookupRate.setStatLog(_context.statManager().getStatLog());
_invalidReplyRate.setStatLog(_context.statManager().getStatLog());
}
private final static long getLong(Properties props, String key) {

View File

@ -249,15 +249,18 @@ public class ProfileManagerImpl implements ProfileManager {
* Note that we've confirmed a successful send of db data to the peer (though we haven't
* necessarily requested it again from them, so they /might/ be lying)
*
* This will force creation of DB stats
*/
public void dbStoreSent(Hash peer, long responseTimeMs) {
PeerProfile data = getProfile(peer);
if (data == null) return;
long now = _context.clock().now();
data.setLastHeardFrom(now);
if (!data.getIsExpandedDB())
return;
data.setLastSendSuccessful(now);
if (!data.getIsExpandedDB())
data.expandDBProfile();
DBHistory hist = data.getDBHistory();
hist.storeSuccessful();
// we could do things like update some sort of "how many successful stores we've sent them"...
// naah.. dont really care now
}
@ -266,8 +269,15 @@ public class ProfileManagerImpl implements ProfileManager {
* Note that we were unable to confirm a successful send of db data to
* the peer, at least not within our timeout period
*
* This will force creation of DB stats
*/
public void dbStoreFailed(Hash peer) {
PeerProfile data = getProfile(peer);
if (data == null) return;
if (!data.getIsExpandedDB())
data.expandDBProfile();
DBHistory hist = data.getDBHistory();
hist.storeSuccessful();
// we could do things like update some sort of "how many successful stores we've
// failed to send them"...
}

View File

@ -329,6 +329,7 @@ class BuildHandler {
}
}
/** @return handle time or -1 */
private long handleRequest(BuildMessageState state) {
long timeSinceReceived = System.currentTimeMillis()-state.recvTime;
if (_log.shouldLog(Log.DEBUG))