Return-Path: Delivered-To: apmail-avalon-cvs-archive@www.apache.org Received: (qmail 94711 invoked from network); 5 Feb 2004 16:17:22 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 5 Feb 2004 16:17:22 -0000 Received: (qmail 16702 invoked by uid 500); 5 Feb 2004 15:28:06 -0000 Delivered-To: apmail-avalon-cvs-archive@avalon.apache.org Received: (qmail 16626 invoked by uid 500); 5 Feb 2004 15:28:05 -0000 Mailing-List: contact cvs-help@avalon.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Avalon CVS List" Reply-To: "Avalon Developers List" Delivered-To: mailing list cvs@avalon.apache.org Received: (qmail 16591 invoked by uid 500); 5 Feb 2004 15:28:05 -0000 Received: (qmail 16571 invoked from network); 5 Feb 2004 15:28:05 -0000 Received: from unknown (HELO minotaur.apache.org) (209.237.227.194) by daedalus.apache.org with SMTP; 5 Feb 2004 15:28:05 -0000 Received: (qmail 55711 invoked by uid 1433); 5 Feb 2004 15:28:09 -0000 Date: 5 Feb 2004 15:28:09 -0000 Message-ID: <20040205152809.55710.qmail@minotaur.apache.org> From: leif@apache.org To: avalon-excalibur-cvs@apache.org Subject: cvs commit: avalon-excalibur/instrument-manager/src/java/org/apache/excalibur/instrument/manager/http HTMLSampleHandler.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N leif 2004/02/05 07:28:09 Modified: instrument-manager/src/java/org/apache/excalibur/instrument/manager/http HTMLSampleHandler.java Log: Fix a problem where a machine suspended for a few hours while viewing a sample page with auto refresh enabled was causing several thousand requests for sample images when it was resumed. This was due to the javascript involved making use of the setInterval function which was trying to catch up. We now use setTimeout which is always relative to when it is set. Revision Changes Path 1.2 +30 -8 avalon-excalibur/instrument-manager/src/java/org/apache/excalibur/instrument/manager/http/HTMLSampleHandler.java Index: HTMLSampleHandler.java =================================================================== RCS file: /home/cvs/avalon-excalibur/instrument-manager/src/java/org/apache/excalibur/instrument/manager/http/HTMLSampleHandler.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- HTMLSampleHandler.java 9 Nov 2003 16:36:33 -0000 1.1 +++ HTMLSampleHandler.java 5 Feb 2004 15:28:09 -0000 1.2 @@ -210,21 +210,43 @@ out.println( "

Data Samples (Plain)

" ); + // Originally, the JavaScript timer in the page made use of the setInterval + // function to build a simple timer. This worked fine under normal + // operation. But if a browser was suspended for 1 hour with a timer + // running at 1 second intervals, the timer would try to catch up when + // the machine was resumed. This would result in the timer firing 3600 + // times over the course of a few seconds. The sudden burst of requests + // was swamping the server. + // The current scripts below now always reset the timer each time it is + // fired. If the timer ever falls behind it will recover smoothly + // without trying to catch up. While not quite as accurate it is + // sufficient for our purposes. + out.println( "" ); out.println( "
" ); @@ -232,7 +254,7 @@ tableCell( out, "" ); endTable( out ); out.println( "Refresh rate:" ); - out.println( "" ); + out.println( "" ); out.println( "" ); out.println( "" ); out.println( "" ); --------------------------------------------------------------------- To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org For additional commands, e-mail: cvs-help@avalon.apache.org