Skip to content

Commit

Permalink
fix(gorgone/mbi): add weekly and monthly centiles partitioning [dev-2…
Browse files Browse the repository at this point in the history
…3.04.x] (#1556)
  • Loading branch information
s-duret authored Aug 5, 2024
1 parent fef3c30 commit 10aa739
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 10aa739

Please sign in to comment.