Harden ACC installer update and endpoint performance

This commit is contained in:
2026-08-04 10:27:10 +02:00
parent 22a4725056
commit 8888ab97c0
23 changed files with 581 additions and 77 deletions
+3 -2
View File
@@ -21,8 +21,9 @@
<!-- 168 Stunden = woechentlicher Abgleich mit der BizTalk-Umgebung. -->
<add key="EndpointDiscoveryIntervalHours" value="168" />
<add key="EndpointProbeTimeoutMilliseconds" value="3000" />
<add key="EndpointProbeMaxConcurrency" value="12" />
<add key="EndpointMaxCount" value="500" />
<add key="EndpointProbeMaxConcurrency" value="16" />
<!-- Bei 3 s Timeout und 16 parallelen Probes maximal ca. 21 s fuer 100 eindeutige Ziele. -->
<add key="EndpointMaxCount" value="100" />
<add key="QueryTimeoutSeconds" value="25" />
<!-- Testet die Anmeldung des privilegierten Provider-Kontos an den ermittelten BizTalk-Datenbanken. -->
@@ -391,18 +391,22 @@ namespace BizTalkCheckmkPulse
: CheckState.Ok;
var metrics = string.Format(
CultureInfo.InvariantCulture,
"biztalk_endpoints_configured={0};;;0|biztalk_endpoints_active={1};;;0|biztalk_endpoints_tested={2};;;0|biztalk_endpoints_available={3};;;0|biztalk_endpoints_failed={4};;1;0|biztalk_endpoints_unsupported={5};;1;0|biztalk_endpoints_inactive_skipped={6};;;0",
"biztalk_endpoints_configured={0};;;0|biztalk_endpoints_active={1};;;0|biztalk_endpoints_unique_targets={2};;;0|biztalk_endpoints_tested={3};;;0|biztalk_endpoints_available={4};;;0|biztalk_endpoints_failed={5};;1;0|biztalk_endpoints_unsupported={6};;1;0|biztalk_endpoints_inactive_skipped={7};;;0|biztalk_endpoint_probe_duration_ms={8};;;0",
endpointState.Configured,
endpointState.Active,
endpointState.UniqueTargets,
endpointState.Results.Count,
available,
failed.Length,
endpointState.UnsupportedActive,
endpointState.SkippedInactive);
endpointState.SkippedInactive,
endpointState.ProbeDurationMilliseconds);
var detail = new StringBuilder();
if (failed.Length == 0 && !incomplete)
{
detail.Append("Alle ").Append(endpointState.Active).Append(" aktiven, pruefbaren Send-/Receive-Endpunkte sind erreichbar");
detail.Append("Alle ").Append(endpointState.Active).Append(" aktiven, pruefbaren Send-/Receive-Endpunkte sind erreichbar")
.Append(" (unique_targets=").Append(endpointState.UniqueTargets)
.Append(", probe_ms=").Append(endpointState.ProbeDurationMilliseconds).Append(")");
}
else
{
@@ -410,7 +414,9 @@ namespace BizTalkCheckmkPulse
.Append(", tested=").Append(endpointState.Results.Count)
.Append(", available=").Append(available)
.Append(", failed=").Append(failed.Length)
.Append(", unsupported_external=").Append(endpointState.UnsupportedActive);
.Append(", unsupported_external=").Append(endpointState.UnsupportedActive)
.Append(", unique_targets=").Append(endpointState.UniqueTargets)
.Append(", probe_ms=").Append(endpointState.ProbeDurationMilliseconds);
AppendLimitedList(detail, "unavailable", failed.Select(x =>
EndpointConnectivityProbe.Display(x.Endpoint) + "(" + EmptyAsUnknown(x.Failure) + ")"));
if (!string.IsNullOrWhiteSpace(endpointState.Failure))
@@ -89,8 +89,8 @@ namespace BizTalkCheckmkPulse
MachineName = machine,
EnvironmentName = catalogEnvironment,
SynchronizedUtc = synchronizedUtc,
ActiveCandidates = ReadInt(root, "activeCandidates", 0, _maxEntries),
UnsupportedCandidates = ReadInt(root, "unsupportedCandidates", 0, _maxEntries)
ActiveCandidates = ReadInt(root, "activeCandidates", 0, 100000),
UnsupportedCandidates = ReadInt(root, "unsupportedCandidates", 0, 100000)
};
foreach (var node in root.Elements("Endpoint"))
@@ -120,7 +120,15 @@ namespace BizTalkCheckmkPulse
try
{
foreach (var probeResult in ProbeAllAsync(activeEntries).GetAwaiter().GetResult())
var probeStopwatch = Stopwatch.StartNew();
var probeResults = ProbeAllAsync(activeEntries).GetAwaiter().GetResult();
probeStopwatch.Stop();
state.ProbeDurationMilliseconds = probeStopwatch.ElapsedMilliseconds;
state.UniqueTargets = activeEntries
.Select(TargetKey)
.Distinct(StringComparer.OrdinalIgnoreCase)
.Count();
foreach (var probeResult in probeResults)
{
state.Results.Add(probeResult);
if (!probeResult.Available)
@@ -192,10 +200,9 @@ namespace BizTalkCheckmkPulse
{
var catalog = SynchronizeCatalog(existing, candidates, synchronizedUtc);
catalog.EnvironmentName = _options.EnvironmentName ?? string.Empty;
if (catalog.Entries.Count > _options.EndpointMaxCount
|| catalog.ActiveCandidates > _options.EndpointMaxCount)
if (catalog.Entries.Count > _options.EndpointMaxCount)
{
throw new InvalidDataException("Discovered endpoint candidates exceed EndpointMaxCount.");
throw new InvalidDataException("Probeable endpoints exceed EndpointMaxCount.");
}
return catalog;
@@ -221,7 +228,7 @@ namespace BizTalkCheckmkPulse
private async Task<IReadOnlyCollection<EndpointProbeResult>> ProbeAllAsync(EndpointCatalogEntry[] endpoints)
{
var unique = endpoints
.GroupBy(x => x.Protocol.ToUpperInvariant() + "|" + x.Host.ToUpperInvariant() + "|" + x.Port)
.GroupBy(TargetKey, StringComparer.OrdinalIgnoreCase)
.ToArray();
var outcomes = new Dictionary<string, NetworkOutcome>(StringComparer.OrdinalIgnoreCase);
using (var gate = new SemaphoreSlim(_options.EndpointProbeMaxConcurrency))
@@ -248,7 +255,7 @@ namespace BizTalkCheckmkPulse
return endpoints.Select(endpoint =>
{
var key = endpoint.Protocol.ToUpperInvariant() + "|" + endpoint.Host.ToUpperInvariant() + "|" + endpoint.Port;
var key = TargetKey(endpoint);
var outcome = outcomes[key];
return new EndpointProbeResult
{
@@ -260,6 +267,28 @@ namespace BizTalkCheckmkPulse
}).ToArray();
}
internal static long CalculateWorstCaseProbeMilliseconds(int targetCount, int concurrency, int timeoutMilliseconds)
{
if (targetCount <= 0)
{
return 0;
}
if (concurrency <= 0 || timeoutMilliseconds <= 0)
{
throw new ArgumentOutOfRangeException("concurrency");
}
return ((targetCount + concurrency - 1L) / concurrency) * timeoutMilliseconds;
}
private static string TargetKey(EndpointCatalogEntry endpoint)
{
return endpoint.Protocol.ToUpperInvariant()
+ "|" + endpoint.Host.ToUpperInvariant()
+ "|" + endpoint.Port;
}
private async Task<NetworkOutcome> ProbeOneAsync(EndpointCatalogEntry endpoint)
{
return string.Equals(endpoint.Protocol, "UDP", StringComparison.OrdinalIgnoreCase)
+2
View File
@@ -349,6 +349,8 @@ namespace BizTalkCheckmkPulse
public int Active { get; set; }
public int SkippedInactive { get; set; }
public int UnsupportedActive { get; set; }
public int UniqueTargets { get; set; }
public long ProbeDurationMilliseconds { get; set; }
public string Failure { get; set; }
public List<EndpointProbeResult> Results { get; private set; }
}
+2 -2
View File
@@ -85,8 +85,8 @@ namespace BizTalkCheckmkPulse
EndpointCatalogMaxBytes = 1048576;
EndpointDiscoveryIntervalHours = 168;
EndpointProbeTimeoutMilliseconds = 3000;
EndpointProbeMaxConcurrency = 12;
EndpointMaxCount = 500;
EndpointProbeMaxConcurrency = 16;
EndpointMaxCount = 100;
}
/// <summary>
+4
View File
@@ -102,6 +102,10 @@ namespace BizTalkCheckmkPulse
+ result.EndpointConnectivity.Active
+ " endpoints_failed="
+ result.EndpointConnectivity.Results.Count(x => !x.Available)
+ " endpoints_unique_targets="
+ result.EndpointConnectivity.UniqueTargets
+ " endpoint_probe_ms="
+ result.EndpointConnectivity.ProbeDurationMilliseconds
+ " elapsed_ms="
+ stopwatch.ElapsedMilliseconds);
return 0;
@@ -6,5 +6,5 @@ using System.Reflection;
[assembly: AssemblyDescription("Privileged BizTalk data provider and validated Checkmk snapshot consumer")]
[assembly: AssemblyCompany("BEW")]
[assembly: AssemblyProduct("BizTalk Checkmk Pulse")]
[assembly: AssemblyVersion("2.2.0.0")]
[assembly: AssemblyFileVersion("2.2.0.0")]
[assembly: AssemblyVersion("2.2.1.0")]
[assembly: AssemblyFileVersion("2.2.1.0")]