A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/StackExchange/StackExchange.Redis/issues/2368 below:

RedisValue's Length() method · Issue #2368 · StackExchange/StackExchange.Redis · GitHub

Hi ,
I'm trying to collect statistics while using the Redis client ( in order to spot hot keys , big keys which are frequently used etc. ) on our PROD env , and wanted to use the RedisValue's Length() method , however seems it's only partially implemented -

StorageType.Null => 0,
StorageType.Raw => _memory.Length,
StorageType.String => Encoding.UTF8.GetByteCount((string)_objectOrSentinel!),
_ => throw new InvalidOperationException("Unable to compute length of type: " + Type),

Since the "Type" property is internal, I can't query the value in order to check whether it would be safe to call this method or not.

Is there any workaround / another suggestion ?

Thanks !!


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4