Skip to content

Commit

Permalink
enh(broker): big metrics do not fail anymore when inserted in database
Browse files Browse the repository at this point in the history
* enh(tests): big metrics do not fail anymore when inserted in database
* fix(broker): new script to compute database columns max sizes
* fix(broker/bam): the good size of float is inserted into the database for bam
* fix(broker): perfdata class contains float numbers now.
* enh(tests): big metrics do not fail anymore when inserted in database

REFS: MON-116619
  • Loading branch information
bouda1 authored Jun 21, 2024
1 parent d412dc8 commit dc90889
Show file tree
Hide file tree
Showing 46 changed files with 1,581 additions and 1,180 deletions.
50 changes: 25 additions & 25 deletions bbdo/bam/dimension_ba_event.cc
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
/*
** Copyright 2014-2015 Centreon
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
**
** For more information : [email protected]
*/
/**
* Copyright 2014-2024 Centreon
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* For more information : [email protected]
*/

#include "bbdo/bam/dimension_ba_event.hh"

Expand Down Expand Up @@ -102,14 +102,14 @@ mapping::entry const dimension_ba_event::entries[] = {
mapping::entry(&bam::dimension_ba_event::ba_id,
"ba_id",
mapping::entry::invalid_on_zero),
mapping::entry(
&bam::dimension_ba_event::ba_name,
"ba_name",
get_mod_bam_reporting_ba_col_size(mod_bam_reporting_ba_ba_name)),
mapping::entry(
&bam::dimension_ba_event::ba_description,
"ba_description",
get_mod_bam_reporting_ba_col_size(mod_bam_reporting_ba_ba_description)),
mapping::entry(&bam::dimension_ba_event::ba_name,
"ba_name",
get_centreon_storage_mod_bam_reporting_ba_col_size(
centreon_storage_mod_bam_reporting_ba_ba_name)),
mapping::entry(&bam::dimension_ba_event::ba_description,
"ba_description",
get_centreon_storage_mod_bam_reporting_ba_col_size(
centreon_storage_mod_bam_reporting_ba_ba_description)),
mapping::entry(&bam::dimension_ba_event::sla_month_percent_crit,
"sla_month_percent_crit"),
mapping::entry(&bam::dimension_ba_event::sla_month_percent_warn,
Expand Down
50 changes: 25 additions & 25 deletions bbdo/bam/dimension_bv_event.cc
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
/*
** Copyright 2014-2015 Centreon
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
**
** For more information : [email protected]
*/
/**
* Copyright 2014-2024 Centreon
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* For more information : [email protected]
*/

#include "bbdo/bam/dimension_bv_event.hh"

Expand Down Expand Up @@ -94,14 +94,14 @@ mapping::entry const dimension_bv_event::entries[] = {
mapping::entry(&bam::dimension_bv_event::bv_id,
"bv_id",
mapping::entry::invalid_on_zero),
mapping::entry(
&bam::dimension_bv_event::bv_name,
"bv_name",
get_mod_bam_reporting_bv_col_size(mod_bam_reporting_bv_bv_name)),
mapping::entry(
&bam::dimension_bv_event::bv_description,
"bv_description",
get_mod_bam_reporting_bv_col_size(mod_bam_reporting_bv_bv_description)),
mapping::entry(&bam::dimension_bv_event::bv_name,
"bv_name",
get_centreon_storage_mod_bam_reporting_bv_col_size(
centreon_storage_mod_bam_reporting_bv_bv_name)),
mapping::entry(&bam::dimension_bv_event::bv_description,
"bv_description",
get_centreon_storage_mod_bam_reporting_bv_col_size(
centreon_storage_mod_bam_reporting_bv_bv_description)),
mapping::entry()};

// Operations.
Expand Down
88 changes: 45 additions & 43 deletions bbdo/bam/dimension_kpi_event.cc
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
/*
** Copyright 2014-2015,2019-2021 Centreon
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
**
** For more information : [email protected]
*/
/**
* Copyright 2014-2015,2019-2024 Centreon
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* For more information : [email protected]
*/

#include "bbdo/bam/dimension_kpi_event.hh"

Expand Down Expand Up @@ -94,47 +94,49 @@ mapping::entry const dimension_kpi_event::entries[] = {
mapping::entry(&bam::dimension_kpi_event::ba_id,
"ba_id",
mapping::entry::invalid_on_zero),
mapping::entry(
&bam::dimension_kpi_event::ba_name,
"ba_name",
get_mod_bam_reporting_kpi_col_size(mod_bam_reporting_kpi_ba_name)),
mapping::entry(&bam::dimension_kpi_event::ba_name,
"ba_name",
get_centreon_storage_mod_bam_reporting_kpi_col_size(
centreon_storage_mod_bam_reporting_kpi_ba_name)),
mapping::entry(&bam::dimension_kpi_event::host_id,
"host_id",
mapping::entry::invalid_on_zero),
mapping::entry(
&bam::dimension_kpi_event::host_name,
"host_name",
get_mod_bam_reporting_kpi_col_size(mod_bam_reporting_kpi_host_name)),
mapping::entry(&bam::dimension_kpi_event::host_name,
"host_name",
get_centreon_storage_mod_bam_reporting_kpi_col_size(
centreon_storage_mod_bam_reporting_kpi_host_name)),
mapping::entry(&bam::dimension_kpi_event::service_id,
"service_id",
mapping::entry::invalid_on_zero),
mapping::entry(&bam::dimension_kpi_event::service_description,
"service_description",
get_mod_bam_reporting_kpi_col_size(
mod_bam_reporting_kpi_service_description)),
mapping::entry(
&bam::dimension_kpi_event::service_description,
"service_description",
get_centreon_storage_mod_bam_reporting_kpi_col_size(
centreon_storage_mod_bam_reporting_kpi_service_description)),
mapping::entry(&bam::dimension_kpi_event::kpi_ba_id,
"kpi_ba_id",
mapping::entry::invalid_on_zero),
mapping::entry(
&bam::dimension_kpi_event::kpi_ba_name,
"kpi_ba_name",
get_mod_bam_reporting_kpi_col_size(mod_bam_reporting_kpi_kpi_ba_name)),
mapping::entry(&bam::dimension_kpi_event::kpi_ba_name,
"kpi_ba_name",
get_centreon_storage_mod_bam_reporting_kpi_col_size(
centreon_storage_mod_bam_reporting_kpi_kpi_ba_name)),
mapping::entry(&bam::dimension_kpi_event::meta_service_id,
"meta_service_id",
mapping::entry::invalid_on_zero),
mapping::entry(&bam::dimension_kpi_event::meta_service_name,
"meta_service_name",
get_mod_bam_reporting_kpi_col_size(
mod_bam_reporting_kpi_meta_service_name),
mapping::entry::invalid_on_zero),
mapping::entry(
&bam::dimension_kpi_event::meta_service_name,
"meta_service_name",
get_centreon_storage_mod_bam_reporting_kpi_col_size(
centreon_storage_mod_bam_reporting_kpi_meta_service_name),
mapping::entry::invalid_on_zero),
mapping::entry(&bam::dimension_kpi_event::boolean_id,
"boolean_id",
mapping::entry::invalid_on_zero),
mapping::entry(
&bam::dimension_kpi_event::boolean_name,
"boolean_name",
get_mod_bam_reporting_kpi_col_size(mod_bam_reporting_kpi_boolean_name),
mapping::entry::invalid_on_zero),
mapping::entry(&bam::dimension_kpi_event::boolean_name,
"boolean_name",
get_centreon_storage_mod_bam_reporting_kpi_col_size(
centreon_storage_mod_bam_reporting_kpi_boolean_name),
mapping::entry::invalid_on_zero),
mapping::entry(&bam::dimension_kpi_event::impact_warning, "impact_warning"),
mapping::entry(&bam::dimension_kpi_event::impact_critical,
"impact_critical"),
Expand Down
81 changes: 42 additions & 39 deletions bbdo/bam/dimension_timeperiod.cc
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
/*
** Copyright 2014-2015 Centreon
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
**
** For more information : [email protected]
*/
/**
* Copyright 2014-2024 Centreon
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* For more information : [email protected]
*/

#include "bbdo/bam/dimension_timeperiod.hh"

Expand All @@ -36,36 +36,39 @@ mapping::entry const dimension_timeperiod::entries[] = {
mapping::entry::invalid_on_zero),
mapping::entry(&bam::dimension_timeperiod::name,
"name",
get_mod_bam_reporting_timeperiods_col_size(
mod_bam_reporting_timeperiods_name)),
get_centreon_storage_mod_bam_reporting_timeperiods_col_size(
centreon_storage_mod_bam_reporting_timeperiods_name)),
mapping::entry(&bam::dimension_timeperiod::monday,
"monday",
get_mod_bam_reporting_timeperiods_col_size(
mod_bam_reporting_timeperiods_monday)),
get_centreon_storage_mod_bam_reporting_timeperiods_col_size(
centreon_storage_mod_bam_reporting_timeperiods_monday)),
mapping::entry(&bam::dimension_timeperiod::tuesday,
"tuesday",
get_mod_bam_reporting_timeperiods_col_size(
mod_bam_reporting_timeperiods_tuesday)),
mapping::entry(&bam::dimension_timeperiod::wednesday,
"wednesday",
get_mod_bam_reporting_timeperiods_col_size(
mod_bam_reporting_timeperiods_wednesday)),
mapping::entry(&bam::dimension_timeperiod::thursday,
"thursday",
get_mod_bam_reporting_timeperiods_col_size(
mod_bam_reporting_timeperiods_thursday)),
get_centreon_storage_mod_bam_reporting_timeperiods_col_size(
centreon_storage_mod_bam_reporting_timeperiods_tuesday)),
mapping::entry(
&bam::dimension_timeperiod::wednesday,
"wednesday",
get_centreon_storage_mod_bam_reporting_timeperiods_col_size(
centreon_storage_mod_bam_reporting_timeperiods_wednesday)),
mapping::entry(
&bam::dimension_timeperiod::thursday,
"thursday",
get_centreon_storage_mod_bam_reporting_timeperiods_col_size(
centreon_storage_mod_bam_reporting_timeperiods_thursday)),
mapping::entry(&bam::dimension_timeperiod::friday,
"friday",
get_mod_bam_reporting_timeperiods_col_size(
mod_bam_reporting_timeperiods_friday)),
mapping::entry(&bam::dimension_timeperiod::saturday,
"saturday",
get_mod_bam_reporting_timeperiods_col_size(
mod_bam_reporting_timeperiods_saturday)),
get_centreon_storage_mod_bam_reporting_timeperiods_col_size(
centreon_storage_mod_bam_reporting_timeperiods_friday)),
mapping::entry(
&bam::dimension_timeperiod::saturday,
"saturday",
get_centreon_storage_mod_bam_reporting_timeperiods_col_size(
centreon_storage_mod_bam_reporting_timeperiods_saturday)),
mapping::entry(&bam::dimension_timeperiod::sunday,
"sunday",
get_mod_bam_reporting_timeperiods_col_size(
mod_bam_reporting_timeperiods_sunday)),
get_centreon_storage_mod_bam_reporting_timeperiods_col_size(
centreon_storage_mod_bam_reporting_timeperiods_sunday)),
mapping::entry()};

