Section IX, Advanced Topics

Calculating the Current Time

Oftentimes Swarm needs the current time in order to make requests to data sources. In order to make sure that Swarm asks for the correct time it attempts to synchronize with Internet time servers (see http://www.boulder.nist.gov/timefreq/service/time-servers.html). This does not change your system clock, it just calculates an offset from it. Swarm will attempt this sychronization approximately every 10 minutes.

Configuring Channel Groups

Swarm looks through a file called 'SwarmGroups.config' to groups channels in the Channel Selector. The file is very simple: just a list of [channel]=[group] pairs. Use the default file that comes with the Swarm distribution as a guide.

Java Settings

The most basic command to start Swarm is this:

java -cp lib/data.jar;lib/util.jar;lib/math.jar;lib/swarm.jar;lib/earthworm.jar;lib/colt.jar;lib/winston.jar;lib/plot.jar gov.usgs.swarm.Swarm

However, Swarm performs better with a large cache, so allocating it more memory with the -Xmx[size]M option is useful. This tells the Java Virtual Machine (JVM) that it can use up to [size] megabytes of RAM. The default batch file specifies: -Xmx256M.

Also, when run with java (as opposed to javaw) the Java console is left open. Some information will periodically be displayed here if this setting is used. The default settings is to use javaw.

Swarm Configuration File

Every time Swarm start, the file 'Swarm.config', if it exists, is read. This contains information about servers and some persistent user interface information. While not recommended, it can be modified directly. All comment fields will be stripped out and the lines could be reordered after Swarm closes.

Swarm Command Line Options

Swarm parses the command line to override or set variables in the configuration file, 'Swarm.config' or one specified on the command line. The format is:

swarm --[variable1]=[value1] --[variable2]=[value2] [optional config file]

Example:

swarm "--kiosk=localhost;BGL SHZ AK" "--saveConfig=false" "--timeChunk=15"

This example would start Swarm in Kiosk Mode using the channel BGL SHZ AK from the localhost server with a 15-minute x-axis. Also, when Swarm exited it wouldn't save the config file.