Skip to content

Commit c4d3d80

Browse files
committed
primera version de produccion
1 parent 6b165f5 commit c4d3d80

File tree

9 files changed

+1033
-64
lines changed

9 files changed

+1033
-64
lines changed

app/models/job.rb

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def js_line_chart(attr)
110110

111111
def self.build_from_xml
112112

113-
@file_name = ((Time.now)-(3.day)).strftime("%Y%m%d") + ".xml"
113+
@file_name = ((Time.now)-(1.day)).strftime("%Y%m%d") + ".xml"
114114
@host = 'account'
115115
@user = 'account'
116116
@pass = '2hot2work'
@@ -151,16 +151,8 @@ def self.build_from_xml
151151
)
152152
end
153153
end
154-
for job in @jobs do
155-
@split = job.jobname.split('_')
156-
job.project = Project.find_by_name(@split[0])
157-
job.proceso = Proceso.find_by_name(@split[1])
158-
job.walltime = total_seconds(job.walltime)
159-
job.cput = total_seconds(job.cput)
160-
job.time_in_queue = (job.start.to_i) - (job.ctime.to_i)
161-
job.time_in_execution = (job.end.to_i) - (job.start.to_i)
162-
job.save
163-
end
154+
remove_xml = `rm data/xml/#{@file_name}`
155+
jobs
164156
end
165157

166158
def self.save_xml
@@ -183,18 +175,9 @@ def self.disk_free()
183175
end
184176

185177
def self.ssh_test
178+
@file_name = ((Time.now)-(1.day)).strftime("%Y%m%d") + ".xml"
186179
puts "test"
187-
@file_to_download = ((Time.now)-(1.day)).strftime("%Y%m%d") + ".xml"
188-
@host = 'account'
189-
@user = 'account'
190-
@pass = '2hot2work'
191-
192-
Net::SCP.start( @host, @user, :password => @pass ) do |scp|
193-
puts "entro en el l"
194-
scp.download!( "/usr/local/accounting/xml/#{@file_to_download}", 'data/xml', options ={ :verbose => "1"}) do |ch, name, sent, total|
195-
puts "#{name}: #{sent}/#{total}"
196-
end
197-
end
180+
remove_xml = `rm data/xml/#{@file_name}`
198181

199182
end
200183

app/views/charts/bar_chart.html.erb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,8 @@ $(document).ready(function() {
1616
</script>
1717
<% end %>
1818

19-
<h3>Desde: <%= @from %> Hasta: <%= @to %></h3>
20-
21-
19+
<h4>From: <%= @from.readable_inspect %></h4>
20+
<h4>To: <%= @to.readable_inspect %></h4>
2221

2322
<%= render :partial => "shared/bar", :locals => { :insert_div => "chart"} %>
2423

app/views/charts/disk_space.html.erb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
});
2323
</script>
2424
<% end %>
25-
<p>
26-
<b>Charts:</b>
27-
</p>
25+
<h2>
26+
<b>Disk Usage Chart:</b>
27+
</h2>
2828
<% form_for :chart, @chart, :url => { :action => "show_disk_space" }, :html=>{:class=>"form"} do |f| %>
2929
<%= error_messages_for :chart,
3030
:header_message => "Please Try Again!",
@@ -42,6 +42,7 @@
4242
<%= f.text_field :to %>
4343
</p>
4444
<p>
45+
<label for="type">Type</label>
4546
<select id="type" name="type">
4647
<option value= "line">LINE</option>
4748
<option value= "bar">BAR</option>

app/views/charts/index.html.erb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
});
2323
</script>
2424
<% end %>
25-
<p>
26-
<b>Charts:</b>
27-
</p>
25+
<h2>
26+
<b>Resource Chart:</b>
27+
</h2>
2828
<% form_for :chart, @chart, :url => { :action => "show" }, :html=>{:class=>"form"} do |f| %>
2929
<%= error_messages_for :chart,
3030
:header_message => "Please Try Again!",

app/views/charts/line_chart.html.erb

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,10 @@ $(document).ready(function() {
1616
</script>
1717
<% end %>
1818

19+
<h4>From: <%= @from.readable_inspect %></h4>
20+
<h4>To: <%= @to.readable_inspect %></h4>
1921

20-
<h2><%= @chart.title %></h2>
21-
<h2><%= @from %></h2>
22-
<h2><%= @to %></h2>
23-
<h2><%= @type %></h2>
22+
<%= render :partial => "shared/line", :locals => { :insert_div => "chart"} %>
2423

2524

26-
<h3>Selected Projects</h3>
27-
28-
29-
30-
31-
<%= render :partial => "shared/line", :locals => { :insert_div => "memory_line_chart", :title => "Memory Vs Virtual Memory"} %>
32-
33-
34-
<div id="memory_line_chart" style="width:800px; height:450px"></div>
25+
<div id="chart" style="width:800px; height:450px"></div>

app/views/charts/pie_chart.html.erb

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,8 @@ $(document).ready(function() {
1616
</script>
1717
<% end %>
1818

19-
20-
<h2><%= @chart.title %></h2>
21-
<h2><%= @from %></h2>
22-
<h2><%= @to %></h2>
23-
<h2><%= @type %></h2>
24-
25-
26-
<h3>Selected Projects</h3>
27-
28-
29-
19+
<h4>From: <%= @from.readable_inspect %></h4>
20+
<h4>To: <%= @to.readable_inspect %></h4>
3021

3122
<%= render :partial => "shared/pie", :locals => { :insert_div => "chart"} %>
3223

app/views/charts/show_disk_space.html.erb

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,11 @@ $(document).ready(function() {
1515
});
1616
</script>
1717
<% end %>
18+
<h4>From: <%= @from.readable_inspect %></h4>
19+
<h4>To: <%= @to.readable_inspect %></h4>
1820

1921

20-
<h2><%= @chart.title %></h2>
21-
<h2><%= @from %></h2>
22-
<h2><%= @to %></h2>
22+
<%= render :partial => "shared/disk_line", :locals => { :insert_div => "chart"}%>
2323

2424

25-
26-
27-
<%= render :partial => "shared/disk_line", :locals => { :insert_div => "memory_line_chart"}%>
28-
29-
30-
<div id="memory_line_chart" style="width:800px; height:450px"></div>
25+
<div id="chart" style="width:800px; height:450px"></div>

app/views/shared/_disk_line.html.erb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ $(document).ready(function() {
4141
y: 100,
4242
borderWidth: 0
4343
},
44+
credits: {
45+
enabled: false
46+
},
4447
series: [
4548

4649
<% for series in @data %>

0 commit comments

Comments
 (0)