admin@glassfish.java.net

Re: initial value of lastsampletime

From: Sankar Neelakandan <Sankar.Neelakandan_at_Sun.COM>
Date: Thu, 15 Oct 2009 17:00:45 -0700

May be Hans can tell us what he meant by this in JSR 77 spec.

JSR77.6.4.1.5
getLastSampleTime long getLastSampleTime()
Returns the time the most recent measurment was taken represented as a
long,whose value is the number of milliseconds since January 1, 1970,
00:00:00.


> And if, after that 10th hit, I do "get" 10 times, every one of them will
> return exactly the same data, until the next hit of the web page?
> hmm..actually I just tried this and the lastSampleTime gets updated
every time you do "get" with the current time. That doesn't seem right
to me.

What you are seeing is correct because stats is a continuously changing
entity and something else (being get command/GUI etc.,) who is
interested in the entity can take a measurement at a desired time
specified by lastSampleTime.

>>
>> The confusion is over whether "get" is *causing* the sampling, or is
>> just returning the sampled data that was caused by something else.
> the latter - returns the sampled data that was caused by something else
The example with processingtime shows the process of "how it is
calculated rather than how it is sampled."

>