Agent Metric Config#30
Open
FW-Nagorko wants to merge 9 commits into
Open
Conversation
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.
This pull request introduces a significant refactor and extension of the agent's metrics collection subsystem. The main changes implement a registry-based collector system, unify and extend the collector interface, and add support for dynamically selecting and configuring metrics at startup via config
Collector System Refactor and Extension:
Introduced a
CollectorRegistrysingleton and aRegisteredCollectortemplate to allow automatic registration and dynamic resolution of collectors based on requested metric types. The collector interface now includesIsSupported,Satisfiable, andSetRequestedMetricsmethods, enabling runtime selection and configuration of collectors. (collector.h,nvml_collector.h,proc_stat_collector.h,ram_collector.h,rapl_collector.h) [1] [2] [3] [4] [5] [6]Updated all collector implementations (
RaplCollector,NvmlCollector,ProcStatCollector,RamCollector) to support the new interface. Each collector now only returns metrics if requested, advertises its capabilities, and checks for platform support at runtime. (rapl_collector.cc,nvml_collector.cc,proc_stat_collector.cc,ram_collector.cc) [1] [2] [3] [4]Build and Directory Structure:
Changed the CMake build to generate protobuf/gRPC files into a dedicated
gen/directory instead of the build directory, and updated include paths accordingly. (CMakeLists.txt) [1] [2]Added
build/*andgen/*to.gitignoreto avoid committing generated or build files. (.gitignore)Configuration and Metric Types:
metricsfield. (agent.example.conf)Metric Representation:
v1::MetricType) defined involta.protoinstead of string names, improving type safety and consistency across the codebase. [1] [2] [3] [4]