Package org.apache.jmeter.visualizers

Examples of org.apache.jmeter.visualizers.SamplingStatCalculator


    public void add(SampleResult res) {
        if (!isSampleIncluded(res)) {
            return;
        }

        SamplingStatCalculator row;
        final String sampleLabel = res.getSampleLabel(useGroupName.isSelected());
        synchronized (tableRows) {
            row = tableRows.get(sampleLabel);
            if (row == null) {
                row = new SamplingStatCalculator(sampleLabel);
                tableRows.put(row.getLabel(), row);
                statModel.insertRow(row, statModel.getRowCount() - 1);
            }
        }
        /*
         * Synch is needed because multiple threads can update the counts.
         */
        synchronized (row) {
            row.addSample(res);
        }
        SamplingStatCalculator tot = tableRows.get(TOTAL_ROW_LABEL);
        synchronized (tot) {
            tot.addSample(res);
        }
        //statModel.fireTableDataChanged();
    }
View Full Code Here


    @Override
    public final void clearData() {
        synchronized (tableRows) {
            statModel.clearData();
            tableRows.clear();
            tableRows.put(TOTAL_ROW_LABEL, new SamplingStatCalculator(TOTAL_ROW_LABEL));
            statModel.addRow(tableRows.get(TOTAL_ROW_LABEL));
        }
    }
View Full Code Here

    public void add(final SampleResult res) {
        JMeterUtils.runSafe(new Runnable() {
            @Override
            public void run() {
                if (isSampleIncluded(res)) {
                    SamplingStatCalculator row = null;
                    final String sampleLabel = res.getSampleLabel(useGroupName
                            .isSelected());
                    synchronized (lock) {
                        row = tableRows.get(sampleLabel);
                        if (row == null) {
                            row = new SamplingStatCalculator(sampleLabel);
                            tableRows.put(row.getLabel(), row);
                            model.insertRow(row, model.getRowCount() - 1);
                        }
                    }
                    /*
                     * Synch is needed because multiple threads can update the
                     * counts.
                     */
                    synchronized (row) {
                        row.addSample(res);
                    }
                    SamplingStatCalculator tot = tableRows.get(TOTAL_ROW_LABEL);
                    synchronized (tot) {
                        tot.addSample(res);
                    }
                    model.fireTableDataChanged();
                }
            }
        });
View Full Code Here

    @Override
    public void clearData() {
        synchronized (lock) {
            model.clearData();
            tableRows.clear();
            tableRows.put(TOTAL_ROW_LABEL, new SamplingStatCalculator(
                    TOTAL_ROW_LABEL));
            model.addRow(tableRows.get(TOTAL_ROW_LABEL));
        }
    }
View Full Code Here

        String[] urls = this.getURLs().split(URL_DELIM);
        double[][] dataset = new double[urls.length][data.size()];
        for (int idx=0; idx < urls.length; idx++) {
            for (int idz=0; idz < data.size(); idz++) {
                DataSet dset = (DataSet)data.get(idz);
                SamplingStatCalculator ss = dset.getStatistics(urls[idx]);
                dataset[idx][idz] = getValue(ss);
            }
        }
        return dataset;
    }
View Full Code Here

     */
    public List getStats(List urls) {
        ArrayList items = new ArrayList();
        Iterator itr = urls.iterator();
        if (itr.hasNext()) {
            SamplingStatCalculator row = (SamplingStatCalculator)itr.next();
            if (row != null) {
                items.add(row);
            }
        }
        return items;
View Full Code Here

        // now add the samples to the HashMap
        String url = sample.getSampleLabel();
        if (url == null) {
            url = sample.getURL().toString();
        }
        SamplingStatCalculator row = (SamplingStatCalculator)data.get(url);
        if (row == null) {
            row = new SamplingStatCalculator();
            // just like the aggregate listener, we use the sample label to represent
            // a row. in this case, we use it as a key.
            this.data.put(url,row);
        }
        row.addSample(sample);
    }
View Full Code Here

     */
    public double[][] convertToDouble(List data) {
        double[][] dataset = new double[1][data.size()];
        //Iterator itr = data.iterator();
        for (int idx=0; idx < data.size(); idx++) {
            SamplingStatCalculator stat = (SamplingStatCalculator)data.get(idx);
            dataset[0][idx] = getValue(stat);
        }
        return dataset;
    }
View Full Code Here

        ArrayList dset = new ArrayList();
        ArrayList xlabels = new ArrayList();
        Iterator itr = data.iterator();
        while (itr.hasNext()) {
            DataSet item = (DataSet)itr.next();
            SamplingStatCalculator ss = item.getStatistics(this.getURL());
            if (ss != null) {
                // we add the entry
                dset.add(ss);
                if ( getXLabel().equals(X_DATA_FILENAME_LABEL) ) {
                    xlabels.add(item.getDataSourceName());
View Full Code Here

TOP

Related Classes of org.apache.jmeter.visualizers.SamplingStatCalculator

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.