Skip to content

Commit

Permalink
Merge remote-tracking branch 'centreon-gorgone/MON-141940-dev-23-10-x…
Browse files Browse the repository at this point in the history
…-mbi-error-creating-partition-for-table-metriccentileweeklyvalue' into MON-141940-dev-23-10-x-mbi-error-creating-partition-for-table-metriccentileweeklyvalue-migrate
  • Loading branch information
kduret committed Jul 19, 2024
2 parents 70b5322 + e66eeec commit aa4bf73
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 aa4bf73

Please sign in to comment.