ENT-14329: Store only in-use measurement slots#21
Draft
nickanderson wants to merge 4 commits into
Draft
Conversation
~80 of the 100 slots are consumed by default measurements, leaving little room for custom ones. Raise the limit to 300. Kept in sync: CF_OBSERVABLES and the two cf-check copies of the on-disk struct, plus the OBSERVABLES name table (GetObservable() indexes it for unregistered slots, so a short table crashes cf-monitord). cf-check dump now tolerates the shorter records and ts_key a pre-upgrade agent leaves behind. Ticket: ENT-6511 Changelog: Increased the maximum number of cf-monitord measurement slots (CF_OBSERVABLES) from 100 to 300
nickanderson
force-pushed
the
CFE-612-increase-monitor-slots
branch
from
July 20, 2026 15:29
50d4f8a to
2fbdc3d
Compare
nickanderson
commented
Jul 20, 2026
| * The number of bytes of an Averages record that are actually in use. The | ||
| * built-in observables (indices 0..ob_spare-1) are always present; the custom | ||
| * slots above them are used only where a measurement is registered. cf-monitord | ||
| * writes only this many bytes per timekey, so unused trailing slots (up to 200 |
Owner
Author
There was a problem hiding this comment.
This comment should be more concise.
nickanderson
force-pushed
the
ENT-14329-storage-on-use
branch
from
July 20, 2026 15:55
2abe0c7 to
4cddccf
Compare
Raising CF_OBSERVABLES enlarges the fixed-size Averages record, so records written by an older agent are shorter than the current struct. Added a migration (modelled on dbm_migration_lastseen.c) that rewrites old records to the current size, zero-filling the new slots, registered for the observations and history DBs. This replaces the cf-check dump leniency with a one-time on-disk migration; dump only needs to know the new "version" key. Ticket: ENT-6511 Changelog: None
nickanderson
force-pushed
the
ENT-14329-storage-on-use
branch
2 times, most recently
from
July 21, 2026 16:19
b5b397b to
def8421
Compare
cf-monitord wrote a full Averages record per timekey regardless of use, so the raised CF_OBSERVABLES cost ~56 MB/host even with no custom measurements. Write only up to the highest in-use slot (AveragesUsedSize); readers zero-and-clamp, so the unused tail reads back as zero. Ticket: ENT-14329 Changelog: cf-monitord stores only in-use measurement slots
GetObservable() returns "spare"/"unused" for unregistered slots instead of
indexing the OBSERVABLES table beyond its named entries, so the table no longer
needs a {"spare","unused"} row per slot.
Ticket: ENT-14329
Changelog: None
nickanderson
force-pushed
the
ENT-14329-storage-on-use
branch
from
July 21, 2026 16:30
def8421 to
cdee340
Compare
nickanderson
force-pushed
the
CFE-612-increase-monitor-slots
branch
2 times, most recently
from
July 22, 2026 15:39
fa550dd to
d278e7e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on the bump (cfengine#6239 / ENT-6511). Draft, unsigned — for review.
GetObservable()synthesizes"spare", soconstants.cdrops 300 → 72 rows.Ticket: ENT-14329