private bool IsInterestingTrace(TraceEvent data) { // vshub.exe internally uses ApplicationInsights if (data.PayloadNames.Length > 1 && data.PayloadString(1) == "vshub.exe") { return(false); } bool result = true; if (data.PayloadNames.Length > 0) { int id = (int)data.ID; // Not system event if ((id > 0) && (id < 65534)) { string domainName = data.PayloadString(data.PayloadNames.Length - 1); result = domainName.StartsWith("/LM/W3SVC") || domainName.StartsWith("ConsoleApp"); } } else { TraceAssert.IsTrue(false, "Trace must have at least 1 parameter - appDomain name"); this.FailureDetected = true; } return(result); }
private void TestAppDomainNameIsTheLastPayloadParameter(TraceEvent data) { if (data.PayloadNames.Length > 0) { int id = (int)data.ID; // Not system event if ((id > 0) && (id < 65534)) { string domainName = data.PayloadString(data.PayloadNames.Length - 1); bool correctName = TraceAssert.IsTrue( domainName.StartsWith("/LM/W3SVC"), "Every message must have application name as the last parameter to enable StatusMonitor integration: " + domainName); this.FailureDetected = !correctName || this.FailureDetected; } } else { TraceAssert.IsTrue(false, "Trace must have at least 1 parameter - appDomain name"); this.FailureDetected = true; } }