Skip to content

Commit

Permalink
MON-12908: centreon-mbi etl - fix daily option (#224)
Browse files Browse the repository at this point in the history
  • Loading branch information
garnier-quentin authored Apr 19, 2022
1 parent faa47f0 commit 2bb744d
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions gorgone/gorgone/modules/centreon/mbi/etl/perfdata/main.pm
Original file line number Diff line number Diff line change
Expand Up @@ -307,17 +307,21 @@ sub dailyProcessing {
type => 'sql',
db => 'centstorage',
sql => [
'[PARTITIONS] Add partition [p' . $partName . '] on table [mod_bi_metricdailyvalue]',
"ALTER TABLE `mod_bi_metricdailyvalue` ADD PARTITION (PARTITION `p$partName` VALUES LESS THAN(" . $epoch . "))"
[
'[PARTITIONS] Add partition [p' . $partName . '] on table [mod_bi_metricdailyvalue]',
"ALTER TABLE `mod_bi_metricdailyvalue` ADD PARTITION (PARTITION `p$partName` VALUES LESS THAN(" . $epoch . "))"
]
]
};
if ($etl->{run}->{etlProperties}->{'perfdata.granularity'} ne 'day') {
push @{$etl->{run}->{schedule}->{perfdata}->{stages}->[0]}, {
type => 'sql',
db => 'centstorage',
sql => [
'[PARTITIONS] Add partition [p' . $partName . '] on table [mod_bi_metrichourlyvalue]',
"ALTER TABLE `mod_bi_metrichourlyvalue` ADD PARTITION (PARTITION `p$partName` VALUES LESS THAN(" . $epoch . "))"
[
'[PARTITIONS] Add partition [p' . $partName . '] on table [mod_bi_metrichourlyvalue]',
"ALTER TABLE `mod_bi_metrichourlyvalue` ADD PARTITION (PARTITION `p$partName` VALUES LESS THAN(" . $epoch . "))"
]
]
};
}
Expand All @@ -326,8 +330,10 @@ sub dailyProcessing {
type => 'sql',
db => 'centstorage',
sql => [
'[PARTITIONS] Add partition [p' . $partName . '] on table [mod_bi_metriccentiledailyvalue]',
"ALTER TABLE `mod_bi_metriccentiledailyvalue` ADD PARTITION (PARTITION `p$partName` VALUES LESS THAN(" . $epoch . "))"
[
'[PARTITIONS] Add partition [p' . $partName . '] on table [mod_bi_metriccentiledailyvalue]',
"ALTER TABLE `mod_bi_metriccentiledailyvalue` ADD PARTITION (PARTITION `p$partName` VALUES LESS THAN(" . $epoch . "))"
]
]
};
}
Expand Down

0 comments on commit 2bb744d

Please sign in to comment.