From: Bill Middleton <wjm@metronet.com>
Subject: Who uses Profiling?  (Also archiver down)
To: arsperl@lurch.cit.buffalo.edu
Reply-To: arsperl@lurch.cit.buffalo.edu
X-Sent: 11 weeks, 1 day, 22 hours, 16 minutes, 55 seconds ago
X-From-Line: owner-arsperl@lurch.cit.buffalo.edu  Mon Jun 29 19:00:14 1998
Received: from lurch.cit.buffalo.edu (lurch.cit.buffalo.edu [128.205.10.9]) by smurfland.cit.buffalo.edu (8.8.5/8.8.2) with ESMTP id TAA00364 for <jcmurphy@smurfland.cit.buffalo.edu>; Mon, 29 Jun 1998 19:00:14 -0400 (EDT)
Received: (from daemon@localhost) by lurch.cit.buffalo.edu (8.8.5/8.8.2) id SAA10930 for arsperl-outgoing; Mon, 29 Jun 1998 18:58:19 -0400 (EDT)
Received: from metronet.com (wjm@fohnix.metronet.com [192.245.137.2]) by lurch.cit.buffalo.edu (8.8.5/8.8.2) with SMTP id SAA10924 for <arsperl@lurch.cit.buffalo.edu>; Mon, 29 Jun 1998 18:58:17 -0400 (EDT)
Received: by metronet.com id AA02137
  (5.67a/IDA1.5hp for arsperl@lurch.cit.buffalo.edu); Mon, 29 Jun 1998 17:58:06 -0500
Message-Id: <199806292258.AA02137@metronet.com>
X-Mailer: ELM [version 2.4 PL24]
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Sender: owner-arsperl@lurch.cit.buffalo.edu
Precedence: bulk
Xref: smurfland.cit.buffalo.edu arsperl:208
Lines: 31

I'm looking at the code for profiling in ARS Perl, and
I think that, to make it work everywhere, we maybe
should change the interface.  Currently, only the
$profile->{startTime} ever gets any value, the $profile->{endTime}
is not set in the code.  (Thus the call to time() in Dump_Users.pl
to get the endtime)

I propose the following:

Drop gettimeofday() in favor of clock(), initially during ARSLogin,
as it is currently.  Then, the call to ars_GetProfileInfo()
returns a reference which will contain $profile->{totalTime},
and $profile->{queries}.  The call will also reset $profile->{queries}
to 0 each time, and reset the clock.  Then, each time one
calls ars_GetProfileInfo(), you'll get the time and number of
calls since the last time you called it, or, if it's the first
call, then since you logged in.

I'll leave the startTime in there, setting it with time(), which
is also portable, but endTime will be gone, but again, it isn't
being set anyways.

Bill
