lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cmarsch...@apache.org
Subject cvs commit: jakarta-lucene-sandbox/contributions/webcrawler-LARM/src/de/lanlab/larm/fetcher ThreadMonitor.java
Date Tue, 22 Oct 2002 15:16:35 GMT
cmarschner    2002/10/22 08:16:35

  Modified:    contributions/webcrawler-LARM/src/de/lanlab/larm/fetcher
                        ThreadMonitor.java
  Log:
  minor display changes
  
  Revision  Changes    Path
  1.4       +17 -6     jakarta-lucene-sandbox/contributions/webcrawler-LARM/src/de/lanlab/larm/fetcher/ThreadMonitor.java
  
  Index: ThreadMonitor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene-sandbox/contributions/webcrawler-LARM/src/de/lanlab/larm/fetcher/ThreadMonitor.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ThreadMonitor.java	17 Jun 2002 13:59:28 -0000	1.3
  +++ ThreadMonitor.java	22 Oct 2002 15:16:35 -0000	1.4
  @@ -197,6 +197,7 @@
   
           try
           {
  +            // FIXME: at least take SimpleLogger, if not something else
               File logDir = new File("logs");
               logDir.mkdir();
               logWriter = new PrintWriter(new BufferedWriter(new FileWriter("logs/ThreadMonitor.log")));
  @@ -264,6 +265,7 @@
                       State state = thread.getTaskState();
                       //StringBuffer sb = new StringBuffer(200);
                       sb.setLength(0);
  +
                       System.out.println(sb + "[" + thread.getThreadNumber() + "] " + state.getState()
+ " for " +
                                          (now - state.getStateSince() ) + " ms " +
                                          (state.getInfo() != null ? "(" + state.getInfo()
+")" : "")
  @@ -325,10 +327,12 @@
                   double bytesPerSecond = getAverageBytesRead();
                   double docsPerSecond = getAverageDocsRead();
                   sb.setLength(0);
  -                System.out.println(sb + "\nBytes total:          " + formatBytes(overallBytesRead)
+ "  (" + formatBytes((long)(((double)overallBytesRead)*1000/(System.currentTimeMillis()-startTime)))
+ " per second since start)" +
  -                                   "\nBytes per Second:     " + formatBytes((int)bytesPerSecond)
+ " (50 secs)" +
  -                                   "\nDocs per Second:      " + docsPerSecond +
  -                                   "\nBytes per Thread:     " + bytesReadString);
  +                System.out.print(sb + "\nBytes total:          ");
  +                System.out.print(formatBytes(overallBytesRead) + "  (" + formatBytes((long)(((double)overallBytesRead)*1000/(System.currentTimeMillis()-startTime)))
+ " per second since start)");
  +                System.out.print("\nBytes per Second:     " + formatBytes((int)bytesPerSecond)
+ " (50 secs)");
  +                System.out.print(                   "\nDocs per Second:      " + docsPerSecond);
  +                String bs = bytesReadString.toString();
  +                System.out.print(                   "\nBytes per Thread:     " + bs + "\n");
                   double docsPerSecondTotal = ((double)overallTasksRun)*1000/(System.currentTimeMillis()-startTime);
                   sb.setLength(0);
                   System.out.println(sb + "Docs read total:      " + overallTasksRun + "
   Docs/s: " + fractionFormat.format(docsPerSecondTotal) +
  @@ -361,7 +365,7 @@
                   if(!isWorkingOnMessage && (urlsQueued == 0) && (urlsWaiting
== 0) && allThreadsIdle)
                   {
                       nothingReadCount++;
  -                    if(nothingReadCount > 3)
  +                    if(nothingReadCount > 20)
                       {
                           SimpleLoggerManager.getInstance().flush();
                           System.exit(0);
  @@ -389,6 +393,13 @@
                       System.gc();
                       SimpleLoggerManager.getInstance().flush();
                   }
  +
  +            }
  +            catch(NoSuchMethodError e)
  +            {
  +                e.printStackTrace();
  +                //System.out.println("cause: " + e.getCause());
  +                System.out.println("msg: " + e.getMessage());
   
               }
               catch(Exception e)
  
  
  

--
To unsubscribe, e-mail:   <mailto:lucene-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-dev-help@jakarta.apache.org>


Mime
View raw message