Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(140)

Unified Diff: tools/memory_inspector/memory_inspector/frontends/www_server.py

Issue 850033002: Remove dependency on dateutil in memory_inspector (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reuse Archive._TIME_FMT Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/memory_inspector/memory_inspector/data/file_storage.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/memory_inspector/memory_inspector/frontends/www_server.py
diff --git a/tools/memory_inspector/memory_inspector/frontends/www_server.py b/tools/memory_inspector/memory_inspector/frontends/www_server.py
index b5f8efc9eeb211d59b7dd6111faefb09acced203..c79112f899f5fe92b94941cba1a410fdd90e3e4f 100644
--- a/tools/memory_inspector/memory_inspector/frontends/www_server.py
+++ b/tools/memory_inspector/memory_inspector/frontends/www_server.py
@@ -21,7 +21,6 @@ The following HTTP status code are returned by the server:
import cgi
import collections
import datetime
-import dateutil.parser
import glob
import json
import memory_inspector
@@ -187,7 +186,7 @@ def _CreateProfile(args, req_vars): # pylint: disable=W0613
return _HTTP_GONE, [], 'Cannot open archive %s' % req_vars['archive']
first_timestamp = None
for timestamp_str in req_vars['snapshots']:
- timestamp = dateutil.parser.parse(timestamp_str)
+ timestamp = file_storage.Archive.StrToTimestamp(timestamp_str)
first_timestamp = first_timestamp or timestamp
time_delta = int((timestamp - first_timestamp).total_seconds())
if req_vars['type'] == 'mmap':
@@ -545,7 +544,8 @@ def _ListStorage(args, req_vars): # pylint: disable=W0613
time_delta = '%d s.' % (timestamp - first_timestamp).total_seconds()
resp['rows'] += [{'c': [
{'v': archive_name, 'f': None},
- {'v': timestamp.isoformat(), 'f': time_delta},
+ {'v': file_storage.Archive.TimestampToStr(timestamp),
+ 'f': time_delta},
{'v': archive.HasMemMaps(timestamp), 'f': None},
{'v': archive.HasNativeHeap(timestamp), 'f': None},
]}]
@@ -558,7 +558,7 @@ def _LoadMmapsFromStorage(args, req_vars): # pylint: disable=W0613
if not archive:
return _HTTP_GONE, [], 'Cannot open archive %s' % req_vars['archive']
- timestamp = dateutil.parser.parse(args[1])
+ timestamp = file_storage.Archive.StrToTimestamp(args[1])
if not archive.HasMemMaps(timestamp):
return _HTTP_GONE, [], 'No mmaps for snapshot %s' % timestamp
mmap = archive.LoadMemMaps(timestamp)
@@ -572,7 +572,7 @@ def _LoadNheapFromStorage(args, req_vars):
if not archive:
return _HTTP_GONE, [], 'Cannot open archive %s' % req_vars['archive']
- timestamp = dateutil.parser.parse(args[1])
+ timestamp = file_storage.Archive.StrToTimestamp(args[1])
if not archive.HasNativeHeap(timestamp):
return _HTTP_GONE, [], 'No native heap dump for snapshot %s' % timestamp
@@ -758,4 +758,4 @@ def Start(http_port):
httpd.serve_forever()
except KeyboardInterrupt:
pass # Don't print useless stack traces when the user hits CTRL-C.
- background_tasks.TerminateAll()
+ background_tasks.TerminateAll()
« no previous file with comments | « tools/memory_inspector/memory_inspector/data/file_storage.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698