aboutsummaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
authorPeter Wilmott <p@p8952.info>2015-02-18 12:08:27 +0000
committerPeter Wilmott <p@p8952.info>2015-02-18 12:08:27 +0000
commit9c7c94ccc58a1669bc74a19739946cc989033d5c (patch)
tree8cc8dd70b44a65475c11e355a9723cd8e9215859 /web
parentDon't keep 3 copies of the portage timestamp (diff)
downloadruby-tinderbox-9c7c94ccc58a1669bc74a19739946cc989033d5c.tar.gz
ruby-tinderbox-9c7c94ccc58a1669bc74a19739946cc989033d5c.tar.bz2
ruby-tinderbox-9c7c94ccc58a1669bc74a19739946cc989033d5c.zip
Pull timestamps from the latest build/repoman entry
Diffstat (limited to 'web')
-rw-r--r--web/app.rb24
-rw-r--r--web/views/build_status.erb4
-rw-r--r--web/views/repoman_checks.erb4
-rw-r--r--web/views/ruby_targets.erb4
-rw-r--r--web/views/visualizations.erb4
5 files changed, 25 insertions, 15 deletions
diff --git a/web/app.rb b/web/app.rb
index cf49378..4f070a2 100644
--- a/web/app.rb
+++ b/web/app.rb
@@ -20,18 +20,24 @@ class RubyStats < Sinatra::Base
end
get '/ruby_targets' do
+ update_timestamp = Package.first[:update_timestamp]
+ portage_timestamp = Package.first[:portage_timestamp]
packages = Package.order { [category, lower(name), version, revision] }.to_hash_groups(:identifier)
- erb :ruby_targets, locals: { packages: packages }
+ erb :ruby_targets, locals: { packages: packages, update_timestamp: update_timestamp, portage_timestamp: portage_timestamp }
end
get '/outdated_gems' do
+ update_timestamp = Package.first[:update_timestamp]
+ portage_timestamp = Package.first[:portage_timestamp]
packages = Package.distinct(:category, :name).order(:category, :name, Sequel.desc(:version), Sequel.desc(:revision)).exclude(gem_version: 'nil')
- erb :outdated_gems, locals: { packages: packages }
+ erb :outdated_gems, locals: { packages: packages, update_timestamp: update_timestamp, portage_timestamp: portage_timestamp }
end
get '/build_status' do
+ update_timestamp = Build.order(:time).last[:time]
+ portage_timestamp = Package.first[:portage_timestamp]
builds = Build.distinct(:package_id).order(:package_id, Sequel.desc(:time))
- erb :build_status, locals: { builds: builds }
+ erb :build_status, locals: { builds: builds, update_timestamp: update_timestamp, portage_timestamp: portage_timestamp }
end
get '/build_history/:category/:package' do
@@ -45,8 +51,10 @@ class RubyStats < Sinatra::Base
end
get '/repoman_checks' do
+ update_timestamp = Repoman.order(:time).last[:time]
+ portage_timestamp = Package.first[:portage_timestamp]
repomans = Repoman.distinct(:package_id).order(:package_id, Sequel.desc(:time))
- erb :repoman_checks, locals: { repomans: repomans }
+ erb :repoman_checks, locals: { repomans: repomans, update_timestamp: update_timestamp, portage_timestamp: portage_timestamp }
end
get '/repoman_logs/:category/:package/:time' do
@@ -60,8 +68,9 @@ class RubyStats < Sinatra::Base
end
get '/visualizations' do
- # Last Updated
- packages = Package.distinct(:category, :name).order(:category, :name, Sequel.desc(:version), Sequel.desc(:revision)).exclude(gem_version: 'nil')
+ # Timestamps
+ update_timestamp = Package.first[:update_timestamp]
+ portage_timestamp = Package.first[:portage_timestamp]
# Ruby Targets
ruby_1_9_amd64 = Package.where(r19_target: 'ruby19', amd64_keyword: 'amd64').count
@@ -85,7 +94,8 @@ class RubyStats < Sinatra::Base
timed_out = Build.distinct(:package_id).order(:package_id, Sequel.desc(:time)).where(result: 'timed out').count
erb :visualizations, locals: {
- packages: packages,
+ portage_timestamp: portage_timestamp,
+ update_timestamp: update_timestamp,
ruby_1_9_amd64: ruby_1_9_amd64,
ruby_1_9__amd64: ruby_1_9__amd64,
ruby_2_0_amd64: ruby_2_0_amd64,
diff --git a/web/views/build_status.erb b/web/views/build_status.erb
index 7b03aa4..13d7434 100644
--- a/web/views/build_status.erb
+++ b/web/views/build_status.erb
@@ -2,9 +2,9 @@
<h1>Build Status (CI)</h1>
<small>
Last updated on
- <%=Time.at(builds.first[:update_timestamp].to_i).strftime('%Y-%m-%d')%>
+ <%=Time.at(update_timestamp.to_i).strftime('%Y-%m-%d')%>
using a portage snapshot dated
- <%=Time.at(builds.first[:portage_timestamp].to_i).strftime('%Y-%m-%d')%>
+ <%=Time.at(portage_timestamp.to_i).strftime('%Y-%m-%d')%>
</small>
</div>
diff --git a/web/views/repoman_checks.erb b/web/views/repoman_checks.erb
index 2cfa060..01de59d 100644
--- a/web/views/repoman_checks.erb
+++ b/web/views/repoman_checks.erb
@@ -2,9 +2,9 @@
<h1>Repoman Checks</h1>
<small>
Last updated on
- <%=Time.at(repomans.first[:update_timestamp].to_i).strftime('%Y-%m-%d')%>
+ <%=Time.at(update_timestamp.to_i).strftime('%Y-%m-%d')%>
using a portage snapshot dated
- <%=Time.at(repomans.first[:portage_timestamp].to_i).strftime('%Y-%m-%d')%>
+ <%=Time.at(portage_timestamp.to_i).strftime('%Y-%m-%d')%>
</small>
</div>
diff --git a/web/views/ruby_targets.erb b/web/views/ruby_targets.erb
index bb97a08..5db7a13 100644
--- a/web/views/ruby_targets.erb
+++ b/web/views/ruby_targets.erb
@@ -2,9 +2,9 @@
<h1>Ruby Targets</h1>
<small>
Last updated on
- <%=Time.at(packages.first[1][0][:update_timestamp].to_i).strftime('%Y-%m-%d')%>
+ <%=Time.at(update_timestamp.to_i).strftime('%Y-%m-%d')%>
using a portage snapshot dated
- <%=Time.at(packages.first[1][0][:portage_timestamp].to_i).strftime('%Y-%m-%d')%>
+ <%=Time.at(portage_timestamp.to_i).strftime('%Y-%m-%d')%>
</small>
</div>
diff --git a/web/views/visualizations.erb b/web/views/visualizations.erb
index d2adb35..9b22e6e 100644
--- a/web/views/visualizations.erb
+++ b/web/views/visualizations.erb
@@ -8,9 +8,9 @@
<h1>Visualizations</h1>
<small>
Last updated on
- <%=Time.at(packages.first[:update_timestamp].to_i).strftime('%Y-%m-%d')%>
+ <%=Time.at(update_timestamp.to_i).strftime('%Y-%m-%d')%>
using a portage snapshot dated
- <%=Time.at(packages.first[:portage_timestamp].to_i).strftime('%Y-%m-%d')%>
+ <%=Time.at(portage_timestamp.to_i).strftime('%Y-%m-%d')%>
</small>
<h2>Number of Packages per Ruby Target</h2>