diff --git a/serveradmin/graphite/management/commands/cache_graphite.py b/serveradmin/graphite/management/commands/cache_graphite.py index eafbdc0d..181c07f4 100644 --- a/serveradmin/graphite/management/commands/cache_graphite.py +++ b/serveradmin/graphite/management/commands/cache_graphite.py @@ -44,6 +44,8 @@ def add_arguments(self, parser: CommandParser) -> None: def handle(self, *args, **options): """The entry point of the command""" + start = time.time() + sprite_params = settings.GRAPHITE_SPRITE_PARAMS sprite_dir = settings.MEDIA_ROOT + '/graph_sprite' if not isdir(sprite_dir): @@ -78,6 +80,9 @@ def handle(self, *args, **options): self.stdout.write(f"[{now()}] Finished collection {collection}") + end = time.time() + self.stdout.write(self.style.SUCCESS(f"Total time: {end - start:.2f} seconds.")) + def generate_sprite(self, collection_dir, graph_table, server): """Generate sprites for the given server using the given collection""" graphs = [v2 for k1, v1 in graph_table for k2, v2 in v1]