admin@glassfish.java.net

Re: initial value of lastsampletime

From: Bill Shannon <bill.shannon_at_sun.com>
Date: Fri, 16 Oct 2009 12:50:29 -0700

And what should its value be if no sample was ever taken?


Hans Hrasna wrote on 10/16/09 12:48:
> Hi,
>
> lastSampleTime is the time that the measurement was taken. For example,
> if measurements are being taken every hour and being stored in a
> variable or table, then the lastSampleTime should reflect the time the
> data was sampled and stored. Or for example if measurements are being
> taken every time an event occurs, like a connection, then the
> lastSampleTime is the time of the last event.
>
> -Hans
>
>
> Sankar Neelakandan wrote:
>> 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."
>>
>>>
>