Xref: utzoo news.sysadmin:2281 comp.misc:5786 Newsgroups: news.sysadmin,comp.misc Path: utzoo!henry From: henry@utzoo.uucp (Henry Spencer) Subject: Re: computer charge back Message-ID: <1989Apr17.154821.2552@utzoo.uucp> Organization: U of Toronto Zoology References: <885@hawkmoon.MN.ORG> <1989Apr16.020150.1083@utzoo.uucp> <1318@rpi.edu> Date: Mon, 17 Apr 89 15:48:21 GMT In article <1318@rpi.edu> night@pawl.rpi.edu (Trip Martin) writes: >>... Do your users >>have any idea how much CPU time they use in normal interactive work? >>Almost certainly not... > >They can learn easily enough. The default .cshrc (assuming csh is available) >could be set up to display cpu usage after every command in an understandable >format. Users could be strongly encouraged to leave that feature enabled.... Well, apart from the fact that there is a standard shell and its name does *not* begin with 'c', the usual result of something like that is that the numbers are soon ignored as noise. It takes careful study to develop an intuition for something like that, and most users have work to do instead. >One thing that would be quite useful is a program which would show resource >usage in terms of real money... Agreed. Example: how many sites have an equivalent of "du" that shows the sizes in dollars rather than mysterious "blocks"? We do, and it's made a considerable difference in user behavior. (And yes, we did this after a long period of persistently explaining the conversion factor, and having the lesson, and the "du" command, largely ignored.) For those who are interested, I enclose the shell file that does it at the end of this posting; we call it "costperday". The bit of code it uses to find out the charging rate is system-specific, but the rest is portable. It tidies up the du output format a bit as well, to avoid having to explain to users why (e.g.) there's a "./" on the beginning of all the names. >... and to have it cumulative over the billing >period. That way users would quickly see what the real cost of their >computing is. I would observe that they already see what the real costs are, when they get the bills. What is needed is to develop intuition about costs, so people understand how to *change* the bills. It's not the same thing. Providing cumulative bill reporting is not too useful for developing intuition, because few users can be bothered with the constant inquiries needed to get real-time feedback on their activities. It's much easier to develop intuition for charges if you base your charges on things people already understand. (Radical notion, this: systems and policies should be adapted to human convenience rather than vice-versa!) People understand connect time. They fairly easily grasp the notion of storage space. They understand number of pages printed. They do not -- unless they're Computer Science students -- understand CPU time or memory use particularly well. Here's costperday: ------------- PATH=/bin:/usr/bin ; export PATH args="$*" set -- ''`awk '/^$/{exit} /^disk / { print $2, $3 }' /usr/adm/rates | sed 's/\\$//'` case $# in 2) ;; *) echo "$0: cannot locate rates information" >&2 exit 1 ;; esac cost="$1" per="$2" du $args | awk '{ cost = ($1/'$per')*'$cost' if ($2 == ".") place = "(total)" else if ($2 ~ /^\.\//) place = substr($2, 3) else place = $2 printf "$%.2f\t%s\n", cost, place }' ------------- -- Welcome to Mars! Your | Henry Spencer at U of Toronto Zoology passport and visa, comrade? | uunet!attcan!utzoo!henry henry@zoo.toronto.edu