X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/7e43a00fd352fa3f43bb9041a0782eff3bf0be0a..45a52249135d25d86c853e2146eaebe808764245:/munin/nominatim_query_speed_querylog?ds=inline diff --git a/munin/nominatim_query_speed_querylog b/munin/nominatim_query_speed_querylog index 3ae92592..4bbeac68 100755 --- a/munin/nominatim_query_speed_querylog +++ b/munin/nominatim_query_speed_querylog @@ -4,7 +4,7 @@ # # Uses the query log. # -# Parameters: +# Parameters: # # config (required) # autoconf (optional - used by munin-config) @@ -26,14 +26,12 @@ avgs.draw LINE avgs.type GAUGE avgs.min 0 avgs.info Moving 5 minute average time to perform search -avgs.label Average time to response avgr.label Average reverse time avgr.draw LINE avgr.type GAUGE avgr.min 0 -avgr.info Moving 5 minute average time to perform search -avgr.label Average time to response +avgr.info Moving 5 minute average time to perform reverse max.label Slowest time to response max.draw LINE @@ -49,7 +47,7 @@ class LogFile: """ A query log file, unpacked. """ def __init__(self, filename): - self.fd = open(filename) + self.fd = open(filename, encoding='utf-8', errors='replace') self.len = os.path.getsize(filename) def __del__(self): @@ -130,9 +128,8 @@ class LogFile: def loglines(self): for l in self.fd: e = ENTRY_REGEX.match(l) - if e is None: - raise ValueError("Invalid log line:", l) - yield e.groupdict() + if e is not None: + yield e.groupdict() if __name__ == '__main__':