Index: tools/metrics/histograms/update_net_error_codes.py |
diff --git a/tools/metrics/histograms/update_net_error_codes.py b/tools/metrics/histograms/update_net_error_codes.py |
index 3659dd1afccfc7ad61b70a738ae0ad4359795592..7d40ac23180ce70a76c0fa8d4791f53e2c2d8d49 100755 |
--- a/tools/metrics/histograms/update_net_error_codes.py |
+++ b/tools/metrics/histograms/update_net_error_codes.py |
@@ -13,10 +13,10 @@ import os.path |
import re |
import sys |
-sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'common')) |
-from update_histogram_enum import UpdateHistogramFromDict |
+import histograms_path |
+import update_histogram_enum |
-NET_ERROR_LIST_PATH = '../../../net/base/net_error_list.h' |
+NET_ERROR_LIST_PATH = 'net/base/net_error_list.h' |
POSITIVE_ERROR_REGEX = re.compile(r'^NET_ERROR\(([\w]+), -([0-9]+)\)') |
NEGATIVE_ERROR_REGEX = re.compile(r'^NET_ERROR\(([\w]+), (-[0-9]+)\)') |
@@ -26,7 +26,7 @@ def ReadNetErrorCodes(filename, error_regex): |
error code to error name. |
""" |
# Read the file as a list of lines |
- with open(filename) as f: |
+ with open(histograms_path.GetInputFile(filename)) as f: |
content = f.readlines() |
# Parse out lines that are net errors. |
@@ -43,12 +43,12 @@ def main(): |
sys.stderr.write(__doc__) |
sys.exit(1) |
- UpdateHistogramFromDict( |
+ update_histogram_enum.UpdateHistogramFromDict( |
'NetErrorCodes', |
ReadNetErrorCodes(NET_ERROR_LIST_PATH, POSITIVE_ERROR_REGEX), |
NET_ERROR_LIST_PATH) |
- UpdateHistogramFromDict( |
+ update_histogram_enum.UpdateHistogramFromDict( |
'CombinedHttpResponseAndNetErrorCode', |
ReadNetErrorCodes(NET_ERROR_LIST_PATH, NEGATIVE_ERROR_REGEX), |
NET_ERROR_LIST_PATH) |