From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 94399138200 for ; Fri, 26 Jul 2013 13:02:09 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 2B54BE09DE; Fri, 26 Jul 2013 13:02:09 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 189C3E09F1 for ; Fri, 26 Jul 2013 13:02:07 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id A787733E341 for ; Fri, 26 Jul 2013 13:02:06 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id CDCDDE5463 for ; Fri, 26 Jul 2013 13:02:03 +0000 (UTC) From: "André Erdmann" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "André Erdmann" Message-ID: <1374843619.638280bfa2dd4a10c99a8c6a3deac8ef9ba63ef4.dywi@gentoo> Subject: [gentoo-commits] proj/R_overlay:master commit in: roverlay/ X-VCS-Repository: proj/R_overlay X-VCS-Files: roverlay/main.py X-VCS-Directories: roverlay/ X-VCS-Committer: dywi X-VCS-Committer-Name: André Erdmann X-VCS-Revision: 638280bfa2dd4a10c99a8c6a3deac8ef9ba63ef4 X-VCS-Branch: master Date: Fri, 26 Jul 2013 13:02:03 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 2881e9da-67e5-480a-9a28-0abc14145a29 X-Archives-Hash: 1e83e841c32dbc5bcf4ebf4a687de877 commit: 638280bfa2dd4a10c99a8c6a3deac8ef9ba63ef4 Author: André Erdmann mailerd de> AuthorDate: Fri Jul 26 13:00:19 2013 +0000 Commit: André Erdmann mailerd de> CommitDate: Fri Jul 26 13:00:19 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=638280bf roverlay/main: use/show new stats temporary change * stats need to be persistent (write them to file/db) * stats need proper str() 'visualization' --- roverlay/main.py | 39 +++++++++++++++++---------------------- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/roverlay/main.py b/roverlay/main.py index b97b5cd..cc3a5ab 100644 --- a/roverlay/main.py +++ b/roverlay/main.py @@ -10,10 +10,10 @@ __all__ = [ 'main' ] import os import sys -import time import roverlay import roverlay.tools.shenv +import roverlay.stats.collector # roverlay modules will be imported later @@ -214,22 +214,17 @@ def main ( repo_list.load() ## this runs _nosync() or _sync(), depending on extra_opts->nosync - t_start = time.time() repo_list.sync() - global sync_time - sync_time = time.time() - t_start - set_action_done ( "sync" ) except KeyboardInterrupt: die ( "Interrupted", DIE.INTERRUPT ) except: if HIDE_EXCEPTIONS: - die ( - "nosync() failed!" if OPTION ( "nosync" ) \ - else "sync() failed!", - DIE.SYNC - ) + die ( + ( "no" if OPTION ( "nosync" ) else "" ) + "sync() failed!", + DIE.SYNC + ) else: raise # --- end of run_sync() --- @@ -338,20 +333,18 @@ def main ( FH_SHARED = False FH = open ( dump_file, 'wt' ) - time_start = time.time() repo_list.add_packages ( receive_package_counting ) - time_add_packages = time.time() - time_start if modify_counter [0] > 0: FH.write ( "\n" ) #FH.write ( sys.stdout.write ( - 'done after {t} seconds\n' + 'done after {t:.2f} seconds\n' '{p} packages processed in total, out of which\n' '{m} have been modified and ' '{n} have been filtered out\n'.format ( - t = round ( time_add_packages, 1 ), + t = roverlay.stats.collector.static.repo.queue_time.get_total(), p = sum ( modify_counter ), m = modify_counter [0], n = modify_counter [2], @@ -376,14 +369,7 @@ def main ( immediate_ebuild_writes = OPTION ( 'immediate_ebuild_writes' ), ) - if 'sync_time' in globals(): - overlay_creator.set_timestats ( 'sync_packages', sync_time ) - - t_start = time.time() repo_list.add_packages ( overlay_creator.add_package ) - overlay_creator.set_timestats ( - 'add_packages', time.time() - t_start - ) overlay_creator.release_package_rules() @@ -399,7 +385,7 @@ def main ( optionally ( overlay_creator.write_overlay, 'write_overlay' ) optionally ( overlay_creator.show_overlay, 'show_overlay' ) if OPTION ( 'print_stats' ): - print ( "\n" + overlay_creator.stats_str() ) + print ( "\n***old stats are disabled (--stats)***" ) # FIXME/TODO: @@ -508,6 +494,7 @@ def main ( raise try: + roverlay.stats.collector.static.time.begin ( "setup" ) roverlay.setup_initial_logger() conf = roverlay.load_config_file ( @@ -527,6 +514,8 @@ def main ( ) else: raise + else: + roverlay.stats.collector.static.time.end ( "setup" ) if do_setupdirs: sys.exit ( run_setupdirs ( @@ -637,6 +626,12 @@ def main ( run_overlay_create() + # *** TEMPORARY *** + print ( "\n{:-^60}".format ( " stats dump " ) ) + print ( roverlay.stats.collector.static ) + print ( "{:-^60}".format ( " end stats dump " ) ) + + if len ( actions ) > len ( actions_done ): die ( "Some actions (out of {!r}) could not be performed!".format (