Skip to content

Commit

Permalink
fix: remove metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
riemannulus committed Oct 10, 2024
1 parent f0c695a commit b61fbd5
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions src/Libplanet.Store/HashNodeCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ namespace Libplanet.Store
/// </summary>
public class HashNodeCache
{
private readonly Meter _hashNodeCacheMeter = new Meter("Libplanet.Store.HashNodeCache");

// FIXME: Tuned to 9c mainnet. Should be refactored to accept cache size as an argument.
private const int _cacheSize = 524_288;

Expand All @@ -28,27 +26,6 @@ internal HashNodeCache()
.WithExpireAfterAccess(TimeSpan.FromMinutes(10))
.WithCapacity(_cacheSize)
.Build();

if (_cache.Metrics.Value is null)
{
return;
}

_hashNodeCacheMeter.CreateObservableGauge(
"CacheSize",
() => _cache.Count);
_hashNodeCacheMeter.CreateObservableCounter(
"CacheHit",
() => _cache.Metrics.Value.Hits);
_hashNodeCacheMeter.CreateObservableCounter(
"CacheMiss",
() => _cache.Metrics.Value.Misses);
_hashNodeCacheMeter.CreateObservableCounter(
"CacheEviction",
() => _cache.Metrics.Value.Evicted);
_hashNodeCacheMeter.CreateObservableCounter(
"CacheTotal",
() => _cache.Metrics.Value.Total);
}

public bool TryGetValue(HashDigest<SHA256> hash, out IValue? value)
Expand Down

0 comments on commit b61fbd5

Please sign in to comment.