Skip to content
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 #337

Merged
merged 2 commits into from
Feb 2, 2025
Merged

Conversation

pull[bot]
Copy link

@pull pull bot commented Feb 2, 2025

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

Enhancements:

  • Improve code readability by changing the layout of structure initializations.

vkalintiris and others added 2 commits February 2, 2025 13:17
* format_windows: Format GetSystemCPU.[c]

* format_windows: Format GetSystemRAM.[c]

* format_windows: Format GetSystemUptime.[c]

* format_windows: Format perflib-hyperv.[c]

* format_windows: Format perflib-memory.[c]

* format_windows: Format perflib-mssql.[c]

* format_windows: Format perflib-network.[c]

* format_windows: Format perflib-objects.[c]

* format_windows: Format perflib-processes.[c]

* format_windows: Format perflib-processor.[c]

* format_windows: Format perflib-rrd.[ch]

* format_windows: Format perflib-storage.[ch]

* format_windows: Format perflib-thermalzone.[ch]

* format_windows: Format perflib-web-service.[c]

* format_windows: Format windows-internals.[h]
@pull pull bot added the ⤵️ pull label Feb 2, 2025
@pull pull bot merged commit 768ad06 into webfutureiorepo:master Feb 2, 2025
Copy link

sourcery-ai bot commented Feb 2, 2025

Reviewer's Guide by Sourcery

This pull request refactors the configuration system to use a new library called inicfg instead of the old appconfig library. This change is implemented by replacing all instances of appconfig function calls with their inicfg equivalents. Additionally, some configuration options have been moved or renamed to improve consistency and organization.

Sequence diagram showing the new configuration loading process

sequenceDiagram
    participant App
    participant StreamConfig
    participant IniCfg
    participant FileSystem

    App->>StreamConfig: stream_conf_load()
    StreamConfig->>IniCfg: inicfg_load(user_config)
    IniCfg->>FileSystem: Read user config
    alt user config not found
        FileSystem-->>IniCfg: File not found
        IniCfg->>FileSystem: Read stock config
        FileSystem-->>IniCfg: Return stock config
    else user config found
        FileSystem-->>IniCfg: Return user config
    end
    IniCfg-->>StreamConfig: Config loaded
    StreamConfig->>IniCfg: inicfg_move()
    StreamConfig->>IniCfg: inicfg_move_everywhere()
    StreamConfig-->>App: Configuration ready
Loading

Class diagram showing the configuration system changes

classDiagram
    class stream_config {
        +load()
        +get_boolean()
        +get_number()
        +get_duration_seconds()
        +get_size_bytes()
    }

    class appconfig {
        +load()
        +get_boolean()
        +get_number()
        +get_duration_seconds()
        +get_size_bytes()
    }

    class inicfg {
        +load()
        +get_boolean()
        +get_number()
        +get_duration_seconds()
        +get_size_bytes()
    }

    appconfig <|-- inicfg : replaces
    stream_config ..> inicfg : uses
    note for inicfg "New configuration library"
    note for appconfig "Old configuration library"
Loading

File-Level Changes

