String instanceName = corePlugin.getInstanceName() != null ? corePlugin.getInstanceName() : "host";
return new MeasurementSession(applicationName, getHostName(), instanceName);
}
static ConfigurationSource getConfiguration(String[] args) {
final SimpleSource source = new SimpleSource("Process Arguments");
for (String arg : args) {
if (!arg.matches("(.+)=(.+)")) {
throw new IllegalArgumentException("Illegal argument '" + arg +
"'. Arguments must be in form '<config-key>=<config-value>'");
}
final String[] split = arg.split("=");
source.add(split[0], split[1]);
}
return source;
}