Package com.ardor3d.util.stat

Examples of com.ardor3d.util.stat.MultiStatSample


        // - For each sample, add points and extend the lines of the
        // corresponding Line objects.
        synchronized (StatCollector.getHistorical()) {
            for (int i = 0; i < StatCollector.getHistorical().size(); i++) {
                final MultiStatSample sample = StatCollector.getHistorical().get(i);
                for (final StatType type : _config.keySet()) {
                    if (sample.containsStat(type)) {
                        LineEntry entry = _entries.get(type);
                        // Prepare our entry object as needed.
                        if (entry == null || entry.maxSamples != StatCollector.getMaxSamples()) {
                            entry = new LineEntry(StatCollector.getMaxSamples(), type);
                            _entries.put(type, entry);
                        }

                        final double value = getBooleanConfig(type, ConfigKeys.FrameAverage.name(), false) ? sample
                                .getStatValue(type).getAverageValue() : sample.getStatValue(type).getAccumulatedValue();

                        final Vector3 point = new Vector3(i, value, 0);
                        // Now, add
                        entry.verts.add(point);
View Full Code Here


        // - For each sample, add points and extend the lines of the
        // corresponding Line objects.
        synchronized (StatCollector.getHistorical()) {
            for (int i = 0; i < StatCollector.getHistorical().size(); i++) {
                final MultiStatSample sample = StatCollector.getHistorical().get(i);
                // First figure out the max value.
                double max = 0;
                for (final StatType type : sample.getStatTypes()) {
                    if (_config.containsKey(type)) {
                        max = Math.max(sample.getStatValue(type).getAccumulatedValue(), max);
                    }
                }
                double accum = 0;
                for (final StatType type : sample.getStatTypes()) {
                    if (_config.containsKey(type)) {
                        AreaEntry entry = _entries.get(type);
                        // Prepare our entry object as needed.
                        if (entry == null || entry.maxSamples != StatCollector.getMaxSamples()) {
                            entry = new AreaEntry(StatCollector.getMaxSamples(), type);
                            _entries.put(type, entry);
                        }

                        // average by max and bump by accumulated total.
                        final double value = sample.getStatValue(type).getAccumulatedValue() / max;
                        final Vector3 point1 = new Vector3(i, (float) (value + accum), 0);
                        entry.verts.add(point1);
                        final Vector3 point2 = new Vector3(i, (float) (accum), 0);
                        entry.verts.add(point2);
                        entry.visited = true;
View Full Code Here

            _entries.get(type).visited = false;
        }

        // - We only care about the most recent stats
        synchronized (StatCollector.getHistorical()) {
            final MultiStatSample sample = StatCollector.getHistorical().get(StatCollector.getHistorical().size() - 1);
            // - go through things we are configured for
            for (final StatType type : _config.keySet()) {
                StatValue val = sample.getStatValue(type);
                if (val == null) {
                    if (!StatCollector.hasHistoricalStat(type)) {
                        continue;
                    } else {
                        val = new StatValue();
View Full Code Here

        if (counter > 1) {
            final double fps = (frames / counter);
            text[1].setText("Frames per second: " + Math.round(fps * 10) / 10.0);
            if (StatCollector.hasHistoricalStat(StatType.STAT_TRIANGLE_COUNT)
                    && StatCollector.hasHistoricalStat(StatType.STAT_FRAMES)) {
                final MultiStatSample stats = StatCollector.lastStats();
                final double triangles = stats.getStatValue(StatType.STAT_TRIANGLE_COUNT).getAccumulatedValue();
                final double frames = stats.getStatValue(StatType.STAT_FRAMES).getAccumulatedValue();
                final double tps = (triangles / frames) * fps;

                if (tps > 1000000) {
                    text[0].setText("Triangles per second: " + Math.round(tps / 100000) / 10.0 + " million");
                } else if (tps > 1000) {
View Full Code Here

TOP

Related Classes of com.ardor3d.util.stat.MultiStatSample

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.