@Override public void testStarted(String host) { if (!isWorkingHost(host)) { return; } //ensure the data will be saved if (getProperty(FILENAME) == null || getProperty(FILENAME).getStringValue().trim().length() == 0) { if (autoGenerateFiles) { setupSaving(getAutoFileName()); } else { log.info("JmxMon metrics will not be recorded! Please specify a file name in the gui or run the test with -JforceJmxMonFile=true"); } } initiateConnectors(); workerThread = new Thread(this); workerThread.start(); super.testStarted(host); }
private void setupSaving(String fileName) { SampleSaveConfiguration config = getSaveConfig(); JMeterPluginsUtils.doBestCSVSetup(config); setSaveConfig(config); setFilename(fileName); log.info("JMXMon metrics will be stored in " + new File(fileName).getAbsolutePath()); }
@Override public synchronized void run() { try { syncContext(true); while (true) { processConnectors(); this.wait(interval); syncContext(false); } } catch (InterruptedException ex) { log.debug("Monitoring thread was interrupted", ex); } }
private void initiateConnectors() { JMeterProperty prop = getSamplerSettings(); jmxMonSamplers.clear(); if (!(prop instanceof CollectionProperty)) { attributes.put("jmx.remote.credentials", (String[]) buffer); initiateConnector(attributes, jmxUrl, label, isDelta, objectName, attribute, key, canRetry); } catch (MalformedURLException ex) {
@Override public TestElement createTestElement() { TestElement te = new JMXMonCollector(); modifyTestElement(te); te.setComment(JMeterPluginsUtils.getWikiLinkText(getWikiPage())); return te; }
@Override public void configure(TestElement te) { super.configure(te); JMXMonCollector dmte = (JMXMonCollector) te; JMeterProperty jmxmonValues = dmte.getSamplerSettings(); if (!(jmxmonValues instanceof NullProperty)) { JMeterPluginsUtils.collectionPropertyToTableModelRows((CollectionProperty) jmxmonValues, tableModel, columnClasses); } else { log.warn("Received null property instead of collection"); } }
@Override public void generateSample(double value, String label) { JMXMonSampleResult res = new JMXMonSampleResult(); res.setSampleLabel(label); res.setValue(value); res.setSuccessful(true); SampleEvent e = new SampleEvent(res, JMXMON); jmxMonSampleOccurred(e); }
public JMeterProperty getSamplerSettings() { return getProperty(DATA_PROPERTY); }
@Override public synchronized void run() { try { while (true) { processConnectors(); this.wait(interval); } } catch (InterruptedException ex) { log.debug("Monitoring thread was interrupted", ex); } }
private void initiateConnectors() { JMeterProperty prop = getSamplerSettings(); jmxMonSamplers.clear(); if (!(prop instanceof CollectionProperty)) { attributes.put("jmx.remote.credentials", (String[]) buffer); initiateConnector(attributes, jmxUrl, label, isDelta, objectName, attribute, key, canRetry); } catch (MalformedURLException ex) {
@Override public TestElement createTestElement() { TestElement te = new JMXMonCollector(); modifyTestElement(te); te.setComment(JMeterPluginsUtils.getWikiLinkText(getWikiPage())); return te; }
@Override public void configure(TestElement te) { super.configure(te); JMXMonCollector dmte = (JMXMonCollector) te; JMeterProperty jmxmonValues = dmte.getSamplerSettings(); if (!(jmxmonValues instanceof NullProperty)) { JMeterPluginsUtils.collectionPropertyToTableModelRows((CollectionProperty) jmxmonValues, tableModel, columnClasses); } else { log.warn("Received null property instead of collection"); } }
@Override public void generateSample(double value, String label) { JMXMonSampleResult res = new JMXMonSampleResult(); res.setSampleLabel(label); res.setValue(value); res.setSuccessful(true); SampleEvent e = new SampleEvent(res, JMXMON); jmxMonSampleOccurred(e); } }
public JMeterProperty getSamplerSettings() { return getProperty(DATA_PROPERTY); }
@Override public void testStarted(String host) { if (!isWorkingHost(host)) { return; } //ensure the data will be saved if (getProperty(FILENAME) == null || getProperty(FILENAME).getStringValue().trim().length() == 0) { if (autoGenerateFiles) { setupSaving(getAutoFileName()); } else { log.info("JmxMon metrics will not be recorded! Please specify a file name in the gui or run the test with -JforceJmxMonFile=true"); } } ctx = JMeterContextService.getContext(); initiateConnectors(); workerThread = new Thread(this); workerThread.start(); super.testStarted(host); }
private void setupSaving(String fileName) { SampleSaveConfiguration config = getSaveConfig(); JMeterPluginsUtils.doBestCSVSetup(config); setSaveConfig(config); setFilename(fileName); log.info("JMXMon metrics will be stored in " + new File(fileName).getAbsolutePath()); }