MCPcopy Create free account
hub / github.com/apache/tomcat / run

Method run

test/org/apache/catalina/tribes/demos/LoadTest.java:101–166  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

99
100
101 @Override
102 public void run() {
103
104 long counter = 0;
105 long total = 0;
106 LoadMessage msg = new LoadMessage();
107
108 try {
109 startTest();
110 while (total < msgCount) {
111 if (channel.getMembers().length == 0 || (!send)) {
112 synchronized (mutex) {
113 try {
114 mutex.wait();
115 } catch (InterruptedException x) {
116 log.info("Thread interrupted from wait");
117 }
118 }
119 } else {
120 try {
121 // msg.setMsgNr((int)++total);
122 counter++;
123 if (debug) {
124 printArray(msg.getMessage());
125 }
126 channel.send(channel.getMembers(), msg, channelOptions);
127 if (pause > 0) {
128 if (debug) {
129 System.out.println("Pausing sender for " + pause + " ms.");
130 }
131 Thread.sleep(pause);
132 }
133 } catch (ChannelException x) {
134 if (debug) {
135 log.error("Unable to send message:" + x.getMessage(), x);
136 }
137 log.error("Unable to send message:" + x.getMessage());
138 ChannelException.FaultyMember[] faulty = x.getFaultyMembers();
139 for (ChannelException.FaultyMember faultyMember : faulty) {
140 log.error("Faulty: " + faultyMember);
141 }
142 --counter;
143 if (this.breakonChannelException) {
144 throw x;
145 }
146 }
147 }
148 if ((counter % statsInterval) == 0 && (counter > 0)) {
149 // add to the global counter
150 counter = addSendStats(counter);
151 // print from the global counter
152 // printSendStats(LoadTest.messagesSent, LoadTest.messageSize, LoadTest.messageSendTime);
153 printSendStats(messagesSent, messageSize);
154
155 }
156
157 }
158 } catch (Exception x) {

Callers 1

mainMethod · 0.95

Calls 14

startTestMethod · 0.95
printArrayMethod · 0.95
getMessageMethod · 0.95
addSendStatsMethod · 0.95
printSendStatsMethod · 0.95
endTestMethod · 0.95
waitMethod · 0.80
getFaultyMembersMethod · 0.80
getMembersMethod · 0.65
infoMethod · 0.65
sendMethod · 0.65
errorMethod · 0.65

Tested by

no test coverage detected