Change Details Files
Replaced appconfig with inicfg for configuration loading and access.
  • Replaced appconfig_load with inicfg_load.
  • Replaced appconfig_get with inicfg_get.
  • Replaced appconfig_get_boolean with inicfg_get_boolean.
  • Replaced appconfig_get_number with inicfg_get_number.
  • Replaced appconfig_get_double with inicfg_get_double.
  • Replaced appconfig_set with inicfg_set.
  • Replaced appconfig_set_boolean with inicfg_set_boolean.
  • Replaced appconfig_set_number with inicfg_set_number.
  • Replaced appconfig_set_default_raw_value with inicfg_set_default_raw_value.
  • Replaced appconfig_exists with inicfg_exists.
  • Replaced appconfig_move with inicfg_move.
  • Replaced appconfig_move_everywhere with inicfg_move_everywhere.
  • Replaced appconfig_generate with inicfg_generate.
  • Replaced appconfig_section_destroy with inicfg_section_destroy.
  • Replaced appconfig_section_option_destroy with inicfg_section_option_destroy.
  • Replaced appconfig_get_duration_seconds with inicfg_get_duration_seconds.
  • Replaced appconfig_get_size_bytes with inicfg_get_size_bytes.
  • Replaced appconfig_get_size_mb with inicfg_get_size_mb.
  • Replaced appconfig_get_duration_ms with inicfg_get_duration_ms.
  • Replaced appconfig_get_duration_days with inicfg_get_duration_days.
  • Replaced appconfig_get_boolean_ondemand with inicfg_get_boolean_ondemand.
  • Replaced appconfig_foreach_section with inicfg_foreach_section.
  • Replaced appconfig_test_boolean_value with inicfg_test_boolean_value.
  • Replaced appconfig_section_create with inicfg_section_create.
  • Replaced appconfig_section_find with inicfg_section_find.
  • Replaced appconfig_option_create with inicfg_option_create.
  • Replaced appconfig_option_find with inicfg_option_find.
  • Replaced appconfig_option_remove_and_delete with inicfg_option_remove_and_delete.
  • Replaced appconfig_option_remove_and_delete_all with inicfg_option_remove_and_delete_all.
  • Replaced appconfig_get_raw_value_of_option_in_section with inicfg_get_raw_value_of_option_in_section.
  • Replaced appconfig_get_raw_value with inicfg_get_raw_value.
  • Replaced appconfig_set_raw_value_of_option with inicfg_set_raw_value_of_option.
  • Replaced appconfig_set_raw_value_of_option_in_section with inicfg_set_raw_value_of_option_in_section.
  • Replaced appconfig_set_raw_value with inicfg_set_raw_value.
