-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cleans metrics raw data if they are inactive.
The truncating of the raw metrics data is only done when new measures are pushed. Therefore, if no new measures are pushed, and the archive policy is updated to reduce the back window, the raw data points for metrics that are not receiving new data points are never truncated. The goal of this PR is to propose a method to identify metrics that are in "inactive state", meaning, not receiving new data points, and execute their raw data points truncation when the archive policy backwindow is changed.
- Loading branch information
1 parent
7a289c9
commit 3963a4a
Showing
15 changed files
with
328 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
gnocchi/indexer/alembic/versions/18fff4509e3e_create_metric_last_push_timestamp_column.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Copyright 2015 OpenStack Foundation | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
# not use this file except in compliance with the License. You may obtain | ||
# a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
# License for the specific language governing permissions and limitations | ||
# under the License. | ||
# | ||
|
||
"""create metric status column | ||
Revision ID: 18fff4509e3e | ||
Revises: 04eba72e4f90 | ||
Create Date: 2024-04-24 09:16:00 | ||
""" | ||
|
||
import datetime | ||
from alembic import op | ||
from sqlalchemy.sql import func | ||
|
||
import sqlalchemy as sa | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = '18fff4509e3e' | ||
down_revision = '04eba72e4f90' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
op.add_column("metric", | ||
sa.Column("backwindow_changed", sa.Boolean, | ||
nullable=False, default=False)) | ||
for column_name in ['last_measure_push', 'last_cleanup_timestamp']: | ||
op.add_column("metric", sa.Column(column_name, | ||
sa.DateTime(timezone=True), | ||
nullable=False, | ||
server_default=func.now())) | ||
index_name = "idx_%s" % column_name | ||
op.create_index(index_name, 'metric', | ||
[column_name], unique=False) |
Oops, something went wrong.