Exemplo n.º 1
0
        public static void AssertTag(MetricsRecord record, string tagName, string expectedValue
                                     )
        {
            MetricsTag processIdTag = GetFirstTagByName(record, tagName);

            NUnit.Framework.Assert.IsNotNull(processIdTag);
            Assert.Equal(expectedValue, processIdTag.Value());
        }
Exemplo n.º 2
0
        public override bool Accepts(MetricsTag tag)
        {
            // Accept if whitelisted
            Pattern ipat = includeTagPatterns[tag.Name()];

            if (ipat != null && ipat.Matcher(tag.Value()).Matches())
            {
                return(true);
            }
            // Reject if blacklisted
            Pattern epat = excludeTagPatterns[tag.Name()];

            if (epat != null && epat.Matcher(tag.Value()).Matches())
            {
                return(false);
            }
            // Reject if no match in whitelist only mode
            if (!includeTagPatterns.IsEmpty() && excludeTagPatterns.IsEmpty())
            {
                return(false);
            }
            return(true);
        }
Exemplo n.º 3
0
        private void SetAttrCacheTag(MetricsTag tag, int recNo)
        {
            string key = TagName(tag.Name(), recNo);

            attrCache[key] = new Attribute(key, tag.Value());
        }