Esempio n. 1
0
        private void print_stats()
        {
            LBMSourceStatistics stats = _src.getStatistics();

            switch (stats.type())
            {
            case LBM.TRANSPORT_STAT_TCP:
                System.Console.Out.WriteLine("TCP, buffered " + stats.bytesBuffered() + ", clients " + stats.numberOfClients());
                break;

            case LBM.TRANSPORT_STAT_LBTRU:
                System.Console.Out.WriteLine("LBT-RU, sent " + stats.messagesSent()
                                             + "/" + stats.bytesSent()
                                             + ", naks " + stats.naksReceived()
                                             + "/" + stats.nakPacketsReceived()
                                             + ", ignored " + stats.naksIgnored()
                                             + "/" + stats.naksIgnoredRetransmitDelay()
                                             + ", shed " + stats.naksShed()
                                             + ", rxs " + stats.retransmissionsSent()
                                             + ", clients " + stats.numberOfClients());
                break;

            case LBM.TRANSPORT_STAT_LBTRM:
                System.Console.Out.WriteLine("LBT-RM, sent " + stats.messagesSent()
                                             + "/" + stats.bytesSent()
                                             + ", txw " + stats.transmissionWindowMessages()
                                             + "/" + stats.transmissionWindowBytes()
                                             + ", naks " + stats.naksReceived()
                                             + "/" + stats.nakPacketsReceived()
                                             + ", ignored " + stats.naksIgnored()
                                             + "/" + stats.naksIgnoredRetransmitDelay()
                                             + ", shed " + stats.naksShed()
                                             + ", rxs " + stats.retransmissionsSent()
                                             + ", rctl " + stats.messagesQueued()
                                             + "/" + stats.retransmissionsQueued());
                break;

            case LBM.TRANSPORT_STAT_LBTIPC:
                System.Console.Out.WriteLine("LBT-IPC, source " + stats.source()
                                             + " clients " + stats.numberOfClients()
                                             + ", sent " + stats.messagesSent()
                                             + "/" + stats.bytesSent());
                break;

            case LBM.TRANSPORT_STAT_LBTRDMA:
                System.Console.Out.WriteLine("LBT-RDMA, source " + stats.source()
                                             + " clients " + stats.numberOfClients()
                                             + ", sent " + stats.messagesSent()
                                             + "/" + stats.bytesSent());
                break;
            }
            _recycler.doneWithSourceStatistics(stats);

            System.Console.Out.Flush();
        }