// Operations.
Expand Down
52 changes: 27 additions & 25 deletions bbdo/bam/kpi_event.cc
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
/*
** Copyright 2014-2015, 2021 Centreon
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
**
** For more information : [email protected]
*/
/**
* Copyright 2014-2015, 2021-2024 Centreon
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* For more information : [email protected]
*/

#include "bbdo/bam/kpi_event.hh"

Expand Down Expand Up @@ -99,14 +99,16 @@ mapping::entry const kpi_event::entries[] = {
mapping::entry(&bam::kpi_event::end_time, "end_time"),
mapping::entry(&bam::kpi_event::impact_level, "impact_level"),
mapping::entry(&bam::kpi_event::in_downtime, "in_downtime"),
mapping::entry(&bam::kpi_event::output,
"first_output",
get_mod_bam_reporting_kpi_events_col_size(
mod_bam_reporting_kpi_events_first_output)),
mapping::entry(&bam::kpi_event::perfdata,
"first_perfdata",
get_mod_bam_reporting_kpi_events_col_size(
mod_bam_reporting_kpi_events_first_perfdata)),
mapping::entry(
&bam::kpi_event::output,
"first_output",
get_centreon_storage_mod_bam_reporting_kpi_events_col_size(
centreon_storage_mod_bam_reporting_kpi_events_first_output)),
mapping::entry(
&bam::kpi_event::perfdata,
"first_perfdata",
get_centreon_storage_mod_bam_reporting_kpi_events_col_size(
centreon_storage_mod_bam_reporting_kpi_events_first_perfdata)),
mapping::entry(&bam::kpi_event::start_time, "start_time"),
mapping::entry(&bam::kpi_event::status, "status"),
mapping::entry()};
Expand Down
Loading

0 comments on commit dc90889

Please sign in to comment.