Review Request for 6878481: Add performance counters in the JDK
David Holmes - Sun Microsystems
David.Holmes at Sun.COM
Sun Sep 13 23:08:21 UTC 2009
Just to add 2c to Alan's method naming comments:
Alan Bateman said the following on 09/13/09 18:07:
> Method naming is hard (and often subjective) but there are updates like
> this:
> PerfCounter.getParentDelegationTime.inc(t1 - t0);
> which might be easier to read as:
> PerfCounter.getParentDelegationCounter().addTime(t1 - t0)
There's always a problem with method naming when a thing can be both a
counter and a time-tracker. I would agree to use context specific
methods even at the expense of some redundancy in the public API eg:
addTime(long interval)
addElapsedTimeFrom(long startTime)
> Also:
> PerfCounter.getZipFileCount().inc();
> which might be cleaer as:
> PerfCounter.getZipFileCounter().increment();
I'd also suggest (in a convention used elsewhere eg
java.util.concurrent.atomic.*) that you reserve increment() for addition
of 1 and use add(long val) for the general case.
> Just a suggestion of course. Otherwise, looks okay to me and I'm looking
> forward to seeing the output once these changes are in.
Agreed - all looks good.
Thanks,
David
More information about the core-libs-dev
mailing list