Skip to content

Commit

Permalink
fix(gorgone/mbi): add weekly and monthly centiles partitioning (#1546)
Browse files Browse the repository at this point in the history
Co-authored-by: Colin Gagnaire <[email protected]>
  • Loading branch information
kduret and cgagnaire authored Aug 5, 2024
1 parent fb58bca commit c8055ae
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

1 comment on commit c8055ae

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
6 1 0 7 85.71 0s

Failed Tests

Name Message ⏱️ Duration Suite
EBNHGU4_BBDO3 hostgroup_1 not found in /tmp/lua-engine.log 0.000 s Hostgroups

Please sign in to comment.