nutch-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ken Krugler <kkrugler_li...@transpac.com>
Subject Re: Fetcher.java reporting incorrect kb/s?
Date Thu, 18 May 2006 19:05:28 GMT
kb/s is kilobits/second, not kilobytes/second. See 
<http://en.wikipedia.org/wiki/Kilobits>.

I agree that using the more explicit kbits/s would be better.

Related micro-nit...least according to 
http://en.wikipedia.org/wiki/Kilobit_per_second) it should be /1000, 
not /1024.

-- Ken

>I was just looking at the Fetcher.java code on trunk (r 407599), 
>snippet below.
>The total # of bytes is getting multiplied by 8 and the division by
>8.0 is missing;
>
>  private void reportStatus() throws IOException {
>    String status;
>    synchronized (this) {
>      long elapsed = (System.currentTimeMillis() - start)/1000;
>      status =
>        pages+" pages, "+errors+" errors, "
>        + Math.round(((float)pages*10)/elapsed)/10.0+" pages/s, "
>        + Math.round(((((float)bytes)*8)/1024)/elapsed)+" kb/s, ";
>                                                      ^^^
>    }
>    reporter.setStatus(status);
>  }
>
>thanks
>greg


-- 
Ken Krugler
Krugle, Inc.
+1 530-210-6378
"Find Code, Find Answers"

Mime
View raw message