src/collectors/windows.plugin/perflib-network.c
src/collectors/windows.plugin/perflib-storage.c
src/collectors/windows.plugin/perflib-hyperv.c
src/collectors/windows.plugin/perflib-memory.c
src/daemon/config/netdata-conf-backwards-compatibility.c
src/streaming/stream-conf.c
src/collectors/ebpf.plugin/ebpf.c
src/collectors/windows.plugin/perflib-processor.c
src/collectors/proc.plugin/proc_net_netstat.c
src/collectors/proc.plugin/proc_diskstats.c
src/collectors/windows.plugin/perflib-web-service.c
src/daemon/config/netdata-conf-db.c
src/daemon/config/netdata-conf-web.c
src/ml/ml_config.cc
src/collectors/statsd.plugin/statsd.c
src/collectors/windows.plugin/GetSystemCPU.c
src/collectors/windows.plugin/perflib-rrd.c
src/daemon/main.c
src/registry/registry_init.c
src/collectors/freebsd.plugin/freebsd_sysctl.c
src/collectors/proc.plugin/proc_net_dev.c
src/libnetdata/config/appconfig_conf_file.c
src/collectors/proc.plugin/proc_net_sockstat.c
src/collectors/windows.plugin/perflib-rrd.h
src/collectors/windows.plugin/GetSystemUptime.c
src/libnetdata/config/appconfig_options.c
src/claim/cloud-conf.c
src/collectors/proc.plugin/proc_stat.c
src/collectors/tc.plugin/plugin_tc.c
src/collectors/windows.plugin/perflib-processes.c
src/collectors/cgroups.plugin/sys_fs_cgroup.c
src/collectors/diskspace.plugin/plugin_diskspace.c
src/libnetdata/config/appconfig.c
src/exporting/read_config.c
src/libnetdata/config/appconfig_internals.h
src/libnetdata/config/appconfig_api_boolean.c
src/libnetdata/config/appconfig_api_boolean.h
src/libnetdata/config/appconfig_api_durations.c
src/libnetdata/config/appconfig_api_durations.h
src/libnetdata/config/appconfig_api_numbers.c
src/libnetdata/config/appconfig_api_numbers.h
src/libnetdata/config/appconfig_api_sizes.c
src/libnetdata/config/appconfig_api_sizes.h
src/libnetdata/config/appconfig_api_text.c
src/libnetdata/config/appconfig_api_text.h
src/libnetdata/config/dyncfg.c
src/libnetdata/config/dyncfg.h
src/CMakeLists.txt
src/libnetdata/config/config.h
src/libnetdata/config/appconfig.h
Moved or renamed some configuration options for better organization.
  • Moved http port listen backlog to listen backlog under the web section.
  • Moved bind socket to IP to bind to under the web section.
  • Moved port to default port under the web section.
  • Moved disconnect idle web clients after seconds to disconnect idle clients after seconds under the web section.
  • Moved respect web browser do not track policy to respect do not track policy under the web section.
  • Moved web x-frame-options header to x-frame-options response header under the web section.
  • Moved enable web responses gzip compression to enable gzip compression under the web section.
  • Moved web compression strategy to gzip compression strategy under the web section.
  • Moved web compression level to gzip compression level under the web section.
  • Moved config directory to config under the directories section.
  • Moved stock config directory to stock config under the directories section.
  • Moved log directory to log under the directories section.
  • Moved web files directory to web under the directories section.
  • Moved cache directory to cache under the directories section.
  • Moved lib directory to lib under the directories section.
  • Moved home directory to home under the directories section.
  • Moved lock directory to lock under the directories section.
  • Moved plugins directory to plugins under the directories section.
  • Moved health configuration directory to health config under the directories section.
  • Moved stock health configuration directory to stock health config under the directories section.
  • Moved registry db directory to registry under the directories section.
  • Moved debug log to debug under the logs section.
  • Moved error log to error under the logs section.
  • Moved access log to access under the logs section.
  • Moved facility log to facility under the logs section.
  • Moved errors flood protection period to errors flood protection period under the logs section.
  • Moved errors to trigger flood protection to errors to trigger flood protection under the logs section.
  • Moved debug flags to debug flags under the logs section.
  • Moved TZ environment variable to TZ under the env vars section.
  • Moved PATH environment variable to PATH under the env vars section.
  • Moved PYTHONPATH environment variable to PYTHONPATH under the env vars section.
  • Moved enabled under the statsd section to statsd under the plugins section.
  • Moved memory mode to db under the db section.
  • Moved mode to db under the db section.
  • Moved history to retention under the db section.
  • Moved update every to update every under the db section.
  • Moved page cache size to dbengine page cache size under the db section.
  • Moved dbengine page cache size MB to dbengine page cache size under the db section.
  • Moved dbengine extent cache size MB to dbengine extent cache size under the db section.
  • Moved page cache size to dbengine page cache size MB under the db section.
  • Moved memory deduplication (ksm) to memory deduplication (ksm) under the db section.
  • Moved dbengine page fetch timeout to dbengine page fetch timeout secs under the db section.
  • Moved dbengine page fetch retries to dbengine page fetch retries under the db section.
  • Moved dbengine extent pages to dbengine pages per extent under the db section.
  • Moved cleanup obsolete charts after seconds to cleanup obsolete charts after under the db section.
  • Moved cleanup obsolete charts after secs to cleanup obsolete charts after under the db section.
  • Moved gap when lost iterations above to gap when lost iterations above under the db section.
  • Moved cleanup orphan hosts after seconds to cleanup orphan hosts after under the db section.
  • Moved cleanup orphan hosts after secs to cleanup orphan hosts after under the db section.
  • Moved cleanup ephemeral hosts after secs to cleanup ephemeral hosts after under the db section.
  • Moved seconds to replicate to replication period under the db section.
  • Moved seconds per replication step to replication step under the db section.
  • Moved enable zero metrics to enable zero metrics under the db section.
  • Moved query thread count to query threads under the cloud section.
  • Moved netdata monitoring to netdata pulse under the plugins section.
  • Moved netdata telemetry to netdata pulse under the plugins section.
  • Moved netdata monitoring extended to extended under the pulse section.
  • Moved extended telemetry to extended under the pulse section.
  • Moved update every under the global statistics section to update every under the pulse section.
  • Moved update every under the telemetry section to update every under the pulse section.
  • Moved dbengine disk space to dbengine tier 0 retention size under the db section.
  • Moved dbengine multihost disk space to dbengine tier 0 retention size under the db section.
  • Moved dbengine disk space MB to dbengine tier 0 retention size under the db section.
  • Moved error under the logs section to daemon under the logs section.
  • Moved severity level under the logs section to level under the logs section.
  • Moved errors to trigger flood protection under the logs section to logs to trigger flood protection under the logs section.
  • Moved errors flood protection period under the logs section to logs flood protection period under the logs section.
  • Moved is ephemeral under the health section to is ephemeral node under the global section.
  • Moved has unstable connection under the health section to has unstable connection under the global section.
  • Moved run at least every seconds under the health section to run at least every under the health section.
  • Moved postpone alarms during hibernation for seconds under the health section to postpone alarms during hibernation for under the health section.
  • Moved health log history under the health section to health log retention under the health section.
  • Moved registry expire idle persons days under the registry section to registry expire idle persons under the registry section.
  • Moved disconnect idle clients after seconds under the web section to disconnect idle clients after under the web section.
  • Moved accept a streaming request every seconds under the web section to accept a streaming request every under the web section.
  • Moved set charts as obsolete after secs under the statsd section to set charts as obsolete after under the statsd section.
  • Moved disconnect idle tcp clients after seconds under the statsd section to disconnect idle tcp clients after under the statsd section.
  • Moved loop time in ms under the plugin:idlejitter section to loop time under the plugin:idlejitter section.
  • Moved refresh ports state every seconds under the plugin:proc:/sys/class/infiniband section to refresh ports state every under the plugin:proc:/sys/class/infiniband section.
