'time' for disk stats

we all know the time shell command

Is there a way to test disk i/o of a process in a similar fashion?

I am trying different methods to limit disk writes in a 24/7 daemon process and would like to
measure. I know pidstat does it but only to a running process, i want to do one shot test comparisons
with the daemon not running continuously.

This sounds interesting but not terribly clear to me.

First off, this is going to have to be a OS-centric approach. What OS/Hardware do you have?

The reason I ask is dtrace runs on some platforms - iosnoop and other tools written in dtrace can do exactly what you ask - assuming I understand it. dtrace is based partially on awk syntax. (see http://dtrace.org/blogs/brendan/2012/08/12/dtrace-training/\)
http://dtrace.org in general.

My take on what you need for a given pid, correct me where I am wrong:
time spent in I/O == (sum of I/O queue waits)/(unit time).

And again, a SAN can handle larger number of direct I/O requests than a single physical disk without much degradation of perofrmance. So I dunno too much here.

hi if its regarding the i/o satistsics u can try

iostat commnad

I am running debian on a virtual hosting provider.
no package for dtrace.

iostat is sort of what I want but it only works on running processes, I want to do comparison runs
one shot with the same data and get a total for each.

I want to do a run and get the details of blocks written to disk.

u can also may be try

sar 

command it has i/o wait column may be it may be useful

I got off my chair went upstairs and picked up my stevens.

The command acct does process accounting, writing data on termination of all processes. Ideal.

Hmm I tried but...
but i get zero io???

Unfortunately, on linux:

              
               comp_t    ac_io;        /* Characters transferred (unused) */
               comp_t    ac_rw;        /* Blocks read or written (unused) */
 

grrrrrrr! confounded linux.

Can you not just call pidstat just before the end of each run?

No, In the end i added a bit to copy /proc/pid/io just before exit.

a bit naff but there you go