Esempio n. 2
0
    public virtual void  onReceive(LBMSourceStatistics stats)
    {
        System.Console.Error.Write("\nSource statistics received");
        System.Console.Error.Write(" from " + stats.getApplicationSourceId());
        System.Console.Error.Write(" at " + stats.getSender().ToString());
        System.Console.Error.WriteLine(", sent " + stats.getTimestamp().ToLocalTime().ToString());
        System.Console.Error.WriteLine("Source: " + stats.source());
        System.Console.Error.WriteLine("Transport: " + stats.typeName());
        switch (stats.type())
        {
        case LBM.TRANSPORT_STAT_TCP:
            System.Console.Error.WriteLine("\tClients       : " + stats.numberOfClients());
            System.Console.Error.WriteLine("\tBytes buffered: " + stats.bytesBuffered());
            break;

        case LBM.TRANSPORT_STAT_LBTRM:
            System.Console.Error.WriteLine("\tLBT-RM datagrams sent                                 : " + stats.messagesSent());
            System.Console.Error.WriteLine("\tLBT-RM datagram bytes sent                            : " + stats.bytesSent());
            System.Console.Error.WriteLine("\tLBT-RM datagrams in transmission window               : " + stats.transmissionWindowMessages());
            System.Console.Error.WriteLine("\tLBT-RM datagram bytes in transmission window          : " + stats.transmissionWindowBytes());
            System.Console.Error.WriteLine("\tLBT-RM NAK packets received                           : " + stats.nakPacketsReceived());
            System.Console.Error.WriteLine("\tLBT-RM NAKs received                                  : " + stats.naksReceived());
            System.Console.Error.WriteLine("\tLBT-RM NAKs ignored                                   : " + stats.naksIgnored());
            System.Console.Error.WriteLine("\tLBT-RM NAKs shed                                      : " + stats.naksShed());
            System.Console.Error.WriteLine("\tLBT-RM NAKs ignored (retransmit delay)                : " + stats.naksIgnoredRetransmitDelay());
            System.Console.Error.WriteLine("\tLBT-RM retransmission datagrams sent                  : " + stats.retransmissionsSent());
            System.Console.Error.WriteLine("\tLBT-RM retransmission datagram bytes sent             : " + stats.retransmissionBytesSent());
            System.Console.Error.WriteLine("\tLBT-RM datagrams queued by rate control               : " + stats.messagesQueued());
            System.Console.Error.WriteLine("\tLBT-RM retransmission datagrams queued by rate control: " + stats.retransmissionsQueued());
            break;

        case LBM.TRANSPORT_STAT_LBTRU:
            System.Console.Error.WriteLine("\tLBT-RU datagrams sent                    : " + stats.messagesSent());
            System.Console.Error.WriteLine("\tLBT-RU datagram bytes sent               : " + stats.bytesSent());
            System.Console.Error.WriteLine("\tLBT-RU NAK packets received              : " + stats.nakPacketsReceived());
            System.Console.Error.WriteLine("\tLBT-RU NAKs received                     : " + stats.naksReceived());
            System.Console.Error.WriteLine("\tLBT-RU NAKs ignored                      : " + stats.naksIgnored());
            System.Console.Error.WriteLine("\tLBT-RU NAKs shed                         : " + stats.naksShed());
            System.Console.Error.WriteLine("\tLBT-RU NAKs ignored (retransmit delay)   : " + stats.naksIgnoredRetransmitDelay());
            System.Console.Error.WriteLine("\tLBT-RU retransmission datagrams sent     : " + stats.retransmissionsSent());
            System.Console.Error.WriteLine("\tLBT-RU retransmission datagram bytes sent: " + stats.retransmissionBytesSent());
            System.Console.Error.WriteLine("\tClients                                  : " + stats.numberOfClients());
            break;

        case LBM.TRANSPORT_STAT_LBTIPC:
            System.Console.Error.WriteLine("\tClients                    :" + stats.numberOfClients());
            System.Console.Error.WriteLine("\tLBT-IPC datagrams sent     :" + stats.messagesSent());
            System.Console.Error.WriteLine("\tLBT-IPC datagram bytes sent:" + stats.bytesSent());
            break;

        case LBM.TRANSPORT_STAT_LBTSMX:
            System.Console.Error.WriteLine("\tClients                    :" + stats.numberOfClients());
            System.Console.Error.WriteLine("\tLBT-SMX datagrams sent     :" + stats.messagesSent());
            System.Console.Error.WriteLine("\tLBT-SMX datagram bytes sent:" + stats.bytesSent());
            break;

        case LBM.TRANSPORT_STAT_LBTRDMA:
            System.Console.Error.WriteLine("\tClients                    :" + stats.numberOfClients());
            System.Console.Error.WriteLine("\tLBT-RDMA datagrams sent     :" + stats.messagesSent());
            System.Console.Error.WriteLine("\tLBT-RDMA datagram bytes sent:" + stats.bytesSent());
            break;

        case LBM.TRANSPORT_STAT_BROKER:
            System.Console.Error.WriteLine("\tBROKER messages sent       : " + stats.messagesSent());
            System.Console.Error.WriteLine("\tBROKER message bytes sent  : " + stats.bytesSent());
            break;

        default:
            System.Console.Error.WriteLine("Error: Unknown transport type received:" + stats.type());
            break;
        }
        _recycler.doneWithSourceStatistics(stats);
    }
