Skip to content

Commit

Permalink
Merge pull request #316 from 4dn-dcic/metric_html_title
Browse files Browse the repository at this point in the history
Metric html title
  • Loading branch information
SooLee authored Feb 22, 2021
2 parents 0d14059 + ec04673 commit 4fe706c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion tibanna/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Version information."""

# The following line *must* be the last in the module, exactly as formatted:
__version__ = "1.0.2"
__version__ = "1.0.4"
13 changes: 8 additions & 5 deletions tibanna/cw_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class TibannaResource(object):
"""

timestamp_format = '%Y-%m-%d %H:%M:%S'
report_title = 'Tibanna Metrics'

@classmethod
def convert_timestamp_to_datetime(cls, timestamp):
Expand Down Expand Up @@ -322,7 +323,7 @@ def write_html(self, instance_type, directory):
self.check_mkdir(directory)
filename = directory + '/' + 'metrics.html'
with open(filename, 'w') as fo:
fo.write(self.create_html() % (instance_type,
fo.write(self.create_html() % (self.report_title, instance_type,
str(self.max_mem_used_MB), str(self.min_mem_available_MB), str(self.max_disk_space_used_GB),
str(self.max_mem_utilization_percent), str(self.max_cpu_utilization_percent),
str(self.max_disk_space_utilization_percent),
Expand Down Expand Up @@ -356,7 +357,7 @@ def update_html(cls, bucket, prefix, directory='.', upload_new=True):
instance = d['Instance_Type'] if 'Instance_Type' in d else '---'
# writing
with open(filename, 'w') as fo:
fo.write(cls.create_html() % (instance,
fo.write(cls.create_html() % (cls.report_title, instance,
d['Maximum_Memory_Used_Mb'], d['Minimum_Memory_Available_Mb'], d['Maximum_Disk_Used_Gb'],
d['Maximum_Memory_Utilization'], d['Maximum_CPU_Utilization'], d['Maximum_Disk_Utilization'],
cost,
Expand Down Expand Up @@ -438,7 +439,9 @@ def create_html(cls):
<meta charset="utf-8">
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,300,400,600,700,900,300i,400i,600i" rel="stylesheet"/>
<style type="text/css">
:root { font-size: 16px }
:root {
font-size: 16px
}
body{ margin: 0; }
/* Basic Styling with CSS */
h1 {
Expand Down Expand Up @@ -566,7 +569,7 @@ def create_html(cls):
<!-- Body tag is where we will append our SVG and SVG objects-->
<body>
<div class="logo">
<h1>Tibanna Metrics</h1>
<h1>%s</h1>
</div></br></br>
<section>
</br>
Expand Down Expand Up @@ -910,7 +913,7 @@ def create_html(cls):
n = n_data
}
// sum for each timepoint, to calculate y scale
sum_array = d3.range(n_data).map(function(d) {
sum_array = d3.range(n_data).map(function(d) {
var sum = 0
for( col=0; col<n_cols; col++) sum += data_array[col][d]
return sum
Expand Down

0 comments on commit 4fe706c

Please sign in to comment.