diff --git a/locust/runners.py b/locust/runners.py index 2a0e077415..a6e9542e13 100644 --- a/locust/runners.py +++ b/locust/runners.py @@ -97,18 +97,18 @@ def spawn_locusts(self, spawn_count=None, stop_timeout=None, wait=False): self.num_clients += spawn_count logger.info("Hatching and swarming %i clients at the rate %g clients/s..." % (spawn_count, self.hatch_rate)) - occurence_count = dict([(l.__name__, 0) for l in self.locust_classes]) + occurrence_count = dict([(l.__name__, 0) for l in self.locust_classes]) def hatch(): sleep_time = 1.0 / self.hatch_rate while True: if not bucket: - logger.info("All locusts hatched: %s" % ", ".join(["%s: %d" % (name, count) for name, count in six.iteritems(occurence_count)])) + logger.info("All locusts hatched: %s" % ", ".join(["%s: %d" % (name, count) for name, count in six.iteritems(occurrence_count)])) events.hatch_complete.fire(user_count=self.num_clients) return locust = bucket.pop(random.randint(0, len(bucket)-1)) - occurence_count[locust.__name__] += 1 + occurrence_count[locust.__name__] += 1 def start_locust(_): try: locust().run(runner=self) diff --git a/locust/static/style.css b/locust/static/style.css index 1eb566212a..d51f417419 100644 --- a/locust/static/style.css +++ b/locust/static/style.css @@ -329,7 +329,7 @@ a:hover { text-align: left; } -#exceptions th.exception_occurences { +#exceptions th.exception_occurrences { width: 110px; text-align: center; } @@ -337,7 +337,7 @@ a:hover { text-align: left; } -#exceptions td.occurences { +#exceptions td.occurrences { text-align: center; } #exceptions td.traceback { diff --git a/locust/stats.py b/locust/stats.py index 7ec6a9b736..2041e4f62d 100644 --- a/locust/stats.py +++ b/locust/stats.py @@ -103,7 +103,7 @@ def log_error(self, method, name, error): if not entry: entry = StatsError(method, name, error) self.errors[key] = entry - entry.occured() + entry.occurred() def get(self, name, method): """ @@ -485,11 +485,11 @@ def _cache_response_times(self, t): class StatsError(object): - def __init__(self, method, name, error, occurences=0): + def __init__(self, method, name, error, occurrences=0): self.method = method self.name = name self.error = error - self.occurences = occurences + self.occurrences = occurrences @classmethod def parse_error(cls, error): @@ -510,8 +510,8 @@ def create_key(cls, method, name, error): key = "%s.%s.%r" % (method, name, StatsError.parse_error(error)) return hashlib.md5(key.encode('utf-8')).hexdigest() - def occured(self): - self.occurences += 1 + def occurred(self): + self.occurrences += 1 def to_name(self): return "%s %s: %r" % (self.method, @@ -522,7 +522,7 @@ def to_dict(self): "method": self.method, "name": self.name, "error": StatsError.parse_error(self.error), - "occurences": self.occurences + "occurrences": self.occurrences } @classmethod @@ -531,7 +531,7 @@ def from_dict(cls, data): data["method"], data["name"], data["error"], - data["occurences"] + data["occurrences"] ) @@ -580,7 +580,7 @@ def on_slave_report(client_id, data): if error_key not in global_stats.errors: global_stats.errors[error_key] = StatsError.from_dict(error) else: - global_stats.errors[error_key].occurences += error["occurences"] + global_stats.errors[error_key].occurrences += error["occurrences"] # save the old last_request_timestamp, to see if we should store a new copy # of the response times in the response times cache @@ -647,7 +647,7 @@ def print_error_report(): console_logger.info(" %-18s %-100s" % ("# occurrences", "Error")) console_logger.info("-" * (80 + STATS_NAME_WIDTH)) for error in six.itervalues(global_stats.errors): - console_logger.info(" %-18i %-100s" % (error.occurences, error.to_name())) + console_logger.info(" %-18i %-100s" % (error.occurrences, error.to_name())) console_logger.info("-" * (80 + STATS_NAME_WIDTH)) console_logger.info("") @@ -745,7 +745,7 @@ def failures_csv(): '"Method"', '"Name"', '"Error"', - '"Occurences"', + '"Occurrences"', )) ] @@ -754,6 +754,6 @@ def failures_csv(): s.method, s.name, s.error, - s.occurences, + s.occurrences, )) - return "\n".join(rows) \ No newline at end of file + return "\n".join(rows) diff --git a/locust/templates/index.html b/locust/templates/index.html index 9623eec794..362ec16f56 100644 --- a/locust/templates/index.html +++ b/locust/templates/index.html @@ -137,7 +137,7 @@