src/daemon/config/netdata-conf-backwards-compatibility.c
Added new files and removed old ones related to the configuration system.
  • Removed appconfig related files.
  • Added inicfg related files.
src/libnetdata/config/appconfig_internals.h
src/libnetdata/config/appconfig_exporters.c
src/libnetdata/config/appconfig_conf_file.c
src/libnetdata/config/appconfig_cleanup.c
src/libnetdata/config/appconfig_sections.c
src/libnetdata/config/appconfig_options.c
src/libnetdata/config/appconfig_migrate.c
src/libnetdata/config/appconfig_traversal.c
src/libnetdata/config/appconfig_api_sizes.c
src/libnetdata/config/appconfig_api_sizes.h
src/libnetdata/config/appconfig_api_durations.c
src/libnetdata/config/appconfig_api_durations.h
src/libnetdata/config/appconfig_api_numbers.c
src/libnetdata/config/appconfig_api_numbers.h
src/libnetdata/config/appconfig_api_text.c
src/libnetdata/config/appconfig_api_text.h
src/libnetdata/config/appconfig_api_boolean.c
src/libnetdata/config/appconfig_api_boolean.h
src/libnetdata/config/dyncfg.c
src/libnetdata/config/dyncfg.h
src/libnetdata/config/config.h
src/libnetdata/config/appconfig.h
src/libnetdata/inicfg/inicfg.c
src/libnetdata/inicfg/inicfg.h
src/libnetdata/inicfg/inicfg_internals.h
src/libnetdata/inicfg/inicfg_exporters.c
src/libnetdata/inicfg/inicfg_conf_file.c
src/libnetdata/inicfg/inicfg_cleanup.c
src/libnetdata/inicfg/inicfg_sections.c
src/libnetdata/inicfg/inicfg_options.c
src/libnetdata/inicfg/inicfg_migrate.c
src/libnetdata/inicfg/inicfg_traversal.c
src/libnetdata/inicfg/inicfg_api.c
src/libnetdata/inicfg/dyncfg.c
src/libnetdata/inicfg/dyncfg.h

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!
  • Generate a plan of action for an issue: Comment @sourcery-ai plan on
    an issue to generate a plan of action for it.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants