forked from netdata/netdata
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[pull] master from netdata:master #295
Merged
Merged
Conversation
This file contains 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
* added uuidmap registry of uuids, giving a uint32_t * writer code in mrg is now used only in NETDATA_INTERNAL_CHECKS * working mrg with uuidmap * rrd contexts now uses uuidmap; refcount has been abstracted everywhere * uuidmap uses get before write locking; uuidmap unittest * uuidmap supports 256 partitions * added uuidmap to memory accounting; simplified mrg memory accounting * uuidmap memory accounting * rrdddim now uses uuidmap; cleanup rrdmetric and rrdinstance; rrddim, rrdmetric, rrdinstance now free uuidmap entries on cleanup; mrg left-overs of JudyHS are removed; mrg uses the same number of partitions as uuidmap and actually the same partition per uuid * fix bad merge * db ram/alloc now uses judyL instead of judyHS * storage engine function using UUIDMAP_ID * use waitq in sender * fix warning * hot pages may become dirty prematurely during shutdown * set uuidmap partitions to 8 * reuse old uuidmap metric ids * do not get before add in mrg
It went EOL upstream as of 2024-12-31.
Reviewer's Guide by SourceryThis pull request refactors the metric management in the database engine by replacing the use of raw UUIDs with UUIDMAP_IDs. This change improves memory management and performance by reducing memory usage and lookups. Class diagram showing the new UUID mapping structureclassDiagram
class METRIC {
-UUIDMAP_ID uuid
-Word_t section
-REFCOUNT refcount
-uint8_t partition
-uint32_t latest_update_every_s
-time_t first_time_s
-time_t latest_time_s_clean
-time_t latest_time_s_hot
}
class RRDMETRIC {
-UUIDMAP_ID uuid
-RRD_FLAGS flags
-STRING* id
-STRING* name
-RRDDIM* rrddim
}
class RRDINSTANCE {
-UUIDMAP_ID uuid
-int update_every_s
-RRD_FLAGS flags
-uint32_t priority
-RRDSET_TYPE chart_type
-STRING* id
-STRING* name
-STRING* title
-STRING* units
-STRING* family
}
METRIC --> "1" UUIDMAP_ID
RRDMETRIC --> "1" UUIDMAP_ID
RRDINSTANCE --> "1" UUIDMAP_ID
State diagram for reference countingstateDiagram-v2
[*] --> Active: acquire()
Active --> Active: acquire()
Active --> Active: release() > 0
Active --> Available: release() == 0
Available --> Deleted: acquire_for_deletion()
Active --> WaitingDelete: acquire_for_deletion_and_wait()
WaitingDelete --> Deleted: all references released
Deleted --> [*]
note right of Active: References > 0
note right of Available: References = 0
note right of WaitingDelete: References > 0
note right of Deleted: References = REFCOUNT_DELETED
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.1)
Can you help keep this open source service alive? 💖 Please sponsor : )
Summary by Sourcery
Refactor the metric and dimension handling to use a UUID map for faster lookups and reduced memory usage. Use refcounts for managing object lifetimes and implement concurrent access protection.
Enhancements:
Tests: