Package jnode.report

Examples of jnode.report.ConnectionStatData$ConnectionStatDataElement


        synchronized (ConnectionStat.class) {

            if (event instanceof ConnectionEndEvent) {
                ConnectionEndEvent evt = (ConnectionEndEvent) event;

                ConnectionStatData data = new ConnectionStatData(statPath);

                ConnectionStatData.ConnectionStatDataElement current;

                List<ConnectionStatData.ConnectionStatDataElement> elements = data.load();

                int pos = data.findPos(evt.getAddress(), elements);
                if (pos == -1) {
                    current = new ConnectionStatData.ConnectionStatDataElement();
                    current.linkStr = evt.getAddress() != null ? evt.getAddress().toString() : null;
                } else {
                    current = elements.get(pos);
                }

                if (evt.isIncoming()) {
                    if (evt.isSuccess()) {
                        current.incomingOk++;
                    } else {
                        current.incomingFailed++;
                    }
                } else {
                    if (evt.isSuccess()) {
                        current.outgoingOk++;
                    } else {
                        current.outgoingFailed++;
                    }
                }
                current.bytesReceived += evt.getBytesReceived();
                current.bytesSended += evt.getBytesSended();

                data.store(evt.getAddress(), current);
            }
        }
    }
View Full Code Here


        return "Daily connection stat";
    }

    public static String getText(String path, boolean reset){
        logger.l5("getText path = [" + path + "], reset = [" + reset + "]");
        ConnectionStatData data = new ConnectionStatData(path);
        logger.l5("get ConnectionStatData " + data);
        List<ConnectionStatData.ConnectionStatDataElement> elements = reset ? data.loadAndDrop() : data.load();
        logger.l5(MessageFormat.format("has {0} elements", elements != null ? elements.size() : 0));

        ReportBuilder builder = new ReportBuilder();
        builder.setColumns(Arrays.asList("Link", "I_OK", "I_FA", "O_OK", "O_FA", "BR", "BS"));
        builder.setColLength(Arrays.asList(19,    5,      5,     5,     5,    9,   9));
View Full Code Here

TOP

Related Classes of jnode.report.ConnectionStatData$ConnectionStatDataElement

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.