Skip to content

Improve Recorder#42

Open
benmo-atl wants to merge 16 commits into
alliedtelesis:masterfrom
benmo-atl:master
Open

Improve Recorder#42
benmo-atl wants to merge 16 commits into
alliedtelesis:masterfrom
benmo-atl:master

Conversation

@benmo-atl

Copy link
Copy Markdown
Contributor

Improved recorder by separating (& adding) tests, alongside minor QOL changes. SIGUSR1 now forces all threads to poll their query and reset their timers.

benmo-atl and others added 16 commits May 4, 2026 10:06
Changes to Makefile for compilation of recorder.c.
Recorder.c parses an array of JSON config information and runs queries
from them, writing the resulting calculated diff to the specified destination.
This allows a timeline of information to be reconstructed.
Each config object gets its own thread which runs based on the defined
frequency in seconds. Also fixed make_path to support nested/sub-dir
creation.
framework for logrotate: creating filename from destination file and
filling config with relevant info.
Better error codes, functional decomposition, and catches edge case for
logrotate paths.
Diffs now resemble the JSON structure of the source. Also made minor
code style changes.
query was leaking memory and array comparison was unnecessarily
comparing the indexes of arrays. Also ATL code consistency changes
(fix-indent).
Timestamps were poorly algined. They now directly relate to the change
 they are attached to.
Ensures there is no contention between threads by enforcing unique
destionations/ filenames. Also improved code structure.
Most recent diffs are now at the start/ top of the array for easier
calculation.
Config is now read from separate json files. Added basic tests and the
framework to run them.
Fixed memory leak in test cases.
Added more test cases, made minor cleanups to code style and error flow.
Added a check to prevent repeat destinations. Functions are commented.
Changed design to allow for reloads on SIGHUP, while maintaining a
proper poll time. Also allowed for
logrotate to be defined with a configurable conf file destination.
Diffs are now 'regular' forward-diffs. Disk writing has been minimised
by using seeking. Tests updated and added to verify new behaviour.
Added tests and moved them into a separate file. Also made separate
header file. Polls now force run on SIGUSR1.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant