Skip to content

Commit

Permalink
Merge pull request #351 from hongwei1/develop
Browse files Browse the repository at this point in the history
refactor/display milliseconds instead of microseconds for metric page
  • Loading branch information
simonredfern authored Dec 13, 2023
2 parents 19a496c + 2e0aee0 commit 5482acb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion apimanager/metrics/templates/metrics/api.html
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ <h2>{% trans "Filter" %}</h2>
<td>{{ metric.url }}</td>
<td>{{ metric.source_ip}}</td>
<td>{{ metric.target_ip }}</td>
<td>{{ metric.date|date:"Y-m-d H:i:s.u" }}</td>
<td>{{ metric.date}}</td>
<td>{{ metric.duration }}</td>
</tr>

Expand Down
2 changes: 1 addition & 1 deletion apimanager/metrics/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def to_django(self, metrics):
"""
for metric in metrics:
metric['date'] = datetime.datetime.strptime(
metric['date'], settings.API_DATE_FORMAT_WITH_SECONDS )
metric['date'], settings.API_DATE_FORMAT_WITH_MILLISECONDS).isoformat(timespec='milliseconds')
return metrics

def to_api(self, cleaned_data):
Expand Down

0 comments on commit 5482acb

Please sign in to comment.