diff options
author | Marius Mathiesen <marius@shortcut.no> | 2010-02-03 14:38:03 (GMT) |
---|---|---|
committer | Marius Mathiesen <marius@shortcut.no> | 2010-02-03 14:38:03 (GMT) |
commit | 2ba975497d9d1fa0014d0414631210726c7ef0f3 (patch) | |
tree | ec00b9e91ad2268b7366aaaf6dd9cfa443638831 /db | |
parent | 95b7efce99f7c405cb0a50185f467f8aba74f932 (diff) |
Adding a counter of pushes since last garbage collection, incremented when pushed to and reset when gc-ed
The algorithm for finding gc candidates is unchanged, will run this in production and collect metrics for changing this the next few days.
- Also tracking disk usage for repositories, calculated when pushed to and stored in the database
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20100203132425_adding_disk_size_and_push_count_to_repositories.rb | 11 | ||||
-rw-r--r-- | db/schema.rb | 4 |
2 files changed, 14 insertions, 1 deletions
diff --git a/db/migrate/20100203132425_adding_disk_size_and_push_count_to_repositories.rb b/db/migrate/20100203132425_adding_disk_size_and_push_count_to_repositories.rb new file mode 100644 index 0000000..2381f64 --- /dev/null +++ b/db/migrate/20100203132425_adding_disk_size_and_push_count_to_repositories.rb @@ -0,0 +1,11 @@ +class AddingDiskSizeAndPushCountToRepositories < ActiveRecord::Migration + def self.up + add_column :repositories, :disk_usage, :integer + add_column :repositories, :push_count_since_gc, :integer + end + + def self.down + remove_column :repositories, :disk_usage + remove_column :repositories, :push_count_since_gc + end +end diff --git a/db/schema.rb b/db/schema.rb index d0b5c2d..188607c 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -9,7 +9,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20100126094829) do +ActiveRecord::Schema.define(:version => 20100203132425) do create_table "cloners", :force => true do |t| t.string "ip" @@ -279,6 +279,8 @@ ActiveRecord::Schema.define(:version => 20100126094829) do t.boolean "notify_committers_on_new_merge_request", :default => true t.datetime "last_gc_at" t.boolean "merge_requests_enabled", :default => true + t.integer "disk_usage" + t.integer "push_count_since_gc" end add_index "repositories", ["hashed_path"], :name => "index_repositories_on_hashed_path", :unique => true |