Skip to content

Commit

Permalink
Merge e451559 into 776e305
Browse files Browse the repository at this point in the history
  • Loading branch information
dianaclarke committed Mar 5, 2021
2 parents 776e305 + e451559 commit 0d23ce8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion conbench/app/_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def dataset_name(name):


def display_time(t):
return t.split(".")[0].replace("T", " ")
return t.split(".")[0].replace("T", " ").rsplit(":", 1)[0]


def set_display_time(benchmark):
Expand Down
7 changes: 6 additions & 1 deletion conbench/app/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,15 @@
from ..config import Config


def _display_time(obj, field):
obj[f"display_{field}"] = display_time(obj[field])


class Index(AppEndpoint):
def page(self, runs):
for run in runs:
run["display_timestamp"] = display_time(run["timestamp"])
_display_time(run, "timestamp")
_display_time(run["commit"], "timestamp")
return self.render_template(
"index.html",
application=Config.APPLICATION_NAME,
Expand Down
14 changes: 7 additions & 7 deletions conbench/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,26 +33,26 @@ <h3>Language-independent Continuous Benchmarking (CB) Framework</h3>
</caption>
<thead>
<tr>
<th scope="col">Date</th>
<th scope="col">Run</th>
<th scope="col">Author</th>
<th scope="col">Repository</th>
<th scope="col">Commit</th>
<th scope="col">Date</th>
<th scope="col">Machine</th>
<th scope="col">Results</th>
</tr>
</thead>
<tbody>
{% for run in runs %}
<tr>
<td>{{ run.display_timestamp }}</td>
<td><a href="{{ url_for('app.run', run_id=run.id) }}">{{ run.display_timestamp }}</a></td>
<td>
<image src="{{ run.commit.author_avatar }}" height="30" style="border-radius: 50%;">
&nbsp;&nbsp;{{ run.commit.author_name }}
</td>
<td>
<a href="{{ run.commit.url }}">{{ run.commit.message }}</a>
</td>
<td><a href="{{ run.commit.repository }}">{{ run.commit.repository.split("https://github.com/")[1] }}</a></td>
<td><a href="{{ run.commit.url }}">{{ run.commit.message }}</a></td>
<td>{{ run.commit.display_timestamp }}</td>
<td>{{ run.machine.name }}</td>
<td><a href="{{ url_for('app.run', run_id=run.id) }}">{{ run.id[:7] }}</a></td>
</tr>
{% endfor %}
</tbody>
Expand Down

0 comments on commit 0d23ce8

Please sign in to comment.