Skip to content

Commit

Permalink
fix(rrd): change log level for log rrd rebuild
Browse files Browse the repository at this point in the history
REFS: MON-11960
  • Loading branch information
rem31 authored and bouda1 committed Jan 26, 2022
1 parent 15974fc commit 01fab30
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
12 changes: 5 additions & 7 deletions centreon-broker/rrd/src/output.cc
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,6 @@ void output<T>::update() {
template <typename T>
int output<T>::write(std::shared_ptr<io::data> const& d) {
log_v2::rrd()->trace("RRD: output::write.");
if (d->type() == 0x30009)
log_v2::rrd()->warn("RRD: GOODGOODGOOD");
// Check that data exists.
if (!validate(d, "RRD"))
return 1;
Expand Down Expand Up @@ -289,8 +287,8 @@ int output<T>::write(std::shared_ptr<io::data> const& d) {
std::static_pointer_cast<storage::pb_rebuild_message>(d)};
switch (e->obj.state()) {
case RebuildMessage_State_START:
log_v2::rrd()->debug("RRD: Starting to rebuild metrics ({})",
fmt::join(e->obj.metric_id(), ","));
log_v2::rrd()->info("RRD: Starting to rebuild metrics ({})",
fmt::join(e->obj.metric_id(), ","));
// Rebuild is starting.
for (auto& m : e->obj.metric_id()) {
std::string path{fmt::format("{}{}.rrd", _metrics_path, m)};
Expand All @@ -305,8 +303,8 @@ int output<T>::write(std::shared_ptr<io::data> const& d) {
_rebuild_data(e->obj);
break;
case RebuildMessage_State_END:
log_v2::rrd()->debug("RRD: Finishing to rebuild metrics ({})",
fmt::join(e->obj.metric_id(), ","));
log_v2::rrd()->info("RRD: Finishing to rebuild metrics ({})",
fmt::join(e->obj.metric_id(), ","));
// Rebuild is ending.
for (auto& m : e->obj.metric_id()) {
std::string path{fmt::format("{}{}.rrd", _metrics_path, m)};
Expand All @@ -331,7 +329,7 @@ int output<T>::write(std::shared_ptr<io::data> const& d) {
for (auto& m : e->obj.metric_ids()) {
std::string path{fmt::format("{}{}.rrd", _metrics_path, m)};
/* File removed */
log_v2::rrd()->info("RRD: removing {} file", path, m);
log_v2::rrd()->info("RRD: removing {} file", path);
_backend.remove(path);
}
for (auto& i : e->obj.index_ids()) {
Expand Down
7 changes: 6 additions & 1 deletion centreon-tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,17 @@ From a Centreon host, you need to install Robot Framework

```
pip3 install -U robotframework robotframework-databaselibrary pymysql
yum install "Development Tools" python3-devel -y
pip3 install grpcio==1.33.2 grpcio_tools==1.33.2
./init-proto.sh
```

Then to run tests, you can use the following commands

```
cd centreon-tests/robot
robot .
```

Expand Down

0 comments on commit 01fab30

Please sign in to comment.