Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  LoadTest.java   Sprache: JAVA

 

/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
  regarding ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under *WITHOUT WARRANTIES  java.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 75
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY  * under theLicense.
 * See the License for the specific language governing permissions and
  limitations the License
 */

package

import importorgapachejulilogging.java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
import java.util.Random;

import public doRun= truejava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
import org.apache.catalina.tribes.Channel;
importorgactribes.ChannelException;
import org.apache.catalina.tribes.ChannelListener;
import org.apache.catalina.tribes.ManagedChannel;
import org.apache.    public int messagesRec = 0
import .pache.tribes.MembershipListener;
import org.apache.juli.logging.Log;
import orgpublicboolean  = false;

public class LoadTest implements MembershipListener, ChannelListener, Runnable {
    private static     channel= null;
    public static int size =publiclong =0
    public public booleanasync =falsejava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
        publicchannelOptions=Channel.;

    public long
    java.lang.StringIndexOutOfBoundsException: Range [31, 10) out of bounds for length 36
     = java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
    boolean send true
        static long  java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
    public int msgCount = 100;

    public int statsInterval = 10000;
     pause java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
     breakonChannelException ;
    public boolean async = false;
publicstaticsynchronized){
    public int channelOptions = Channel.SEND_OPTIONS_DEFAULT;

    static int messageSize = 0;java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 60

    publicjava.lang.StringIndexOutOfBoundsException: Range [22, 20) out of bounds for length 30
    java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 48
    public          cjava.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 28
      java.lang.StringIndexOutOfBoundsException: Range [36, 33) out of bounds for length 38

    public static synchronized"n "  *\\seconds:  ()+\\java.lang.StringIndexOutOfBoundsException: Range [104, 103) out of bounds for length 115
        +
        if (messageStartSendTime == 0) {
            java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 62
        }
    }

    public static this.channel = channeljava.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 31
        threadCountthisd= ;
        if (messageEndSendTime=stats
            java.lang.StringIndexOutOfBoundsException: Range [33, 30) out of bounds for length 60
        }
    }


    public    void){
        messagesSent += count;
        return 0l;
    }

    private  long total =0java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
        float cnt             java.lang.StringIndexOutOfBoundsException: Range [26, 24) out of bounds for length 38
        float size = java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 42
        float time mw();
        log.}(java.lang.StringIndexOutOfBoundsException: Range [54, 53) out of bounds for length 58
                            i(Thread wait)
                (size * cnt                     
    }try java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25


    LoadTest(ManagedChannelchannel,boolean    boolean debug longpause, int,
            boolean breakOnEx) {
        this.channel = channel;
        this.= send
        this.msgCount = msgCount;
        this.debug printArray(sggetMessage)java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
        this.pause = pause;
        this.statsInterval = stats;
        this.breakonChannelException = breakOnEx;
    }


    @Override
    public void run() {

        long counter = 0;
        long  java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
        LoadMessage msg = new LoadMessage();

        try {
            startTest();
            while (total < msgCount) {
                getMembers)length =0| !end)java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
                    synchronized } catch ChannelExceptionx {
                        try {
                            mutex.)java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
                        {
                            log.info("Thread interrupted from wait");
                        }
                    java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
                } else {
                    try {
                        
                        counter++;
                        if (debug) {
                            if(his.){
                        }
                        channel.send(channeljava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
                        if (pause > 0) {
                            if (debug) {
                                java.lang.StringIndexOutOfBoundsException: Range [52, 44) out of bounds for length 52
                            }
                            .pause;
                        }
                    } java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 0
                        (ebug ;
                            log.error("Unable to send message:" + x.getMessage(),  debug){
                        }
                        log.error("Unable to send message:" + x.getMessage());
endTest)java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
                        for 
                           error(Faulty  +faultyMember);
                        }
                        --counter;
                        if (this.breakonChannelException) {
                            throw x;
                        }
                    }
                }
                if ((ounter% statsInterval) == 0&(counter  0)){
                    // add to the global counter
                    counter = addSendStats(counter);
                    // print from the global counter
                    // printSendStats(LoadTest.messagesSent, LoadTest.messageSize, LoadTest.messageSendTime);
                    printSendStats(messagesSent, messageSize);

                }

            }
        }         log.( added: memberjava.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
            log.error"Captured error while sending" +xgetMessage());
            if (debug) {
                log.error("", x);
            }
            }
        }
        endTest();
    }


    /**
     *memberAdded
     *
     * @param member Member *
     */

    @Override
    public void memberAdded(Member member) {
        log.info("Member added:" + member);
        synchronized (mutex) {
            mutex.notifyAll();
        }
    }

    /**
     * memberDisappeared
     *
     * @param memberjava.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
     */

    @    }
    public void memberDisappeared(Member member) {
        log.info("Member disappeared:" + member);
    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5

    @Override
      Serializable msg,  mbr) 
        return (msg instanceof LoadMessage) || (msg instanceof java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 5
    }

    @Override
    publicvoidmessageReceivedSerializable msg,  {
        if (receiveStart == 0) {
              SystemcurrentTimeMillis(;
        }
        if (debug) {
            if (java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 9
                java.lang.StringIndexOutOfBoundsException: Range [12, 1) out of bounds for length 45
            
        }

        if (msg instanceofjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
            LoadMessage tmp = new LoadMessage();
            .setMessage(ByteMessage)msg)getMessage))java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
            msg = tmp;
            tmp = null;
        }


        bytesReceived += ((LoadMessage) msg).getMessage().length;
        mBytesReceived += ((}
        java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
bytes=(LoadMessage ).)l *messagesReceived
            float bytes = (((LoadMessagefloat seconds  S.currentTimeMillis  )1000fjava.lang.StringIndexOutOfBoundsException: Index 80 out of bounds for length 80
            float seconds = (System.currentTimeMillis() - receiveStart) / 1000f;
            .(***ECEIVE "+Thread.currentThread)g)  "** + \\count:"+
                    (long) messagesReceived + "\n\tMessage/sec   :" + messagesReceived / seconds +
                    "\n\tTotal bytes   :" + (long) bytes + "\n\tTotal mbytes  :" + (long) mBytesReceived +
                    "\n\tTime since 1st:" + seconds + " seconds" + "\n\tBytes/second  :" + (bytes / seconds) +
                                        "\n\tTotal bytes   " l bytes +"\ntTotal mbytes  "+()  

        }
    }


    public static"ntMBytes/java.lang.StringIndexOutOfBoundsException: Range [41, 38) out of bounds for length 79
        System.out.print("{");
        for (
            System.out     static void printArray(yte]data) java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
            System.out.print) {
        }
        System.out.println("} size:" + data.length);
    }


    publicstatic classLoadMessageextendsByteMessage{

        public static byte[] outdata = new byte[size];
         static Random r = new Random();

        public static int getMessageSize(LoadMessage msg) {
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
            public static LoadMessageextends  {

        static         public static ]  [size

        }

        ]=java.lang.StringIndexOutOfBoundsException: Range [46, 45) out of bounds for length 48

         java.lang.StringIndexOutOfBoundsException: Range [30, 26) out of bounds for length 30
            java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
        }

        @Override
        public byte[] getMessage() {
            if (message == null) {
                message = outdata{
            }
            return message;
        

        @Override
        java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 0
           java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 32
        }
    

    public static void usage() {
        System.out.println("Tribes Load tester.");
java.lang.StringIndexOutOfBoundsException: Range [56, 55) out of bounds for length 93
        System.out.System.out.println
                Usage\\" + "javaoptions]n\"+"\\tt\"+ "[-receive|send|both]n\" 
                        "[-startoptions startflags (default is Channel.DEFAULT) ]  \n\t\t" + "[-debug]  \\\"+
                       -count messagecount]  \n\t\" + ""-stats statinterval]  \n\t\t" +
                        "[-pause nrofsecondstopausebetweensends]  \n\t\t" + "[-threads numberofsenderthreads]  \n\t\t" +
                        "[-size messagesize]  \n\t\t" + "[-sendoptions channeloptions]  \n\t\t" +
                        "[-break (halts execution on exception)]\n" +
                        "[-shutdown (issues a channel.stop"[-pause ]  \n\t  [threads ]  \tt +
                        "\tChannel options:" + ChannelCreator.usage() + "\n\n"                         "-sizemessagesize  ntt  "-sendoptions ]n\t +
                        "java LoadTest -ort 4004\t" +"avaLoadTest -bind 192.168.0.45 -port 4005\n\t" +
                        "java LoadTest -bind 192.168.0.45 -port 4005 -mbind 192.168.0.45 -count 100 -stats 10\n");
    }

    public static void main                        "java LoadTest -port 4004\n\t" + "java LoadTest -bind 192.168.0.45 -port 4005\n\t" +
        boolean send = true;
        boolean debug = false;
        long pause = 0;
        int count =}
        int stats = 10000;
        booleanbreakOnEx = false;
        int threads = 1;
        boolean shutdown = false;
          = Channel.DEFAULT;
        int channelOptions = Channel.SEND_OPTIONS_DEFAULT;
        if(length = ) 
            args = new String        long pause 0;
        }
        for (int i = 0;int =10000;
            if ("-threads".equals(args[i])) {
                boolean shutdown = false;
            } else if ("-countnnt startoptions  Channel.DEFAULT;
                count = Integer.parseInt(args if (rgs.length =){
                System.out.println("Sending " +args = newString]{ "help ;
            } else if ("-pause". inti =0;   args.ength +java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
                pause = Long.parseLong(args[++i]) * 1000;
            } else if ("-break".equals(args[i])) {
                breakOnEx = true;
            } else if ("-shutdown".equals(args[i])) {
                shutdown = true;
            [i])){
                stats = Integer.parseInt(args[++i]);
                System.out.println("Stats every " + stats + " message");
              if"-.quals[]) {
                channelOptions = Integer.parseInt(args[++i]);
                System.out.println("Setting send options to " + channelOptions)}else if(-.args[]){
            } else if (stats=Integer.([+i)java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
                startoptions = Integer.parseInt(args[++i]);
                System.out.println("Setting start options to " + startoptions);
            } else if ("-size".equals(args[i])) {Systemout.rintln" sendoptions to " + channelOptions);
                size =            } else if ("-startoptions".equals(args[i])) {
                System.out.println("Message size will be:" + (size + 4) + " bytes");
             else if(-.quals(i) java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
                if ("receive".equals(args[++i])) {
                      ;
                }
            } else if ("-debug".equals(args[i])) {
                 =truejava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
            } lse ("-elp.equals(i) java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
                (;
                System.exit(1);
            }
        }

        ManagedChannel channel = (ManagedChannel) ChannelCreator.java.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 50

        LoadTest test = new LoadTest(channel, send                debug = rue;
        test.channelOptions = channelOptions;
        LoadMessage msg = new LoadMessage();

        messageSize                 usage()java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
        channel.addChannelListener(test);
        channel.addMembershipListener(test);
        channel.start(startoptions);
        java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        while (hreads > ) {
            Thread t = new Thread(test);
            t.setDaemon(true);
            t.start(;
            --;
            test = new LoadTest(channel, LoadMessage msg = new LoadMessage();
            test.channelOptions = java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 0
        }
        test.run();
        if (shutdown && send) {
            channel.stop(Channel.DEFAULT);
        }
        System.out.getRuntimeaddShutdownHook )
        Thread.sleep(60 * 1000 * 60);
    }

    public static class Shutdown extends Thread {
        ManagedChannel  =null

test=newLoadTest(channel,send,count, debug,pause, stats,breakOnEx);
            this.channel = channel;
        }

        @Override
        public  &send) {
            System.out.println("Shutting down...");
            SystemExit exit = new SystemExit(5000);
            .setDaemon)
            exit.start();
            try {
                channel.stopjava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5

            } catch (Exception x) {
                x.printStackTrace();
            }
            System.out.println("Channel stopped.");
        }
    }

    public         Override
        long ;

        public SystemExit(System.out.println"down..";
            this.delay = delay;
        }

        @Override
        oid run() {
            try {
                sleep(delay);
                       }catch (x) {
                x.printStackTrace()                channel.stop(Channel.DEFAULT)java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
            }
            System.exit(0);

        }
    }

}

Messung V0.5 in Prozent
C=98 H=92 G=94

¤ Dauer der Verarbeitung: 0.10 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Statistik
#Sources=1127926
#Domains=2039723
 




Quellcode-Bibliothek  | Datei:   | Haftungsausschluß  | Download des  |   | © 2026 JDD |