From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id EC905138334 for ; Fri, 11 Jan 2019 04:37:22 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id DB788E0A53; Fri, 11 Jan 2019 04:37:21 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 8C3B6E0A53 for ; Fri, 11 Jan 2019 04:37:21 +0000 (UTC) Received: from [10.128.13.179] (unknown [100.42.98.196]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: zmedico) by smtp.gentoo.org (Postfix) with ESMTPSA id 20F1D335CA6; Fri, 11 Jan 2019 04:37:19 +0000 (UTC) Subject: Re: [gentoo-portage-dev] [PATCH v5] collision_protect: use dynamic report interval To: gentoo-portage-dev@lists.gentoo.org, Fabian Groffen References: <20190109083323.3590-1-grobian@gentoo.org> <20190110153013.6186-1-grobian@gentoo.org> From: Zac Medico Openpgp: preference=signencrypt Autocrypt: addr=zmedico@gentoo.org; prefer-encrypt=mutual; keydata= mQINBFs7tmwBEADTzG+IcYtRfTfKryU7sUH7LlV1M+TdaCMfIkY4x6RyHXkaaqYuQ+U9HKn0 +m5FcZsZ1Ojik+We3Tz0F6kDbam6EWzBxmsLb/IHeUEsvsuLzuBQjiD9zzqGocZiPWr+uWJs AdbueS72R7FPXJPDUEPrJ9GdhGFyYARveY9cmdisOwcDOiSFfBjk3/89t4gROn4KUhezVuO9 VS14gVSns1561CJjlB47HkSB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u9VCnJ9+7X6HVMoq7aMj7ZW qJ1S1Jp/m6uJwzBDexcTokj8rTPBzbIo+3EfaGWMk47VoQgccee5B1jvxmLxhIbEd+LUc9ek jDQ0FETN7dOBuIIg5+Z6IdAycsLMHfNeSTP0jMHHZBKbptQwiaQ/hieMbSraN6fjozta4jw8 mUBoOJTgyjAP/2nbBGiOp/s8CkNEfbqFlLLVSnpN70PHPQ+FOKHe+FFg/bhyf6L0mGShJ8rH c8o7Re1Im/ztjj9hrGUfdicPFrU88Y+XgRGqb8DxjlyYSOVwIi6abyH5TgP1LNasBc23+cY/ nf2+n7Eq6/AOdgQRCKe5bIHXl94889HHVMQyfR+AvRZ9AiHNd7AGbhi2aMKsHgrnhuTcFO/d TR8NHolevl/zyOHmlcKaDUahjgTEK/SguUjmFHYDQYFDCrQj6U0o8uZtLA23wpiGgG1ajqpG w0VpKjkFzXcCNVeVme7XreRBxwstOda4Y00JUfOTGpR0+/bGRnJaQvBFV87WbBksVCa2McuY uzEqnkYwE4M/Hua9CRXReyvG31JRDbMubqXZjgisOtjIaNn7jvbweLoJhSzINkBB28tJiV6P ODhMx9XC5taaVLiPpABL/xzbqtHi6LCwXAYVlOS+ceiR2WIUigL866Ze607UePBJVQvsCuIS y7PV9kVbfN1/xKls9fiB87tv5XpyEUR9s+91Az6d8kterzLKqwxWSfp+HSepYuWOhlLsywUr BAJMnLR1yogNFuwyFkXIwKy/kNj4lIy+wLGNCQod1H84OLg1iHElIA+wxAWL7xnTYPxKX102 YsIUXy5A5ebVtwxpLuu8Yd6CnrTOvyLKqukoXSwP+16Mjo7C Message-ID: Date: Thu, 10 Jan 2019 20:37:16 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-portage-dev@lists.gentoo.org Reply-to: gentoo-portage-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 In-Reply-To: <20190110153013.6186-1-grobian@gentoo.org> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="ehELFcNDWaZvBmhp3jUg96Xb1iEt02G0y" X-Archives-Salt: f9b220b2-9762-4585-b1c4-ca99727a62c5 X-Archives-Hash: a19e05136d95fff1ab5c51aa9dfcb089 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --ehELFcNDWaZvBmhp3jUg96Xb1iEt02G0y Content-Type: multipart/mixed; boundary="OqAHnOW5Dh9P8tTX42Yib7tIulUK5PTkr"; protected-headers="v1" From: Zac Medico To: gentoo-portage-dev@lists.gentoo.org, Fabian Groffen Message-ID: Subject: Re: [gentoo-portage-dev] [PATCH v5] collision_protect: use dynamic report interval References: <20190109083323.3590-1-grobian@gentoo.org> <20190110153013.6186-1-grobian@gentoo.org> In-Reply-To: <20190110153013.6186-1-grobian@gentoo.org> --OqAHnOW5Dh9P8tTX42Yib7tIulUK5PTkr Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 1/10/19 7:30 AM, Fabian Groffen wrote: > The reporting of files remaining can look somewhat odd since the report= > interval is hardcoded to be per 1000 objects. Adjust this interval to > be time based. This means that modern (fast) machines likely will neve= r > see the countdown messages at all. On slow setups the message will be > informative that there is progress, albeit rather slowly. While at it,= > report percentage done. >=20 > Output before this patch: >=20 > * checking 6158 files for package collisions > 5158 files remaining ... > 4158 files remaining ... > 3158 files remaining ... > 2158 files remaining ... > 1158 files remaining ... > 158 files remaining ... >=20 > Possible output after this patch on a slower machine: >=20 > * checking 6158 files for package collisions > 48% done, 3145 files remaining ... > 96% done, 192 files remaining ... > 100% done >=20 > Signed-off-by: Fabian Groffen > --- > lib/portage/dbapi/vartree.py | 15 +++++++++++++-- > 1 file changed, 13 insertions(+), 2 deletions(-) >=20 > diff --git a/lib/portage/dbapi/vartree.py b/lib/portage/dbapi/vartree.p= y > index 4b91caea8..909c0e473 100644 > --- a/lib/portage/dbapi/vartree.py > +++ b/lib/portage/dbapi/vartree.py > @@ -35,6 +35,7 @@ portage.proxy.lazyimport.lazyimport(globals(), > 'portage.util.install_mask:install_mask_dir,InstallMask', > 'portage.util.listdir:dircache,listdir', > 'portage.util.movefile:movefile', > + 'portage.util.monotonic:monotonic', > 'portage.util.path:first_existing,iter_parents', > 'portage.util.writeable_check:get_ro_checker', > 'portage.util._xattr:xattr', > @@ -3475,13 +3476,21 @@ class dblink(object): > symlink_collisions =3D [] > destroot =3D self.settings['ROOT'] > totfiles =3D len(file_list) + len(symlink_list) > + previous =3D monotonic() > + progress_shown =3D False > + report_interval =3D 1.7 # seconds > + falign =3D len("%d" % totfiles) > showMessage(_(" %s checking %d files for package collisions\n") % \= > (colorize("GOOD", "*"), totfiles)) > for i, (f, f_type) in enumerate(chain( > ((f, "reg") for f in file_list), > ((f, "sym") for f in symlink_list))): > - if i % 1000 =3D=3D 0 and i !=3D 0: > - showMessage(_("%d files remaining ...\n") % (totfiles - i)) > + current =3D monotonic() > + if current - previous > report_interval: > + showMessage(_("%3d%% done, %*d files remaining ...\n") % > + (i * 100 / totfiles, falign, totfiles - i)) > + previous =3D current > + progress_shown =3D True > =20 > dest_path =3D normalize_path( > os.path.join(destroot, f.lstrip(os.path.sep))) > @@ -3570,6 +3579,8 @@ class dblink(object): > break > if stopmerge: > collisions.append(f) > + if progress_shown: > + showMessage(_("100% done\n")) > return collisions, dirs_ro, symlink_collisions, plib_collisions > =20 > def _lstat_inode_map(self, path_iter): >=20 Looks good! --=20 Thanks, Zac --OqAHnOW5Dh9P8tTX42Yib7tIulUK5PTkr-- --ehELFcNDWaZvBmhp3jUg96Xb1iEt02G0y Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQKTBAEBCgB9FiEE8OgXaltWzqgSupCu0HX7jBBKPSAFAlw4HXxfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEYw RTgxNzZBNUI1NkNFQTgxMkJBOTBBRUQwNzVGQjhDMTA0QTNEMjAACgkQ0HX7jBBK PSDA5BAAxFLLsXXhfbrVUjWZsLY7oyQMi//yqB81dgsozmHEi6GCgdSW1zonorKE WrkrTFHUazuhukDUB23p7PwHXSCIab/ejf28b02uilbLZLbGwYJOmBIPCIleyglr hEQgTvNbBeNvHTc1lB4oAJq+rnYeeWAmlw9BVQNHrJVuVF7/dnuPvYFSNtDYal/G PG8WRKHiTSaM8zv6/i52STWMQWzzEg8hFhYTA+BTct31Y+AfwZeFa4C1bWX7rjwI JBJIr+IVF7N+X4mzk8TqbZhC7gdyXRyLajMZMRd3o55t12QBcCPVZWKGjEy4krAS eqrAkGGu3d+Ra0j7sE4s7QiaCOUf7P/8K3wzmkDq5yegnAkaZ4ZVpnQvCIDiGSeU 2w3Fo7kGdwfrfpyeHvAw3mGZdDZTipbGuDt+D8QGvJAnQBRaYqVM2htLgiIeoo62 m4PiWwURj2uT0xmdzfF1s5KlqZ87FFsWMVy/fuACICp03DJpH64TmLghPpjvJJxS nXPNZ/UF+83tcGqaE9eVK5wI+uW6ChSCXy7FEmUX7KbU/MhJ0aEKsOJzi0mw9IEz EPZ7mqaExljv+JgAbbLeOV8GER//DSat05jFZi3TzCWzmmMp1So3fRE2/u3jg50t ZkZYkKlG8fbyHWFWXMvg2xZ5CkxknP+1Vy1N/qgMMlL+qUbfRTk= =ABkP -----END PGP SIGNATURE----- --ehELFcNDWaZvBmhp3jUg96Xb1iEt02G0y--