Esempio n. 3
0
        private static void print_stats(LBMContext ctx, int nsrcs, string transport_type, LBMObjectRecyclerBase recycler)
        {
            int n;

            if (transport_type == "LBT-RM")
            {
                n = (int)(inet_aton(ctx.getAttributeValue("transport_lbtrm_multicast_address_high"))
                          - inet_aton(ctx.getAttributeValue("transport_lbtrm_multicast_address_low"))) + 1;
            }
            else if (transport_type == "LBT-IPC")
            {
                n = Convert.ToInt32(ctx.getAttributeValue("transport_lbtipc_id_high"))
                    - Convert.ToInt32(ctx.getAttributeValue("transport_lbtipc_id_low")) + 1;
            }
            else
            {
                n = Convert.ToInt32(ctx.getAttributeValue("transport_tcp_maximum_ports"));
            }

            if (nsrcs < n)
            {
                n = nsrcs;
            }
            LBMSourceStatistics stats = ctx.getSourceStatistics(n);

            for (int i = 0; i < stats.size(); i++)
            {
                switch (stats.type(i))
                {
                case LBM.TRANSPORT_STAT_TCP:
                    System.Console.Out.WriteLine("TCP, source " + stats.source(i)
                                                 + " buffered " + stats.bytesBuffered(i)
                                                 + ", clients " + stats.numberOfClients(i));
                    break;

                case LBM.TRANSPORT_STAT_LBTRU:
                    System.Console.Out.WriteLine("LBT-RU, source " + stats.source(i)
                                                 + " sent " + stats.messagesSent(i)
                                                 + "/" + stats.bytesSent(i)
                                                 + ", naks " + stats.naksReceived(i)
                                                 + "/" + stats.nakPacketsReceived(i)
                                                 + ", ignored " + stats.naksIgnored(i)
                                                 + "/" + stats.naksIgnoredRetransmitDelay(i)
                                                 + ", shed " + stats.naksShed(i)
                                                 + ", rxs " + stats.retransmissionsSent(i)
                                                 + ", clients " + stats.numberOfClients(i));
                    break;

                case LBM.TRANSPORT_STAT_LBTRM:
                    System.Console.Out.WriteLine("LBT-RM, source " + stats.source(i)
                                                 + " sent " + stats.messagesSent(i)
                                                 + "/" + stats.bytesSent(i)
                                                 + ", txw " + stats.transmissionWindowMessages(i)
                                                 + "/" + stats.transmissionWindowBytes(i)
                                                 + ", naks " + stats.naksReceived(i)
                                                 + "/" + stats.nakPacketsReceived(i)
                                                 + ", ignored " + stats.naksIgnored(i)
                                                 + "/" + stats.naksIgnoredRetransmitDelay(i)
                                                 + ", shed " + stats.naksShed(i)
                                                 + ", rxs " + stats.retransmissionsSent(i)
                                                 + ", rctl " + stats.messagesQueued(i)
                                                 + "/" + stats.retransmissionsQueued(i));
                    break;

                case LBM.TRANSPORT_STAT_LBTIPC:
                    System.Console.Out.WriteLine("LBT-IPC, source " + stats.source(i)
                                                 + " clients " + stats.numberOfClients(i)
                                                 + ", sent " + stats.messagesSent(i)
                                                 + "/" + stats.bytesSent(i));
                    break;

                case LBM.TRANSPORT_STAT_LBTSMX:
                    System.Console.Out.WriteLine("LBT-SMX, source " + stats.source(i)
                                                 + " clients " + stats.numberOfClients(i)
                                                 + ", sent " + stats.messagesSent(i)
                                                 + "/" + stats.bytesSent(i));
                    break;

                case LBM.TRANSPORT_STAT_LBTRDMA:
                    System.Console.Out.WriteLine("LBT-RDMA, source " + stats.source(i)
                                                 + " clients " + stats.numberOfClients(i)
                                                 + ", sent " + stats.messagesSent(i)
                                                 + "/" + stats.bytesSent(i));
                    break;
                }
            }
            recycler.doneWithSourceStatistics(stats);
            System.Console.Out.Flush();
        }