Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Jan 1999 12:43:07 -0700 (MST)
From:      "Kenneth D. Merry" <ken@plutotech.com>
To:        pantzer@ludd.luth.se (Mattias Pantzare)
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: Device statistics
Message-ID:  <199901281943.MAA75529@panzer.plutotech.com>
In-Reply-To: <199901280843.JAA10784@zed.ludd.luth.se> from Mattias Pantzare at "Jan 28, 99 09:43:01 am"

next in thread | previous in thread | raw e-mail | index | archive | help
Mattias Pantzare wrote...
> > Mattias Pantzare wrote...
> > > I am trying to teach iostat to print the percent of time the disk is busy 
> > > (transactions in progress), for that I use the information in struct devstat.
> > > 
> > > The problem is that start_time is recorded using getmicrouptime. If I replace 
> > > that with getmicrotime I can do my magic.
> > > 
> > > Is there a function that I missed that can get the same time 
> > > as getmicrouptim but in userspace?
> > 
> > Try the kern.boottime sysctl variable.  That's what w/uptime uses to figure
> > out how long the machine has been up.
> > 
> > You can subtract the current time from the boot time to get the uptime.
> > 
> > I used getmicrouptime(), since it increases monotonically, unlike the
> > regular system time.  (e.g., you're running xntpd, and it steps the time
> > back some)
> 
> That means that I can't use the current time to subtreact from boot time, as 
> that won't give the same time...
> 
> If getmicrouptime was recorded in devstat when the sample is taken that would 
> work to (even better).

If you look at last_comp_time, that's the time of the most recent
transaction completion, as reported by getmicrouptime().

> > 
> > > Current temperature   99-01-28 00:19:17  -40.7 degrees Celsius (-41.2F) 
> > 
> > Wow, is that temperature accurate?
> 
> Yes. Some places have almost -50 C

Very impressive. :)

Ken
-- 
Kenneth Merry
ken@plutotech.com

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199901281943.MAA75529>