Skip to content

Commit e1aafba

Browse files
authored
Merge pull request #28 from frankovo/release/0.3.1
refactor pyproject.toml cli.py analysis.py readme.md readme-pypi.md
2 parents 8ae6bb6 + c795ed1 commit e1aafba

File tree

8 files changed

+59
-57
lines changed

8 files changed

+59
-57
lines changed

README-pypi.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
<div align="center">
2-
3-
# DNS Benchmark Tool
4-
5-
**Fast, comprehensive DNS performance testing**
6-
7-
Part of [BuildTools](https://buildtools.net) - Network Performance Suite
1+
<p align="center">
2+
<h1>DNS Benchmark Tool</h1>
3+
<strong>Fast, comprehensive DNS performance testing</strong><br>
4+
Part of <a href="https://buildtools.net">BuildTools</a> - Network Performance Suite
5+
</p>
86

97
```bash
108
pip install dns-benchmark-tool
@@ -15,15 +13,17 @@ dns-benchmark benchmark --use-defaults
1513

1614
> 🎉 **1,400+ downloads this week!** Thank you to our growing community.
1715
18-
**Real Time Tracking**
19-
20-
![Real Time Tracking](https://raw.githubusercontent.com/frankovo/dns-benchmark-tool/main/docs/real_time_tracking.gif)
21-
*Watch DNS queries in motion*
22-
23-
</div>
16+
</p>
2417

2518
---
2619

20+
<p align="center">
21+
<strong>Real Time Tracking</strong> <br>
22+
<img src="https://raw.githubusercontent.com/frankovo/dns-benchmark-tool/main/docs/real_time_tracking.gif" alt="Real Time Tracking">
23+
<br>
24+
<span>Watch DNS queries in motion</span>
25+
</p>
26+
2727
## 🎉 Today’s Release Highlights ![new](https://img.shields.io/pypi/v/dns-benchmark-tool.svg?color=brightgreen&label=new)
2828

2929
We’ve added **three powerful CLI commands** to make DNS benchmarking even more versatile:
@@ -48,8 +48,8 @@ dns-benchmark monitoring --use-defaults --interval 30 --duration 3600 \
4848
[![Publish to TestPyPI](https://github.com/frankovo/dns-benchmark-tool/actions/workflows/testpypi.yml/badge.svg)](https://github.com/frankovo/dns-benchmark-tool/actions/workflows/testpypi.yml)
4949
[![Publish to PyPI](https://github.com/frankovo/dns-benchmark-tool/actions/workflows/pypi.yml/badge.svg)](https://github.com/frankovo/dns-benchmark-tool/actions/workflows/pypi.yml)
5050
[![PyPI version](https://img.shields.io/pypi/v/dns-benchmark-tool.svg?color=brightgreen)](https://pypi.org/project/dns-benchmark-tool/)
51+
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/dns-benchmark-tool.svg)](https://pypi.org/project/dns-benchmark-tool/)
5152

52-
![Python Version](https://img.shields.io/badge/python-3.9%2B-blue.svg)
5353
![License](https://img.shields.io/badge/license-MIT-green.svg)
5454
![Coverage](https://img.shields.io/badge/coverage-87%25-brightgreen.svg)
5555

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ dns-benchmark monitoring --use-defaults --interval 30 --duration 3600 \
4949
[![Publish to TestPyPI](https://github.com/frankovo/dns-benchmark-tool/actions/workflows/testpypi.yml/badge.svg)](https://github.com/frankovo/dns-benchmark-tool/actions/workflows/testpypi.yml)
5050
[![Publish to PyPI](https://github.com/frankovo/dns-benchmark-tool/actions/workflows/pypi.yml/badge.svg)](https://github.com/frankovo/dns-benchmark-tool/actions/workflows/pypi.yml)
5151
[![PyPI version](https://img.shields.io/pypi/v/dns-benchmark-tool.svg?color=brightgreen)](https://pypi.org/project/dns-benchmark-tool/)
52+
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/dns-benchmark-tool.svg)](https://pypi.org/project/dns-benchmark-tool/)
5253

53-
![Python Version](https://img.shields.io/badge/python-3.9%2B-blue.svg)
5454
![License](https://img.shields.io/badge/license-MIT-green.svg)
5555
![Coverage](https://img.shields.io/badge/coverage-87%25-brightgreen.svg)
5656

docs/real_time_tracking.gif

-13.3 MB
Loading

pyproject.toml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@ build-backend = "setuptools.build_meta"
55
[project]
66
name = "dns-benchmark-tool"
77
version = "0.3.0"
8-
description = "Benchmark DNS resolvers across domains and record types with analytics and reports (CSV, Excel, PDF, JSON)."
9-
readme = "README-pypi.md"
8+
description = "Fast, comprehensive DNS performance testing with DNSSEC validation, DoH/DoT support, and enterprise features."
9+
readme = { file = "README-pypi.md", content-type = "text/markdown" }
1010
authors = [
1111
{ name = "Joseph Oseh Frank", email = "frank@osehfrank.com" }
1212
]
1313
license = { text = "MIT" }
14-
requires-python = ">=3.9"
14+
requires-python = ">=3.9,<3.13"
15+
keywords = ["DNS", "benchmark", "performance", "DNSSEC", "DoH", "DoT", "networking", "latency", "resolver", "metrics"]
1516

1617
dependencies = [
1718
"dnspython>=2.7,<3.0",
@@ -26,7 +27,6 @@ dependencies = [
2627
"pyyaml>=6.0,<7.0",
2728
"tqdm>=4.66,<5.0",
2829
"matplotlib>=3.8,<4.0",
29-
"seaborn>=0.13.2,<0.14.0",
3030
"pillow>=11.0.0,<12.0.0"
3131
]
3232

@@ -37,19 +37,22 @@ classifiers = [
3737
"Topic :: Internet :: Name Service (DNS)",
3838
"Topic :: System :: Networking",
3939
"License :: OSI Approved :: MIT License",
40-
"Programming Language :: Python :: 3",
41-
"Programming Language :: Python :: 3.8",
40+
"Environment :: Console",
41+
"Operating System :: OS Independent",
42+
"Typing :: Typed",
43+
"Programming Language :: Python :: 3 :: Only",
4244
"Programming Language :: Python :: 3.9",
4345
"Programming Language :: Python :: 3.10",
4446
"Programming Language :: Python :: 3.11",
45-
"Programming Language :: Python :: 3.12",
47+
"Programming Language :: Python :: 3.12"
4648
]
4749

4850
[project.urls]
4951
Homepage = "https://github.com/frankovo/dns-benchmark-tool"
5052
Documentation = "https://github.com/frankovo/dns-benchmark-tool#readme"
5153
Source = "https://github.com/frankovo/dns-benchmark-tool"
5254
Tracker = "https://github.com/frankovo/dns-benchmark-tool/issues"
55+
Changelog = "https://github.com/frankovo/dns-benchmark-tool/blob/main/CHANGELOG.md"
5356

5457
[project.optional-dependencies]
5558
dev = [
@@ -64,7 +67,6 @@ dev = [
6467
"commitizen>=3.0,<5.0",
6568
]
6669

67-
6870
[tool.setuptools.packages.find]
6971
where = ["src"]
7072

@@ -88,7 +90,7 @@ strict = true
8890

8991
[tool.black]
9092
line-length = 88
91-
target-version = ["py38", "py39", "py310", "py311", "py312"]
93+
target-version = ["py39", "py310", "py311", "py312"]
9294

9395
[tool.isort]
9496
profile = "black"

src/dns_benchmark/analysis.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,6 @@ def get_resolver_statistics(self) -> List[ResolverStats]:
102102
cv = std_latency / avg_latency if avg_latency > 0 else 0
103103
consistency_score = max(0, 100 - (cv * 100))
104104
else:
105-
# min_latency = max_latency = avg_latency = median_latency = (
106-
# std_latency
107-
# ) = 0.0
108-
# p95_latency = p99_latency = jitter = consistency_score = 0.0
109-
# No successful queries → mark latency as None
110-
# min_latency = max_latency = avg_latency = median_latency = (
111-
# std_latency
112-
# ) = None
113105
min_latency = max_latency = avg_latency = median_latency = (
114106
std_latency
115107
) = float("nan")

src/dns_benchmark/cli.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ def reset_feedback() -> None:
278278
click.echo(click.style("✓ Feedback state reset", fg="green"))
279279

280280

281-
# Benchmark command
281+
# =================== Benchmark command
282282
@cli.command()
283283
@click.option("--resolvers", "-r", help="JSON file with resolver list")
284284
@click.option("--domains", "-d", help="Text file with domain list")
@@ -318,7 +318,6 @@ def reset_feedback() -> None:
318318
@click.option(
319319
"--include-charts", is_flag=True, help="Include charts in Excel and PDF exports"
320320
)
321-
# =================== Benchmark
322321
def benchmark(
323322
resolvers: Optional[str],
324323
domains: Optional[str],
@@ -622,6 +621,7 @@ def _progress_cb(completed: int, total: int) -> None:
622621
show_feedback_prompt()
623622

624623

624+
# ====================== Top Resolvers Command
625625
@cli.command()
626626
@click.option("--limit", "-n", default=10, help="Number of top resolvers to display")
627627
@click.option(
@@ -649,7 +649,6 @@ def _progress_cb(completed: int, total: int) -> None:
649649
"--output", "-o", help="Optional: save results to file (supports .txt, .json, .csv)"
650650
)
651651
@click.option("--quiet", is_flag=True, help="Suppress progress output")
652-
# ====================== Top
653652
def top(
654653
limit: int,
655654
metric: str,
@@ -930,8 +929,6 @@ def _progress_cb(completed: int, total: int) -> None:
930929

931930

932931
# ======================= Compare
933-
934-
935932
@cli.command()
936933
@click.argument("resolvers", nargs=-1, required=True)
937934
@click.option("--domains", "-d", help="Text file with domain list")
@@ -1191,6 +1188,7 @@ def _progress_cb(completed: int, total: int) -> None:
11911188
raise
11921189

11931190

1191+
# ==================== Monitoring Command
11941192
@cli.command()
11951193
@click.option("--resolvers", "-r", help="JSON file with resolver list")
11961194
@click.option("--domains", "-d", help="Text file with domain list")
@@ -1219,7 +1217,6 @@ def _progress_cb(completed: int, total: int) -> None:
12191217
@click.option(
12201218
"--use-defaults", is_flag=True, help="Use default resolvers and sample domains"
12211219
)
1222-
# ==================== Monitoring
12231220
def monitoring(
12241221
resolvers: Optional[str],
12251222
domains: Optional[str],
@@ -1389,6 +1386,7 @@ def monitoring(
13891386
click.echo(success(f"Monitoring log saved to: {output}"))
13901387

13911388

1389+
# ===================== List Defaults Command
13921390
@cli.command()
13931391
def list_defaults() -> None:
13941392
"""List default resolvers and sample domains."""
@@ -1404,6 +1402,7 @@ def list_defaults() -> None:
14041402
return None
14051403

14061404

1405+
# ===================== List Resolvers Command
14071406
@cli.command()
14081407
@click.option("--category", "-c", help="Filter by category")
14091408
@click.option(
@@ -1516,6 +1515,7 @@ def list_resolvers(category: Optional[str], format: str, details: bool) -> None:
15161515
click.echo(summary_box(summary_lines))
15171516

15181517

1518+
# ====================== List Domains Command
15191519
@cli.command()
15201520
@click.option("--category", "-c", help="Filter by category")
15211521
@click.option(
@@ -1593,6 +1593,7 @@ def list_domains(category: Optional[str], format: str, count: Optional[int]) ->
15931593
click.echo(summary_box(summary_lines))
15941594

15951595

1596+
# ======================= List Categories Command
15961597
@cli.command()
15971598
def list_categories() -> None:
15981599
"""Show all available resolver and domain categories"""
@@ -1626,6 +1627,7 @@ def list_categories() -> None:
16261627
click.echo(summary_box(summary_lines))
16271628

16281629

1630+
# ====================== Generate Config Command
16291631
@cli.command()
16301632
@click.option("--category", "-c", help="Generate config for specific category")
16311633
@click.option("--output", "-o", help="Output file path")

tests/test_benchmark_cli.py

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,18 @@ def test_benchmark_exports_csv_excel_pdf_json(tmp_path, sample_results):
9292
"dns_benchmark.core.DNSQueryEngine.run_benchmark", return_value=sample_results
9393
):
9494
# Also patch default resolvers/domains to keep totals small
95-
with patch(
96-
"dns_benchmark.core.ResolverManager.get_default_resolvers",
97-
return_value=[
98-
{"name": "Cloudflare", "ip": "1.1.1.1"},
99-
{"name": "Google", "ip": "8.8.8.8"},
100-
],
101-
), patch(
102-
"dns_benchmark.core.DomainManager.get_sample_domains",
103-
return_value=["example.com", "bad-domain.test"],
95+
with (
96+
patch(
97+
"dns_benchmark.core.ResolverManager.get_default_resolvers",
98+
return_value=[
99+
{"name": "Cloudflare", "ip": "1.1.1.1"},
100+
{"name": "Google", "ip": "8.8.8.8"},
101+
],
102+
),
103+
patch(
104+
"dns_benchmark.core.DomainManager.get_sample_domains",
105+
return_value=["example.com", "bad-domain.test"],
106+
),
104107
):
105108
result = runner.invoke(
106109
cli,

tests/test_list_commands.py

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,19 @@
77

88
def test_list_defaults():
99
runner = CliRunner()
10-
with patch(
11-
"dns_benchmark.core.ResolverManager.get_default_resolvers",
12-
return_value=[
13-
{"name": "Cloudflare", "ip": "1.1.1.1"},
14-
],
15-
), patch(
16-
"dns_benchmark.core.DomainManager.get_sample_domains",
17-
return_value=[
18-
"example.com",
19-
],
10+
with (
11+
patch(
12+
"dns_benchmark.core.ResolverManager.get_default_resolvers",
13+
return_value=[
14+
{"name": "Cloudflare", "ip": "1.1.1.1"},
15+
],
16+
),
17+
patch(
18+
"dns_benchmark.core.DomainManager.get_sample_domains",
19+
return_value=[
20+
"example.com",
21+
],
22+
),
2023
):
2124
result = runner.invoke(cli, ["list-defaults"])
2225
assert result.exit_code == 0

0 commit comments

Comments
 (0)