It seems you can modify cache statistics enablement for existing caches
using the setter on the cache instance. I was setting this flag in the
configuration for creating a new cache on the GetOrCreateCache(0 call,
which of course is ignored if the cache already exists.

I am still unsure why the peeking does not work. Given the use of the cache
Get() statistics most of my use case for using peeking is satisfied.
However, I am inspecting the content of the payload to derive some
additional internal metrics beyond just calls count (eg: payload size)
which are failing given the peeking oddness.

On Mon, Feb 24, 2025 at 11:23 PM Raymond Wilson <raymond_wil...@trimble.com>
wrote:

> FYI, I am using Ignite 2.16.
>
> I have also been playing with the Ignite metrics. This allows me to see
> the numbers of Get()'s for each cache, but I have a suspicion I can't
> enable it for existing caches.Is that correct? At least, when I enable it
> on an existing system I just get zeros back, but a new system appears to
> track the statistics as expected.
>
> Thanks,
> Raymond.
>
>
> On Fri, Feb 21, 2025 at 12:44 PM Raymond Wilson <
> raymond_wil...@trimble.com> wrote:
>
>> Apologies, Change
>>
>> { /* It was read from persistence */ }
>>
>> for
>>
>> {
>>  /* It needs to be read from persistence */
>>  result = _cache.Get(key);
>> }
>>
>> On Fri, Feb 21, 2025 at 12:39 PM Raymond Wilson <
>> raymond_wil...@trimble.com> wrote:
>>
>>> I am experimenting with some metrics to help us understand how often
>>> Cache.Get() operations are satisfied by returning a value already
>>> existing in memory, versus those that are satisfied by needing to read that
>>> content from the persistent store.
>>>
>>> The way I am attempting to do this is by using TryLocalPeek(), eg:
>>>
>>>       if (_cache.TryLocalPeek(key, out var result, CachePeekMode.Onheap,
>>> CachePeekMode.Offheap))
>>>       { /* It was already in memory */ }
>>>       else
>>>       { /* It was read from persistence */ }
>>>
>>> Oddly, it appears almost all calls are satisfied by the TryLocalPeek()
>>> call, even on a completely cold restarted system.
>>>
>>> Can anyone confirm if my expected behaviour here is correct (and there
>>> is a bug), or if I am 'doing it wrong' and there is a better way?
>>>
>>> Thanks,
>>> Raymond.
>>>
>>>
>>> --
>>> <http://www.trimble.com/>
>>> Raymond Wilson
>>> Trimble Distinguished Engineer, Civil Construction Software (CCS)
>>> 11 Birmingham Drive | Christchurch, New Zealand
>>> raymond_wil...@trimble.com
>>>
>>>
>>> <https://worksos.trimble.com/?utm_source=Trimble&utm_medium=emailsign&utm_campaign=Launch>
>>>
>>
>>
>> --
>> <http://www.trimble.com/>
>> Raymond Wilson
>> Trimble Distinguished Engineer, Civil Construction Software (CCS)
>> 11 Birmingham Drive | Christchurch, New Zealand
>> raymond_wil...@trimble.com
>>
>>
>> <https://worksos.trimble.com/?utm_source=Trimble&utm_medium=emailsign&utm_campaign=Launch>
>>
>
>
> --
> <http://www.trimble.com/>
> Raymond Wilson
> Trimble Distinguished Engineer, Civil Construction Software (CCS)
> 11 Birmingham Drive | Christchurch, New Zealand
> raymond_wil...@trimble.com
>
>
> <https://worksos.trimble.com/?utm_source=Trimble&utm_medium=emailsign&utm_campaign=Launch>
>


-- 
<http://www.trimble.com/>
Raymond Wilson
Trimble Distinguished Engineer, Civil Construction Software (CCS)
11 Birmingham Drive | Christchurch, New Zealand
raymond_wil...@trimble.com

<https://worksos.trimble.com/?utm_source=Trimble&utm_medium=emailsign&utm_campaign=Launch>

Reply via email to