From nobody@FreeBSD.org  Tue Jul 14 16:08:09 2009
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AFC771065676
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 14 Jul 2009 16:08:09 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 9DC1A8FC0C
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 14 Jul 2009 16:08:09 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n6EG89O9006250
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 14 Jul 2009 16:08:09 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id n6EG89l8006249;
	Tue, 14 Jul 2009 16:08:09 GMT
	(envelope-from nobody)
Message-Id: <200907141608.n6EG89l8006249@www.freebsd.org>
Date: Tue, 14 Jul 2009 16:08:09 GMT
From: Vladimir Krasovsky <vovets@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: iostat displays wrong I/O statistics with -c 1
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         136759
>Category:       bin
>Synopsis:       iostat(8) displays wrong I/O statistics with -c 1
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jul 14 16:10:00 UTC 2009
>Closed-Date:    Wed Jan 13 20:05:23 UTC 2010
>Last-Modified:  Wed Jan 13 20:05:23 UTC 2010
>Originator:     Vladimir Krasovsky
>Release:        7.0
>Organization:
yandex.ru
>Environment:
FreeBSD host 7.0-STABLE FreeBSD 7.0-STABLE #1: Fri Feb 29 14:05:58 MSK 2008     root@host:/opt/obj/opt/src/sys/W5L_AMD64_ULE  amd64
>Description:
First line of iostat output always displays arbitrary (and wrong) numbers.
user@host:~$ for i in 1 2 3 4; do iostat -c $i -d da2; done
             da2 
  KB/t tps  MB/s 
  6.31  64  0.40 
             da2 
  KB/t tps  MB/s 
  6.31  64  0.40 
 12.64  53  0.65 
             da2 
  KB/t tps  MB/s 
  6.31  64  0.40 
  6.67  27  0.18 
  2.00  23  0.04 
             da2 
  KB/t tps  MB/s 
  6.31  64  0.40 
  2.00  23  0.04 
  3.27  11  0.04 
  7.25  16  0.11 

As you can see the first line is always the same. Though on different machines at different loads it may differ.
>How-To-Repeat:
for i in 1 2 3 4; do iostat -c $i -d da2; done
>Fix:
Use -c 2 or more.

>Release-Note:
>Audit-Trail:

From: Efstratios Karatzas <gpf.kira@gmail.com>
To: bug-followup@freebsd.org, vovets@gmail.com
Cc:  
Subject: Re: bin/136759: iostat(8) displays wrong I/O statistics with -c 1
Date: Wed, 13 Jan 2010 16:40:48 +0200

 Hi there,
 
 This is definitely not a bug. Take a look at the freebsd man page for iostat(8)
 
 http://www.freebsd.org/cgi/man.cgi?query=iostat&apropos=0&sektion=8&manpath=FreeBSD+8.0-RELEASE&format=html
 
 The manual clearly states that :
 "The first statistics that are printed are averaged over
  the system uptime.  To get information about the current activity, a
  suitable wait time should be specified, so that the subsequent sets of
  printed statistics will be averaged over that time."
 
 So the first line of statistics always contains the "average
 statistics" since the system started running.
 If you want to get the statistics for the next 5 secs try something
 like iostat -c 6 -d some_device
 
 Hope this helps
 
 -- 
 
 Efstratios "GPF" Karatzas
State-Changed-From-To: open->closed 
State-Changed-By: gavin 
State-Changed-When: Wed Jan 13 20:04:48 UTC 2010 
State-Changed-Why:  
As explained by Efstratios Karatzas in the PR trail, this is not a bug. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=136759 
>Unformatted:
