Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
dcdb
dcdb
Commits
6344192d
Commit
6344192d
authored
Feb 08, 2019
by
Micha Mueller
Browse files
Add printConfig to Procfs plugin
parent
fe1ae484
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/sensors/procfs/ProcfsSensorBase.h
View file @
6344192d
...
...
@@ -47,6 +47,16 @@ public:
void
setCPUId
(
int
i
)
{
this
->
_cpuId
=
i
;
}
int
getCPUId
()
{
return
this
->
_cpuId
;
}
void
printConfig
(
LOG_LEVEL
ll
,
LOGGER
&
lg
)
{
LOG_VAR
(
ll
)
<<
" Metric: "
<<
_metric
;
LOG_VAR
(
ll
)
<<
" CPU Id: "
<<
_cpuId
;
if
(
_perCPU
)
{
LOG_VAR
(
ll
)
<<
" perCPU: true"
;
}
else
{
LOG_VAR
(
ll
)
<<
" perCPU: false"
;
}
}
protected:
// The metric field is used to decouple the sensor's name from the corresponding metric contained within the proc file
...
...
src/sensors/procfs/ProcfsSensorGroup.cpp
View file @
6344192d
...
...
@@ -145,3 +145,14 @@ void ProcfsSensorGroup::readAsync() {
}
_pendingTasks
--
;
}
void
ProcfsSensorGroup
::
printConfig
(
LOG_LEVEL
ll
)
{
if
(
_parser
)
{
LOG_VAR
(
ll
)
<<
" Parser set"
;
}
else
{
LOG_VAR
(
ll
)
<<
" No Parser set!"
;
}
LOG_VAR
(
ll
)
<<
" Type: "
<<
_type
;
LOG_VAR
(
ll
)
<<
" Path: "
<<
_path
;
LOG_VAR
(
ll
)
<<
" MQTT start: "
<<
_mqttStart
;
}
src/sensors/procfs/ProcfsSensorGroup.h
View file @
6344192d
...
...
@@ -46,6 +46,8 @@ public:
std
::
vector
<
ProcfsSBPtr
>&
getDerivedSensors
()
{
return
this
->
_sensors
;
}
void
replaceSensors
(
std
::
vector
<
ProcfsSBPtr
>
*
newSensors
);
void
printConfig
(
LOG_LEVEL
ll
)
override
;
private:
// Methods inherited from SensorGroupTemplate
void
read
()
override
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment