25 Commits

Author SHA1 Message Date
Vincent Bernat
e2f1df9add tests: replace godebug by go-cmp for structure diffs
go-cmp is stricter and allow to catch more problems. Moreover, the
output is a bit nicer.
2025-08-23 16:03:09 +02:00
Vincent Bernat
6b2af58a64 orchestrator/geoip: add a benchmark for Iterate*Databases()
Now:

```
goos: linux
goarch: amd64
pkg: akvorado/orchestrator/geoip
cpu: AMD Ryzen 7 PRO 6850U with Radeon Graphics
BenchmarkIterDatabase/ASN-16                3376               457.0 ns/entry
BenchmarkIterDatabase/GeoIP-16              2410               754.5 ns/entry
```

Before 0a10764cc9:

```
goos: linux
goarch: amd64
pkg: akvorado/orchestrator/geoip
cpu: AMD Ryzen 7 PRO 6850U with Radeon Graphics
BenchmarkIterDatabase/ASN-16                2863               609.3 ns/entry
BenchmarkIterDatabase/GeoIP-16              3286               719.3 ns/entry
```

I was hoping for a bit more!
2025-08-17 08:48:25 +02:00
Vincent Bernat
3d01a68bcb common/helpers: cache skip decision when requiring external services 2025-07-30 08:19:00 +02:00
Vincent Bernat
18beb310ee chore: replace interface{} with any 2025-07-29 07:42:49 +02:00
Vincent Bernat
756e4a8fbd */kafka: switch to franz-go
The concurrency of this library is easier to handle than Sarama.
Notably, it is more compatible with the new model of "almost share
nothing" we use for the inlet and the outlet. The lock for workers in
outlet is removed. We can now use sync.Pool to allocate slice of bytes
in inlet.

It may also be more performant.

In the future, we may want to commit only when pushing data to
ClickHouse. However, this does not seem easy when there is a rebalance.
In case of rebalance, we need to do something when a partition is
revoked to avoid duplicating data. For example, we could flush the
current batch to ClickHouse. Have a look at the
`example/mark_offsets/main.go` file in franz-go repository for a
possible approach. In the meantime, we rely on autocommit.

Another contender could be https://github.com/segmentio/kafka-go. Also
see https://github.com/twmb/franz-go/pull/1064.
2025-07-27 21:44:28 +02:00
Vincent Bernat
de65ee6072 tests: introduce helpers.Pos/helpers.Mark
This helps locating the position of a test.
2024-07-01 07:42:36 +02:00
Vincent Bernat
39882fd98e common: handle per-candidate ports for external service checks 2024-01-20 09:25:31 +01:00
Vincent Bernat
8509fa9ce9 docs: mention "docker compose" instead of "docker-compose"
The later has been deprecated.
2023-08-13 09:11:47 +02:00
Vincent Bernat
1587c5ff44 common/helpers: move some test functions to separate files 2022-09-09 11:22:35 +02:00
Vincent Bernat
a9bef1c3fc tests: extend Diff() helper to accept new options 2022-08-31 14:30:08 +02:00
Vincent Bernat
6bfd3a0bd0 inlet/snmp: use netip.Addr internally instead of string
Also, make SubnetMap use `netip.Addr` as well.
2022-08-27 08:13:57 +02:00
Vincent Bernat
c41fa8cb55 common/helpers: opt-in for custom formatters for diff
Many stuff has a `String()` method that would hide details.
2022-08-16 21:21:22 +02:00
Vincent Bernat
f9b507ff35 common/helpers: add a helper to test configuration decoding
For each case, we test from native map and from YAML. This should
capture all the cases we are interested.

Also, simplify pretty diff by using stringer for everything. I don't
remember why this wasn't the case. Maybe IP addresses? It's possible
to opt out by overriding formatters.
2022-08-16 21:15:23 +02:00
Vincent Bernat
ca306456d5 common: make time.Time comparable with Diff 2022-08-09 01:00:37 +02:00
Vincent Bernat
61c8143fe8 build: fix linting issues introduced by latest revive release 2022-08-07 23:54:24 +02:00
Vincent Bernat
1bbaf4de24 inlet/snmp: accept subnets for communities
Also deprecate `default-community`.
2022-07-31 23:38:54 +02:00
Vincent Bernat
7d8185a405 common/helpers: fix method name in some test outputs 2022-07-21 12:10:36 +02:00
Vincent Bernat
8be1bca4fd license: AGPL-3.0-only
```
git ls-files \*.js \*.go \
  | xargs sed -i '1i // SPDX-FileCopyrightText: 2022 Free Mobile\n// SPDX-License-Identifier: AGPL-3.0-only\n'
git ls-files \*.vue \
  | xargs sed -i '1i <!-- SPDX-FileCopyrightText: 2022 Free Mobile -->\n<!-- SPDX-License-Identifier: AGPL-3.0-only -->\n'
```
2022-06-29 11:42:28 +02:00
Vincent Bernat
bf0c474726 console: implement "filter/saved" endpoints 2022-06-13 09:50:43 +02:00
Vincent Bernat
9567de4ca5 console: add minimal user management 2022-05-30 22:24:18 +02:00
Vincent Bernat
4114568600 console/filter: add completion endpoint 2022-05-26 15:58:52 +02:00
Vincent Bernat
2d4f5214bd tests: handle JSON in TestHTTPEndpoints 2022-05-26 10:40:55 +02:00
Vincent Bernat
2bbeacec84 tests: use TestHTTPEndpoints helper more 2022-04-14 09:17:38 +02:00
Vincent Bernat
ce9bd6a4da tests: add an helper to start/stop components 2022-04-13 17:02:14 +02:00
Vincent Bernat
1dc253764d global: split Akvorado into 3 services 2022-04-01 20:21:53 +02:00