Initial v1 #2

Merged
FrauJulian merged 3 commits from initial into master 2025-07-31 06:34:56 +00:00
3 changed files with 10047 additions and 0 deletions
Showing only changes of commit 6876e3f8d4 - Show all commits
+10000
View File
File diff suppressed because it is too large Load Diff
+1
View File
1
@@ -0,0 +1 @@
## TODO
copilot-pull-request-reviewer[bot] commented 2025-07-31 06:32:34 +00:00 (Migrated from github.com)
Review

The command uses 'dotnet-script' which is incorrect for PowerShell execution. It should be '.\DNSPerformanceTest.ps1' or 'powershell DNSPerformanceTest.ps1'.

.\DNSPerformanceTest.ps1 `
    -DnsServer "1.1.1.1" `
    -QueriesPerDomain 3 `
    -DomainsFile "Domains.txt" `
The command uses 'dotnet-script' which is incorrect for PowerShell execution. It should be '.\DNSPerformanceTest.ps1' or 'powershell DNSPerformanceTest.ps1'. ```suggestion .\DNSPerformanceTest.ps1 ` -DnsServer "1.1.1.1" ` -QueriesPerDomain 3 ` -DomainsFile "Domains.txt" ` ```
+46
View File
@@ -0,0 +1,46 @@
param(
copilot-pull-request-reviewer[bot] commented 2025-07-31 06:32:33 +00:00 (Migrated from github.com)
Review

The comment contains German text 'Domains einlesen' which should be in English for consistency. Consider changing to '# Read domains'.

# Read domains
The comment contains German text 'Domains einlesen' which should be in English for consistency. Consider changing to '# Read domains'. ```suggestion # Read domains ```
[string]$DnsServer = '1.1.1.1',
[int] $QueriesPerDomain = 3,
[string]$DomainsFile = 'Domains.txt',
[string]$ResultsFile = 'Results.csv'
)
# Domains einlesen
if (-not (Test-Path $DomainsFile)) {
Write-Error "Domains-File '$DomainsFile' not found."
exit 1
}
$domains = Get-Content $DomainsFile
"domain,query,response_ms" | Out-File -FilePath $ResultsFile -Encoding UTF8
foreach ($domain in $domains) {
for ($i = 1; $i -le $QueriesPerDomain; $i++) {
$sw = [System.Diagnostics.Stopwatch]::StartNew()
try {
Resolve-DnsName -Name $domain -Server $DnsServer -ErrorAction Stop | Out-Null
$sw.Stop()
$ms = [math]::Round($sw.Elapsed.TotalMilliseconds, 2)
}
catch {
$sw.Stop()
$ms = 'ERR'
}
Write-Host "[$domain] Query $($i): $($ms) ms"
"$($domain),$($i),$($ms)" | Out-File -FilePath $ResultsFile -Append -Encoding UTF8
}
}
# Statistik
$results = Import-Csv $ResultsFile | Where-Object { $_.response_ms -ne 'ERR' } `
| Select-Object @{n='response_ms';e={[double]$_.response_ms}}
$avg = [math]::Round(($results | Measure-Object response_ms -Average).Average,2)
$min = ($results | Measure-Object response_ms -Minimum).Minimum
$max = ($results | Measure-Object response_ms -Maximum).Maximum
Write-Host ''
Write-Host "==== Stats ===="
Write-Host "Average: $avg ms"
Write-Host "Shortest: $min ms"
Write-Host "Longest: $max ms"