Skip to content

Commit

Permalink
Merge remote-tracking branch 'centreon-gorgone/MON-141941-dev-24-04-x…
Browse files Browse the repository at this point in the history
…-mbi-error-creating-partition-for-table-metriccentileweeklyvalue' into MON-141941-dev-24-04-x-mbi-error-creating-partition-for-table-metriccentileweeklyvalue-migrate
  • Loading branch information
kduret committed Jul 19, 2024
2 parents d0d0128 + f54ff44 commit c7cd428
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions gorgone/gorgone/modules/centreon/mbi/etl/perfdata/main.pm
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,30 @@ sub dailyProcessing {
]
};
}
if (defined($etl->{run}->{etlProperties}->{'centile.week'}) && $etl->{run}->{etlProperties}->{'centile.week'} eq '1') {
push @{$etl->{run}->{schedule}->{perfdata}->{stages}->[0]}, {
type => 'sql',
db => 'centstorage',
sql => [
[
'[PARTITIONS] Add partition [p' . $partName . '] on table [mod_bi_metriccentileweeklyvalue]',
"ALTER TABLE `mod_bi_metriccentileweeklyvalue` ADD PARTITION (PARTITION `p$partName` VALUES LESS THAN(" . $epoch . "))"
]
]
};
}
if (defined($etl->{run}->{etlProperties}->{'centile.month'}) && $etl->{run}->{etlProperties}->{'centile.month'} eq '1') {
push @{$etl->{run}->{schedule}->{perfdata}->{stages}->[0]}, {
type => 'sql',
db => 'centstorage',
sql => [
[
'[PARTITIONS] Add partition [p' . $partName . '] on table [mod_bi_metriccentilemonthlyvalue]',
"ALTER TABLE `mod_bi_metriccentilemonthlyvalue` ADD PARTITION (PARTITION `p$partName` VALUES LESS THAN(" . $epoch . "))"
]
]
};
}

# processing agregation by month. If the day is the first day of the month, also processing agregation by month
processDayAndMonthAgregation($etl, $liveServices, $start, $end);
Expand Down

0 comments on commit c7cd428

Please sign in to comment.