public void startMonitoring(Collection<Monitorable<?>> monitorables) {
Preconditions.checkArgument(!started, "Should have called stopMonitoring before calling start again");
try {
for (Monitorable<?> monitorable : monitorables) {
monitorable.attachMonitor(monitor);
MetricName metricName = mapper.map(monitorable.getName());
pcpWriter.addMetric(metricName,
convertToPcpSemantics(monitorable.getSemantics()), monitorable.getUnit(),
monitorable.get());
pcpWriter.setMetricHelpText(metricName.getMetric(), shortTextSource.getText(
monitorable, metricName), longTextSource.getText(monitorable, metricName));
}
pcpWriter.start();
this.started = true;