deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@apache.org
Subject [2/2] git commit: EC2: Added HTML views for metrics
Date Mon, 30 Apr 2012 12:22:32 GMT
EC2: Added HTML views for metrics

Signed-off-by: Michal fojtik <mfojtik@redhat.com>


Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/2b449f17
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/2b449f17
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/2b449f17

Branch: refs/heads/master
Commit: 2b449f17eeea5012185ff4c07c13a50d34180535
Parents: 3b7d1b2
Author: Michal Fojtik <mfojtik@redhat.com>
Authored: Wed Jan 18 15:26:50 2012 +0100
Committer: Michal fojtik <mfojtik@redhat.com>
Committed: Mon Apr 30 14:22:18 2012 +0200

----------------------------------------------------------------------
 server/lib/deltacloud/drivers/ec2/ec2_driver.rb |    2 +-
 server/public/images/metric.png                 |  Bin 0 -> 14576 bytes
 server/views/metrics/index.html.haml            |   13 ++++++++++
 server/views/metrics/show.html.haml             |   23 ++++++++++++++++++
 4 files changed, 37 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/2b449f17/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/drivers/ec2/ec2_driver.rb b/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
index 19482ad..7d2d018 100644
--- a/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
+++ b/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
@@ -1023,7 +1023,7 @@ module Deltacloud
         def convert_metric(metric)
           Metric.new(
             :id => metric[:value],
-            :entity => metric[:name] || :unknown,
+            :entity => metric[:name] || :unknown
           ).add_property(metric[:measure_name])
         end
 

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/2b449f17/server/public/images/metric.png
----------------------------------------------------------------------
diff --git a/server/public/images/metric.png b/server/public/images/metric.png
new file mode 100644
index 0000000..98b7f76
Binary files /dev/null and b/server/public/images/metric.png differ

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/2b449f17/server/views/metrics/index.html.haml
----------------------------------------------------------------------
diff --git a/server/views/metrics/index.html.haml b/server/views/metrics/index.html.haml
new file mode 100644
index 0000000..53635ae
--- /dev/null
+++ b/server/views/metrics/index.html.haml
@@ -0,0 +1,13 @@
+=header "Metrics"
+=subheader "#{Thread::current[:provider] || ENV['API_PROVIDER'] || 'default'}"
+
+%div{ :'data-role' => :content, :'data-theme' => 'c'}
+  %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' =>
'a'}
+    %li{ :'data-role' => 'list-divider'}=driver_symbol
+    - @metrics.each do |metric|
+      %li
+        %a{ :href => metric_url(metric.id), :'data-ajax' => 'false'}
+          %img{ :class => 'ui-link-thumb', :src => '/images/metric.png'}
+          %h3= metric.id
+          %p
+            = metric.properties.map { |p| p.name }.join(', ')

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/2b449f17/server/views/metrics/show.html.haml
----------------------------------------------------------------------
diff --git a/server/views/metrics/show.html.haml b/server/views/metrics/show.html.haml
new file mode 100644
index 0000000..c1d88fc
--- /dev/null
+++ b/server/views/metrics/show.html.haml
@@ -0,0 +1,23 @@
+=header Metric
+=subheader @metric.id
+
+%div{ :'data-role' => :content, :'data-theme' => 'c'}
+  %div{ :'data-role' => :'collapsible-set'}
+    - @metric.properties.each do |p|
+      %div{ :'data-role' => :'collapsible', :'data-collapse' => 'true'}
+        %h3=p.name
+        %table{ :summary => "#{p.name} values"}
+          %caption Statistics for last 60 minutes
+          %tr
+            %th Time
+            %th Minumum
+            %th Maximum
+            %th Average
+            %th Units
+          - p.values.each do |v|
+            %tr
+              %td=v[:timestamp]
+              %td=v[:minimum]
+              %td=v[:maximum]
+              %td=v[:average]
+              %td=v[:unit]


Mime
View raw message