简体   繁体   English

如何衡量Mercurial存储库的磁盘空间增长率?

[英]How can I measure the disk space growth rate of a Mercurial repository?

I think our repo is growing too fast because of some binary files that are tracked by mercurial. 我认为我们的回购增长太快,因为一些二进制文件被mercurial跟踪。 Can I get some kind of statistics like the rate of growth by day, or by week? 我可以获得某种统计数据,例如白天或周的增长率吗?

One of my tries was exporting the changesets of a day to a folder and check the size, but that's very laborious, isn't there a better way? 我的一个尝试是将一天的变更集导出到文件夹并检查大小,但这非常费力,是不是有更好的方法?

I would just clone your repository as a certain revision (eg -r 10 ) and then pull incrementally (ie -r 20 , -r 30 , etc.). 我只是将您的存储库克隆为某个版本(例如-r 10 ),然后逐步拉取(即-r 20-r 30等)。 Measure the disk usage of your cloned repo after each step and you can see how it has grown. 在每个步骤之后测量克隆仓库的磁盘使用情况,您可以看到它是如何增长的。

This will give you a pretty rough estimate. 这将给你一个非常粗略的估计。 You can refine it to be more accurate to give you growth per day, week, or whatever by doing an hg log -d in the original repo to get the specific revisions. 您可以通过在原始仓库中执行hg log -d来获得特定修订,从而使其更精确,以便为您提供每天,每周或其他任何增长。

Simplest way would be to just track the total size of the .hg/store directory over time. 最简单的方法是跟踪.hg / store目录的总大小。 You might want to do all of .hg, but depending on your extensions you may well have things in there that aren't really part of "the repository" (for example, hg-git will put an entire bare git repository in .hg/git). 您可能想要完成.hg的所有操作,但根据您的扩​​展,您可能会在其中拥有并非真正属于“存储库”的内容(例如,hg-git将在.hg中放置一个完整的裸git存储库) / GIT)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM