Package org.apache.jmeter.samplers

Examples of org.apache.jmeter.samplers.SampleSaveConfiguration


        setupSaving();
        super.testStarted(host);
    }

    private void setupSaving() {
        SampleSaveConfiguration conf = getSaveConfig();
        // please, save the threads... it's so important, but disabled by default
        conf.setThreadCounts(true);
    }
View Full Code Here


        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());
    }
View Full Code Here

        workerThread.start();
        log.debug("End   initCollector");
    }

    private void setupSaving(String fileName) {
        SampleSaveConfiguration config = getSaveConfig();
        JMeterPluginsUtils.doBestCSVSetup(config);
        setSaveConfig(config);
        setFilename(fileName);
        log.info("DbMon metrics will be stored in " + new File(fileName).getAbsolutePath());
    }
View Full Code Here

        } catch (IOException e) {
            log.warn("Error trying to initialize output file " + e.toString());
        }

        for (SampleResult result : samples) {
            SampleSaveConfiguration config = crc.getSaveConfig();
            event = new SampleEvent(result, null);
            try {
                if (config.saveAsXml()) {
                    SaveService.saveSampleResult(event, out);
                } else { // !saveAsXml
                    String savee = CSVSaveService
                            .resultToDelimitedString(event);
                    out.println(savee);
View Full Code Here

        // OMG, I spent 2 days finding that setting properties in testStarted
        // marks them temporary, though they cleared in some places.
        // So we do dirty(?) hack here...
        clearTemporary(getProperty(FILENAME));

        SampleSaveConfiguration conf = getSaveConfig();
        JMeterPluginsUtils.doBestCSVSetup(conf);

        setSaveConfig(conf);
    }
View Full Code Here

     */
    @Test
    public void testDoBestCSVSetup() {
        System.out.println("doBestCSVSetup");
        TestJMeterUtils.createJmeterEnv();
        SampleSaveConfiguration conf = new SampleSaveConfiguration();
        JMeterPluginsUtils.doBestCSVSetup(conf);
    }
View Full Code Here

   *      com.thoughtworks.xstream.converters.MarshallingContext)
   */
  public void marshal(Object obj, HierarchicalStreamWriter writer, MarshallingContext context) {
        super.marshal(obj, writer, context); // Save most things
       
        SampleSaveConfiguration prop = (SampleSaveConfiguration) obj;
       
        // Save the new fields - but only if they are not the default
        createNode(writer,prop.saveBytes(),NODE_BYTES);
        createNode(writer,prop.saveUrl(),NODE_URL);
        createNode(writer,prop.saveFileName(),NODE_FILENAME);
        createNode(writer,prop.saveHostname(),NODE_HOSTNAME);
        createNode(writer,prop.saveThreadCounts(),NODE_THREAD_COUNT);
        createNode(writer,prop.saveSampleCount(),NODE_SAMPLE_COUNT);
  }
View Full Code Here

    final Class thisClass = SampleSaveConfiguration.class;
    final Class requiredType = context.getRequiredType();
    if (requiredType != thisClass) {
      throw new IllegalArgumentException("Unexpected class: "+requiredType.getName());
    }
    SampleSaveConfiguration result = new SampleSaveConfiguration();
    result.setBytes(false); // Maintain backward compatibility (bytes was not in the JMX file)
    while (reader.hasMoreChildren()) {
      reader.moveDown();
      String nn = reader.getNodeName();
      if (!"formatter".equals(nn)){// Skip formatter (if present) bug 42674 $NON-NLS-1$
        String fieldName = mapper.realMember(thisClass, nn);
View Full Code Here

   *      com.thoughtworks.xstream.io.HierarchicalStreamWriter,
   *      com.thoughtworks.xstream.converters.MarshallingContext)
   */
  public void marshal(Object obj, HierarchicalStreamWriter writer, MarshallingContext context) {
    SampleResult res = (SampleResult) obj;
    SampleSaveConfiguration save = res.getSaveConfig();
    setAttributes(writer, context, res, save);
    saveAssertions(writer, context, res, save);
    saveSubResults(writer, context, res, save);
    saveResponseHeaders(writer, context, res, save);
    saveRequestHeaders(writer, context, res, save);
View Full Code Here

  public ResultCollector() {
    // current = -1;
    // serializer = new DefaultConfigurationSerializer();
    setErrorLogging(false);
    setSuccessOnlyLogging(false);
    setProperty(new ObjectProperty(SAVE_CONFIG, new SampleSaveConfiguration()));
  }
View Full Code Here

TOP

Related Classes of org.apache.jmeter.samplers.SampleSaveConfiguration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.