see how that looks
(shendaras)
This commit is contained in:
@ -26,56 +26,56 @@ public class ClientConfig {
|
|||||||
private int _averagePeriods[];
|
private int _averagePeriods[];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ClientConfig#load
|
* @seeRoutine ClientConfig#load
|
||||||
* @see ClientConfig#store
|
* @seeRoutine ClientConfig#store
|
||||||
*/
|
*/
|
||||||
public static final String PROP_PREFIX = "peer.";
|
public static final String PROP_PREFIX = "peer.";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ClientConfig#load
|
* @seeRoutine ClientConfig#load
|
||||||
* @see ClientConfig#store
|
* @seeRoutine ClientConfig#store
|
||||||
*/
|
*/
|
||||||
public static final String PROP_PEER = ".peer";
|
public static final String PROP_PEER = ".peer";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ClientConfig#load
|
* @seeRoutine ClientConfig#load
|
||||||
* @see ClientConfig#store
|
* @seeRoutine ClientConfig#store
|
||||||
*/
|
*/
|
||||||
public static final String PROP_STATFILE = ".statFile";
|
public static final String PROP_STATFILE = ".statFile";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ClientConfig#load
|
* @seeRoutine ClientConfig#load
|
||||||
* @see ClientConfig#store
|
* @seeRoutine ClientConfig#store
|
||||||
*/
|
*/
|
||||||
public static final String PROP_STATDURATION = ".statDuration";
|
public static final String PROP_STATDURATION = ".statDuration";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ClientConfig#load
|
* @seeRoutine ClientConfig#load
|
||||||
* @see ClientConfig#store
|
* @seeRoutine ClientConfig#store
|
||||||
*/
|
*/
|
||||||
public static final String PROP_STATFREQUENCY = ".statFrequency";
|
public static final String PROP_STATFREQUENCY = ".statFrequency";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ClientConfig#load
|
* @seeRoutine ClientConfig#load
|
||||||
* @see ClientConfig#store
|
* @seeRoutine ClientConfig#store
|
||||||
*/
|
*/
|
||||||
public static final String PROP_SENDFREQUENCY = ".sendFrequency";
|
public static final String PROP_SENDFREQUENCY = ".sendFrequency";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ClientConfig#load
|
* @seeRoutine ClientConfig#load
|
||||||
* @see ClientConfig#store
|
* @seeRoutine ClientConfig#store
|
||||||
*/
|
*/
|
||||||
public static final String PROP_SENDSIZE = ".sendSize";
|
public static final String PROP_SENDSIZE = ".sendSize";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ClientConfig#load
|
* @seeRoutine ClientConfig#load
|
||||||
* @see ClientConfig#store
|
* @seeRoutine ClientConfig#store
|
||||||
*/
|
*/
|
||||||
public static final String PROP_COMMENT = ".comment";
|
public static final String PROP_COMMENT = ".comment";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ClientConfig#load
|
* @seeRoutine ClientConfig#load
|
||||||
* @see ClientConfig#store
|
* @seeRoutine ClientConfig#store
|
||||||
*/
|
*/
|
||||||
public static final String PROP_AVERAGEPERIODS = ".averagePeriods";
|
public static final String PROP_AVERAGEPERIODS = ".averagePeriods";
|
||||||
|
|
||||||
@ -89,7 +89,6 @@ public class ClientConfig {
|
|||||||
/**
|
/**
|
||||||
* @param peer who we will test against
|
* @param peer who we will test against
|
||||||
* @param us who we are
|
* @param us who we are
|
||||||
* @param statFile the file to save stats to
|
|
||||||
* @param duration how many minutes to keep events for
|
* @param duration how many minutes to keep events for
|
||||||
* @param statFreq how often to write out stats
|
* @param statFreq how often to write out stats
|
||||||
* @param sendFreq how often to send pings
|
* @param sendFreq how often to send pings
|
||||||
@ -98,8 +97,8 @@ public class ClientConfig {
|
|||||||
* @param comment describe this test
|
* @param comment describe this test
|
||||||
* @param averagePeriods list of minutes to summarize over
|
* @param averagePeriods list of minutes to summarize over
|
||||||
*/
|
*/
|
||||||
public ClientConfig(Destination peer, Destination us, String statFile, int duration, int statFreq, int sendFreq,
|
public ClientConfig(Destination peer, Destination us, String statFile, int duration, int statFreq, int sendFreq, int sendSize, int numHops, String comment,
|
||||||
int sendSize, int numHops, String comment, int averagePeriods[]) {
|
int averagePeriods[]) {
|
||||||
_peer = peer;
|
_peer = peer;
|
||||||
_us = us;
|
_us = us;
|
||||||
_statFile = statFile;
|
_statFile = statFile;
|
||||||
@ -167,8 +166,7 @@ public class ClientConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves how many minutes of statistics should be maintained within the
|
* Retrieves how many minutes of statistics should be maintained within the window for this client
|
||||||
* window for this client
|
|
||||||
*
|
*
|
||||||
* @return the number of minutes
|
* @return the number of minutes
|
||||||
*/
|
*/
|
||||||
@ -177,8 +175,7 @@ public class ClientConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets how many minutes of statistics should be maintained within the
|
* Sets how many minutes of statistics should be maintained within the window for this client
|
||||||
* window for this client
|
|
||||||
*
|
*
|
||||||
* @param durationMinutes the number of minutes
|
* @param durationMinutes the number of minutes
|
||||||
*/
|
*/
|
||||||
@ -223,8 +220,7 @@ public class ClientConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves how many bytes the ping messages should be (min values ~700,
|
* Retrieves how many bytes the ping messages should be (min values ~700, max ~32KB)
|
||||||
* max ~32KB)
|
|
||||||
*
|
*
|
||||||
* @return the size in bytes
|
* @return the size in bytes
|
||||||
*/
|
*/
|
||||||
@ -233,8 +229,7 @@ public class ClientConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets how many bytes the ping messages should be (min values ~700, max
|
* Sets how many bytes the ping messages should be (min values ~700, max ~32KB)
|
||||||
* ~32KB)
|
|
||||||
*
|
*
|
||||||
* @param numBytes the size in bytes
|
* @param numBytes the size in bytes
|
||||||
*/
|
*/
|
||||||
@ -243,9 +238,8 @@ public class ClientConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves the brief, 1 line description of the test. Useful comments are
|
* Retrieves the brief, 1 line description of the test. Useful comments are along the lines of "The peer is located on a fast router and connection with 2
|
||||||
* along the lines of "The peer is located on a fast router and connection
|
* hop tunnels".
|
||||||
* with 2 hop tunnels".
|
|
||||||
*
|
*
|
||||||
* @return the brief comment
|
* @return the brief comment
|
||||||
*/
|
*/
|
||||||
@ -265,8 +259,7 @@ public class ClientConfig {
|
|||||||
/**
|
/**
|
||||||
* Retrieves the periods that the client's tests should be averaged over.
|
* Retrieves the periods that the client's tests should be averaged over.
|
||||||
*
|
*
|
||||||
* @return list of periods (in minutes) that the data should be averaged
|
* @return list of periods (in minutes) that the data should be averaged over, or null
|
||||||
* over, or null
|
|
||||||
*/
|
*/
|
||||||
public int[] getAveragePeriods() {
|
public int[] getAveragePeriods() {
|
||||||
return _averagePeriods;
|
return _averagePeriods;
|
||||||
@ -275,16 +268,14 @@ public class ClientConfig {
|
|||||||
/**
|
/**
|
||||||
* Sets the periods that the client's tests should be averaged over.
|
* Sets the periods that the client's tests should be averaged over.
|
||||||
*
|
*
|
||||||
* @param periods the list of periods (in minutes) that the data should be
|
* @param periods the list of periods (in minutes) that the data should be averaged over, or null
|
||||||
* averaged over, or null
|
|
||||||
*/
|
*/
|
||||||
public void setAveragePeriods(int periods[]) {
|
public void setAveragePeriods(int periods[]) {
|
||||||
_averagePeriods = periods;
|
_averagePeriods = periods;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves how many hops this test engine is configured to use for its
|
* Retrieves how many hops this test engine is configured to use for its outbound and inbound tunnels
|
||||||
* outbound and inbound tunnels
|
|
||||||
*
|
*
|
||||||
* @return the number of hops
|
* @return the number of hops
|
||||||
*/
|
*/
|
||||||
@ -293,8 +284,7 @@ public class ClientConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets how many hops this test engine is configured to use for its outbound
|
* Sets how many hops this test engine is configured to use for its outbound and inbound tunnels
|
||||||
* and inbound tunnels
|
|
||||||
*
|
*
|
||||||
* @param numHops the number of hops
|
* @param numHops the number of hops
|
||||||
*/
|
*/
|
||||||
@ -303,8 +293,7 @@ public class ClientConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load the client config from the properties specified, deriving the
|
* Load the client config from the properties specified, deriving the current config entry from the peer number.
|
||||||
* current config entry from the peer number.
|
|
||||||
*
|
*
|
||||||
* @param clientConfig the properties to load from
|
* @param clientConfig the properties to load from
|
||||||
* @param peerNum the number associated with the peer
|
* @param peerNum the number associated with the peer
|
||||||
@ -321,8 +310,8 @@ public class ClientConfig {
|
|||||||
String commentVal = clientConfig.getProperty(PROP_PREFIX + peerNum + PROP_COMMENT);
|
String commentVal = clientConfig.getProperty(PROP_PREFIX + peerNum + PROP_COMMENT);
|
||||||
String periodsVal = clientConfig.getProperty(PROP_PREFIX + peerNum + PROP_AVERAGEPERIODS);
|
String periodsVal = clientConfig.getProperty(PROP_PREFIX + peerNum + PROP_AVERAGEPERIODS);
|
||||||
|
|
||||||
if ((peerVal == null) || (statFileVal == null) || (statDurationVal == null) || (statFrequencyVal == null)
|
if ((peerVal == null) || (statFileVal == null) || (statDurationVal == null) || (statFrequencyVal == null) || (sendFrequencyVal == null)
|
||||||
|| (sendFrequencyVal == null) || (sendSizeVal == null)) {
|
|| (sendSizeVal == null)) {
|
||||||
if (_log.shouldLog(Log.DEBUG)) {
|
if (_log.shouldLog(Log.DEBUG)) {
|
||||||
_log.debug("Peer number " + peerNum + " does not exist");
|
_log.debug("Peer number " + peerNum + " does not exist");
|
||||||
}
|
}
|
||||||
@ -337,9 +326,8 @@ public class ClientConfig {
|
|||||||
|
|
||||||
if ((duration <= 0) || (statFreq <= 0) || (sendFreq <= 0) || (sendSize <= 0)) {
|
if ((duration <= 0) || (statFreq <= 0) || (sendFreq <= 0) || (sendSize <= 0)) {
|
||||||
if (_log.shouldLog(Log.WARN)) {
|
if (_log.shouldLog(Log.WARN)) {
|
||||||
_log.warn("Invalid client config: duration [" + statDurationVal + "] stat frequency ["
|
_log.warn("Invalid client config: duration [" + statDurationVal + "] stat frequency [" + statFrequencyVal + "] send frequency ["
|
||||||
+ statFrequencyVal + "] send frequency [" + sendFrequencyVal + "] send size ["
|
+ sendFrequencyVal + "] send size [" + sendSizeVal + "]");
|
||||||
+ sendSizeVal + "]");
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -394,16 +382,14 @@ public class ClientConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Store the client config to the properties specified, deriving the current
|
* Store the client config to the properties specified, deriving the current config entry from the peer number.
|
||||||
* config entry from the peer number.
|
|
||||||
*
|
*
|
||||||
* @param clientConfig the properties to store to
|
* @param clientConfig the properties to store to
|
||||||
* @param peerNum the number associated with the peer
|
* @param peerNum the number associated with the peer
|
||||||
* @return true if it was stored correctly, false if there were errors
|
* @return true if it was stored correctly, false if there were errors
|
||||||
*/
|
*/
|
||||||
public boolean store(Properties clientConfig, int peerNum) {
|
public boolean store(Properties clientConfig, int peerNum) {
|
||||||
if ((_peer == null) || (_sendFrequency <= 0) || (_sendSize <= 0) || (_statDuration <= 0)
|
if ((_peer == null) || (_sendFrequency <= 0) || (_sendSize <= 0) || (_statDuration <= 0) || (_statFrequency <= 0) || (_statFile == null)) { return false; }
|
||||||
|| (_statFrequency <= 0) || (_statFile == null)) { return false; }
|
|
||||||
|
|
||||||
String comment = _comment;
|
String comment = _comment;
|
||||||
if (comment == null) {
|
if (comment == null) {
|
||||||
|
Reference in New Issue
Block a user