Skip to content

Commit

Permalink
refactor/display milliseconds instead of microseconds for metric page
Browse files Browse the repository at this point in the history
  • Loading branch information
hongwei1 committed Dec 12, 2023
1 parent 19a496c commit 2e0aee0
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 2e0aee0

Please sign in to comment.