@@ -19,8 +19,6 @@ public class MsgPush {
19
19
private static final boolean USE_GCI = Boolean .parseBoolean (System .getenv ("USE_GCI" ));
20
20
private static int MSG_SIZE ;
21
21
private static int WINDOW_SIZE ;
22
- private static int COMPUTING_TIME_MS = 15 ;
23
- private static int SLEEP_TIME_MS = 5 ;
24
22
private static byte [][] buffer ;
25
23
private static int msgCount ;
26
24
@@ -30,10 +28,6 @@ public class MsgPush {
30
28
if (WINDOW_SIZE >0 ) {
31
29
buffer = new byte [WINDOW_SIZE ][MSG_SIZE ];
32
30
}
33
- try {
34
- SLEEP_TIME_MS = Integer .parseInt (System .getenv ("SLEEP_TIME_MS" ));
35
- } catch (NumberFormatException nfe ){}
36
-
37
31
}
38
32
39
33
public static void main (String [] args ) {
@@ -61,26 +55,14 @@ public static class HelloController {
61
55
public void index () throws InterruptedException {
62
56
byte [] byteArray = new byte [MSG_SIZE ];
63
57
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 ;
66
60
}
67
61
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 ;
78
64
}
79
65
80
-
81
- if (SLEEP_TIME_MS > 0 ) {
82
- Thread .sleep (SLEEP_TIME_MS );
83
- }
84
66
}
85
67
}
86
68
}
0 commit comments