Web server - 138 CHAPTER 5 PERFORMANCE THROUGH THE APPLICATION

138 CHAPTER 5 PERFORMANCE THROUGH THE APPLICATION DEVELOPMENT LIFE CYCLE for( int i=0; i<10; i++ ) { DataPoint dp = new DataPoint( new Date(), heapValue, heapMin, heapMax ); this.sampleHeap.addDataPoint( dp ); try { Thread.sleep( 50 ); } catch( Exception e ) { } // Update the heap values heapMin -= 1.0; heapMax += 1.0; heapValue += 1.0; } } public void testMin() { assertEquals( 41.0, this.sampleHeap.getMin(), 0.001 ); } public void testMax() { assertEquals( 159.0, this.sampleHeap.getMax(), 0.001 ); } public void testAve() { assertEquals( 104.5, this.sampleHeap.getAve(), 0.001 ); } public void testMaxRange() { assertEquals( 118.0, this.sampleHeap.getMaxRange(), 0.001 ); } public void testRange() { assertEquals( 118.0, this.sampleHeap.getRange(), 0.001 ); }
Note: In case you are looking for affordable webhost to host and run your servlet application check Vision make web site services

Leave a Reply