Skip to content

Commit 9b87b2f

Browse files
committed
Apply requested changes.
1 parent 8d56da2 commit 9b87b2f

File tree

1 file changed

+4
-22
lines changed

1 file changed

+4
-22
lines changed

src/main/java/com/gcinterceptor/msgpush/MsgPush.java

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ public class MsgPush {
1919
private static final boolean USE_GCI = Boolean.parseBoolean(System.getenv("USE_GCI"));
2020
private static int MSG_SIZE;
2121
private static int WINDOW_SIZE;
22-
private static int COMPUTING_TIME_MS = 15;
23-
private static int SLEEP_TIME_MS = 5;
2422
private static byte[][] buffer;
2523
private static int msgCount;
2624

@@ -30,10 +28,6 @@ public class MsgPush {
3028
if (WINDOW_SIZE>0) {
3129
buffer = new byte[WINDOW_SIZE][MSG_SIZE];
3230
}
33-
try {
34-
SLEEP_TIME_MS = Integer.parseInt(System.getenv("SLEEP_TIME_MS"));
35-
} catch (NumberFormatException nfe){}
36-
3731
}
3832

3933
public static void main(String[] args) {
@@ -61,26 +55,14 @@ public static class HelloController {
6155
public void index() throws InterruptedException {
6256
byte[] byteArray = new byte[MSG_SIZE];
6357

64-
if (WINDOW_SIZE > 0) {
65-
buffer[msgCount++ % WINDOW_SIZE] = byteArray;
58+
for (long i = 0; i <= MSG_SIZE; i++) {
59+
byteArray[i] = (byte) i;
6660
}
6761

68-
long max = 5000;
69-
long count = 0;
70-
for (long i = 3; i <= max; i++) {
71-
boolean isPrime = true;
72-
for (long j = 2; j <= i / 2 && isPrime; j++) {
73-
isPrime = i % j > 0;
74-
}
75-
if (isPrime) {
76-
count++;
77-
}
62+
if (WINDOW_SIZE > 0) {
63+
buffer[msgCount++ % WINDOW_SIZE] = byteArray;
7864
}
7965

80-
81-
if (SLEEP_TIME_MS > 0) {
82-
Thread.sleep(SLEEP_TIME_MS);
83-
}
8466
}
8567
}
8668
}

0 commit comments

Comments
 (0)