-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Collect uptime data in daily heartbeat from connect-ng
- Loading branch information
1 parent
e15f965
commit f1640eb
Showing
16 changed files
with
194 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
class SystemUptime < ApplicationRecord | ||
belongs_to :system | ||
|
||
validates :system_id, presence: true | ||
validates :online_at_day, presence: true | ||
validates :online_at_hours, presence: true | ||
end |
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,18 @@ | ||
class CreateSystemUptimes < ActiveRecord::Migration[6.1] | ||
def change | ||
safety_assured do | ||
create_table :system_uptimes do |t| | ||
t.bigint :system_id, null: false | ||
t.date :online_at_day, null: false | ||
t.column :online_at_hours, 'binary(24)', null: false | ||
t.timestamps | ||
end | ||
|
||
commit_db_transaction | ||
|
||
add_index :system_uptimes, %i[system_id online_at_day], unique: true, name: 'id_online_day' | ||
|
||
add_foreign_key :system_uptimes, :systems, column: :system_id, validate: false | ||
end | ||
end | ||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
namespace :db do | ||
namespace :maintenance do | ||
desc 'Delete all uptime tracking data which are older than 90 days' | ||
task cleanup_uptime_tracking: :environment do | ||
SystemUptime.where("online_at_day < '#{90.days.ago}'").delete_all | ||
end | ||
end | ||
end |
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,12 @@ | ||
[Unit] | ||
Description=RMT uptime cleanup service | ||
Requires=mysql.service | ||
Wants=rmt-uptime-cleanup.timer | ||
|
||
[Service] | ||
Type=oneshot | ||
WorkingDirectory=/usr/share/rmt/bin | ||
ExecStart=bundle exec rake db:maintenance:cleanup_uptime_tracking RAILS_ENV=production | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
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,10 @@ | ||
[Unit] | ||
Description=RMT Uptime Data cleanup timer | ||
|
||
[Timer] | ||
# Run this timer every day at a randomized 24h delay. | ||
OnCalendar=weekly | ||
RandomizedDelaySec=24h | ||
|
||
[Install] | ||
WantedBy=timers.target |
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 |
---|---|---|
@@ -1,3 +1,11 @@ | ||
Thu April 17 15:22:00 UTC 2024 - Yogalakshmi Arunachalam <[email protected]> | ||
|
||
- Adding Uptime tracking capability | ||
* Uptime data is included in the data sent to SCC via RMT | ||
* https://jira.suse.com/browse/PED-7982 | ||
* https://jira.suse.com/browse/PED-8018 | ||
|
||
------------------------------------------------------------------- | ||
Thu April 11 15:22:00 UTC 2024 - Felix Schnizlein <[email protected]> | ||
|
||
- Version 2.16 : | ||
|
@@ -6,6 +14,18 @@ Thu April 11 15:22:00 UTC 2024 - Felix Schnizlein <[email protected]> | |
directories are obsolete and can be removed savely. | ||
* Add support for debian repositories using flat or nested structures (jsc#PED-3684) | ||
|
||
------------------------------------------------------------------- | ||
Thu April 07 13:23:00 UTC 2024 - Felix Schnizlein <[email protected]> | ||
|
||
- Version 2.16 (unreleased): | ||
* Support bzip2 compressed repositories (bsc#1222122) | ||
|
||
------------------------------------------------------------------- | ||
Thu Mar 07 15:33:00 UTC 2024 - Likhitha Priya <[email protected]> | ||
|
||
- Version 2.16: | ||
* Add support for debian repositories using flat or nested structures | ||
|
||
------------------------------------------------------------------- | ||
Wed Oct 04 13:23:00 UTC 2023 - Felix Schnizlein <[email protected]> | ||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
FactoryBot.define do | ||
factory :system_uptime do | ||
association :system | ||
sequence(:online_at_day) { Time.zone.now } | ||
online_at_hours { '111111111111111111111111' } | ||
end | ||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
require 'rails_helper' | ||
|
||
RSpec.describe SystemUptime, type: :model do | ||
it { is_expected.to validate_presence_of(:system_id) } | ||
it { is_expected.to validate_presence_of(:online_at_day) } | ||
it { is_expected.to validate_presence_of(:online_at_hours) } | ||
end |
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