forked from I2P_Developers/i2p.i2p
Add another CoreVersion field specifically for StatisticsManager (ticket #2729)
This commit is contained in:
@ -10,7 +10,9 @@ package net.i2p;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Expose a version string
|
||||
* Expose a version string.
|
||||
*
|
||||
* See also: RouterVersion, VersionComparator, and the update subsystem.
|
||||
*
|
||||
*/
|
||||
public class CoreVersion {
|
||||
@ -18,7 +20,28 @@ public class CoreVersion {
|
||||
/** deprecated */
|
||||
public final static String ID = "Monotone";
|
||||
|
||||
public final static String VERSION = "0.9.45";
|
||||
/**
|
||||
* The version published in the netdb via StatisticsManager.
|
||||
* If we ever need a point release for a specific
|
||||
* architecture only, append ".1" to VERSION
|
||||
* and leave PUBLISHED_VERSION unchanged.
|
||||
* Otherwise, the same as VERSION.
|
||||
* RouterVersion.FULL_VERSION is suggested for display to the user.
|
||||
*
|
||||
* @since 0.9.46
|
||||
*/
|
||||
public final static String PUBLISHED_VERSION = "0.9.45";
|
||||
|
||||
/**
|
||||
* The version used when checking for router updates,
|
||||
* and exchanged between router and client over I2CP.
|
||||
* If we ever need a point release for a specific
|
||||
* architecture only, append ".1" to VERSION
|
||||
* and leave PUBLISHED_VERSION unchanged.
|
||||
* Otherwise, the same as PUBLISHED_VERSION.
|
||||
* RouterVersion.FULL_VERSION is suggested for display to the user.
|
||||
*/
|
||||
public final static String VERSION = PUBLISHED_VERSION;
|
||||
|
||||
/**
|
||||
* For Vuze.
|
||||
|
@ -70,38 +70,10 @@ public class StatisticsManager {
|
||||
*/
|
||||
public Properties publishStatistics(Hash h) {
|
||||
Properties stats = new Properties();
|
||||
stats.setProperty("router.version", RouterVersion.VERSION);
|
||||
// never used
|
||||
//stats.setProperty("coreVersion", CoreVersion.VERSION);
|
||||
stats.setProperty("router.version", CoreVersion.PUBLISHED_VERSION);
|
||||
stats.setProperty(RouterInfo.PROP_NETWORK_ID, _networkID);
|
||||
stats.setProperty(RouterInfo.PROP_CAPABILITIES, _context.router().getCapabilities());
|
||||
|
||||
// No longer expose, to make build tracking more expensive
|
||||
// stats.setProperty("router.id", RouterVersion.ID);
|
||||
// stats.setProperty("core.id", CoreVersion.ID);
|
||||
|
||||
/***
|
||||
int newlines = 0;
|
||||
FileInputStream in = null;
|
||||
try {
|
||||
in = new FileInputStream(Router.IDENTLOG);
|
||||
int c = -1;
|
||||
// perhaps later filter this to only include ident changes this
|
||||
// day/week/month
|
||||
while ( (c = in.read()) != -1) {
|
||||
if (c == '\n')
|
||||
newlines++;
|
||||
}
|
||||
} catch (IOException ioe) {
|
||||
// ignore
|
||||
} finally {
|
||||
if (in != null)
|
||||
try { in.close(); } catch (IOException ioe) {}
|
||||
}
|
||||
if (newlines > 0)
|
||||
stats.setProperty("stat_identities", newlines+"");
|
||||
***/
|
||||
|
||||
if (_context.getBooleanPropertyDefaultTrue(PROP_PUBLISH_RANKINGS) &&
|
||||
_context.random().nextInt(RANDOM_INCLUDE_STATS) == 0) {
|
||||
//long publishedUptime = _context.router().getUptime();
|
||||
|
Reference in New Issue
Block a user