Every oldest(), stats() and put() globbed and sorted the whole spool directory, so draining a backlog cost O(N^2 log N). After an outage on a Pi 3B+ the writer thread sat at 100% CPU for minutes working through 3,300 batches. The directory is now scanned once at startup and the names, sizes and total are tracked as batches are added and removed; draining 3,300 batches drops from 59s to 0.24s on a laptop. Bump to 0.1.6. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
52 lines
1.2 KiB
TOML
52 lines
1.2 KiB
TOML
[build-system]
|
|
requires = ["setuptools>=70", "wheel"]
|
|
build-backend = "setuptools.build_meta"
|
|
|
|
[project]
|
|
name = "openhop-influxdb-plugin"
|
|
version = "0.1.6"
|
|
description = "openHop Repeater plugin that pushes metrics, packets, logs and snapshots to InfluxDB"
|
|
readme = "README.md"
|
|
requires-python = ">=3.10"
|
|
license = {text = "MIT"}
|
|
authors = [{name = "openHop InfluxDB plugin contributors"}]
|
|
dependencies = [
|
|
"requests>=2.31,<3",
|
|
"websocket-client>=1.6,<2",
|
|
]
|
|
|
|
[project.optional-dependencies]
|
|
dev = [
|
|
"pytest>=8",
|
|
"ruff>=0.6",
|
|
"build>=1.2",
|
|
"aiohttp>=3.9", # dev/fake_repeater.py only
|
|
]
|
|
|
|
[project.scripts]
|
|
openhop-influxdb = "openhop_influxdb_plugin.main:main"
|
|
|
|
[tool.setuptools.packages.find]
|
|
where = ["src"]
|
|
|
|
[tool.setuptools.package-data]
|
|
"openhop_influxdb_plugin.vendor.prometheus_collectors" = ["LICENSE", "PROVENANCE.md"]
|
|
|
|
[tool.setuptools.data-files]
|
|
"share/openhop/plugins/community.influxdb" = [
|
|
"openhop-plugin.json",
|
|
"config.default.json",
|
|
]
|
|
|
|
[tool.pytest.ini_options]
|
|
testpaths = ["tests"]
|
|
addopts = "-q"
|
|
|
|
[tool.ruff]
|
|
line-length = 100
|
|
target-version = "py310"
|
|
extend-exclude = ["src/openhop_influxdb_plugin/vendor"]
|
|
|
|
[tool.ruff.lint]
|
|
select = ["E", "F", "W", "I", "UP", "B"]
|