Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Eric L

macrumors member
Original poster
Jan 25, 2008
58
0
Does anyone know where I might find a Widget that can tell me the rate that information is being passed to or from my various hard drives in real time (i.e. Mb/s)? I googled but came up empty. If not, would anyone be interested in developing one? I don't know squat about programming.
 

lee1210

macrumors 68040
Jan 10, 2005
3,182
3
Dallas, TX
Does it have to be a widget?

Do you need each drive separately or would a total of the data transfer to/from the disk subsystem work?

Activity monitor has the latter, but it may not work for you.

-Lee
 

HiRez

macrumors 603
Jan 6, 2004
6,265
2,630
Western US
Also not a widget, but MenuMeters is awesome, and it's free. Not only will it indicate hard drive activity, but can monitor memory, cpu, and networking, all in a compact space in your menu bar. I always have it installed on every Mac I use.

EDIT: Oops, I see you need the transfer rate. Well, MenuMeters doesn't show that (just network bandwidth) but it's still awesome. Might be worth emailing the developer about, they might be able to add that option.
 

Eric L

macrumors member
Original poster
Jan 25, 2008
58
0
I thought it would be interesting and telling to see the different connections (USB, FW, etc) and drives in action, real-time. I thought a widget would be easiest and unobtrusive.
 

todd2000

macrumors 68000
Nov 14, 2005
1,626
11
Danville, VA
It's not a widget, but Activity Monitor will do this for you. It's in your Utilities folder. Just click on the Disk Activity tab on the bottom.
 

lee1210

macrumors 68040
Jan 10, 2005
3,182
3
Dallas, TX
This seems to be the meat of this widget:
Code:
function disky(){
	if(number!=1){
			window.resizeTo(wid, (number*33)+46);
		}else{
			window.resizeTo(wid, (number*33)+47);
		}
	
	line = widget.system("/bin/df -l -k", null).outputString;	
	n=line.split("\n");
	j=0;
	listline=new Array();
	max=0;
	for(i=1;i<n.length-1;i++){
		listline[j] = n[i].split(" ");
		j++;
	}
	clistline=new Array();
	names={};
	capacities={};
	percents={};
	diskets={};
	if(widget.preferenceForKey("indicator")=="d" && timist!=50){
		bill = widget.system("/usr/sbin/iostat -d -c 2", tracker);	
	}
	for(i in listline){
		j=0;
		clistline[i]=new Array();
		for(l in listline[i]){
			if(listline[i][l]!==" " && listline[i][l]!==""){
				clistline[i][j]=listline[i][l];
				j++;
			}
		}
		names[i]="";
		for(j=5;j<clistline[i].length-1;j++) 
			names[i]=names[i]+clistline[i][j].replace("/Volumes/","")+' ';
		names[i]=names[i]+clistline[i][j].replace("/Volumes/","");
		if(names[i]=="/")
			names[i]='/ <span style="font-size:10px">'+getLocalizedString('root')+'</span>';
		capacities[i]=clistline[i][1];
		if(capacities[i]/capacities[max]>1){
			max=i;
		}
		if(widget.preferenceForKey("numer")=="d")
			avalables[i]=Math.floor(100*clistline[i][3]/(1024*1024))/100;
		percents[i]=clistline[i][4].replace("%","");
		if(i==0){
			diskets[0]=parseInt(clistline[i][0].replace("/dev/disk","").split("s")[0]);
		}else if(clistline[i][0].replace("/dev/disk","").split("s")[0]==clistline[i-1][0].replace("/dev/disk","").split("s")[0]){
			diskets[i]=diskets[i-1];
		}else{
			diskets[i]=diskets[i-1]+1;
		}
	}
}

As far as I can tell it is wrapping df and iostat. This is a tack that the OP could take. I don't know if iostat performs privileged calls to the kernel or not in Darwin, but someone could grab the Darwin source and check out what iostat is doing to get this info, and perhaps those calls could be used in a new program.

This may be just the thing for the OP though, i'm just mentioning this for academic reasons more than anything.

-Lee
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.