in sdk/src/Core/Sampling/RuleCache.cs [55:86]
public SamplingRule GetMatchedRule(SamplingInput input, TimeStamp time)
{
if (IsExpired(time))
{
return null;
}
SamplingRule matchedRule = null;
_cacheLock.EnterReadLock();
try
{
foreach (var item in _cache)
{
var rule = item.Value;
if (matchedRule != null)
{
break;
}
if (rule.Match(input) || rule.IsDefault())
{
matchedRule = rule;
}
}
}
finally
{
_cacheLock.ExitReadLock();
}
return matchedRule;
}