热图显示服务器上的文件系统差异?
我的任务是创建一个简单的基于 Python Web 的应用程序,以图形方式表示不同服务器之间的“差异”,即整个文件系统中各种关键配置文件的内容。
1.高级热图
对于高级概述,我正在考虑创建每个系统的热图(例如 http://www.jjguy.com/heatmap/)。每个系统都与黄金源图像(原始图像)进行比较,然后我们使用颜色来表示与该图像的差异程度。
文件系统映射到 xy 轴,以便每个系统的热图上的相同坐标代表相同的文件。
我的第一个问题是,您对将文件系统映射到 xy 坐标的好算法有什么建议吗?请记住,虽然每个服务器应该具有或多或少相同的文件系统层次结构,但这可能不一定正确,而且我仍然需要找到一种方法来表示丢失的文件/目录,或者可能添加的文件/目录。我不确定这是否可能,以及将等效文件/目录映射到每个系统地图上匹配(或至少相似)的 xy 点的第一个要求。这里有什么新的方法/算法吗?
然后我需要一种方法来量化每个文件之间的变化程度(行数?),然后将其传递到热图上。请记住,我需要区分具有 10 个更改行的单个文件和每个具有 1 个更改行的 10 个文件,因为两者都有不同的后果。
2.向下钻取以显示文件差异
我希望还能够在网络应用程序中提供向下钻取到各个文件/目录的功能,并查看它们之间的更改。
我一直在使用 Kdiff3 和 Meld 的组合来进行可视化代码差异,并且 Meld 显示变化的方式给我留下了深刻的印象。
http://meld.sourceforge.net/meld_file1.png
我似乎找不到任何独立提供视觉差异机制的独立 Web 库。我发现的最接近的是jsdifflib(http://snowtide.com/jsdifflib),但似乎没有以匹配像 Meld 这样的东西的功能(或者美学,我想)。这里有什么建议吗?
(修正主义者实际上看起来很酷 - http://benfry.com/revisionist/ - 但我似乎看不出来找到它的任何公共代码)。
干杯, 胜利者
I've been tasked with creating a simple Python web-based app to graphically represent the "differences" between various servers, in terms of the contents of various key config files throughout the filesystem.
1. High Level Heatmap
For a high-level overview, I was thinking of creating a heatmap of each system (e.g. http://www.jjguy.com/heatmap/). Each system is compared to a golden-source image (the original), and then we use colours to represent he degree of differentiation from this image.
The filesystem is mapped to the x-y axis, so that the same coordinates on the heatmap for each system represent the same files.
My first question here is, do you have any advice on a good algorithm for mapping the filesystem to the x-y coordinates? Bear in mind, while each server should have more-or-less the same filesystem hierarchy, this may not be necessarily true, and I still need to find a way to represent missing files/directories, or perhaps added files/directories. I'm not sure if that's possible, along with the first requirement of mapping equavilent files/directories to matching (or at least similar) x-y points on each system map. Any novel approaches/algos here?
Then I need a way of quantifying the degree of changes between each file (number of lines?), and then passing this onto the heatmap. Bear in mind I'd need to differentiate between say, a single file with 10 changed lines, and 10 files with 1 changed line each, as both have different ramifications.
2. Drill-Down to show File Diffs
I'm hoping also offer the ability in the webapp to drill-down into individual files/directories, and see the changes between them.
I've been using a combination of Kdiff3 and Meld for visual code diffs, and I'm quite impressed by the way Meld display changes.
http://meld.sourceforge.net/meld_file1.png
I couldn't seem to find any standalone web libraries that provide a visual diff mechanism on thier own. The closest I found is jsdifflib (http://snowtide.com/jsdifflib), but it doesn't seem to match the functionality (or the aesthetics, I suppose) of something like Meld. Any advice here?
(Revisionist looks cool actually - http://benfry.com/revisionist/ - but I can't seem to find any public code for it).
Cheers,
Victor
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
至于映射文件系统,请查看 WindirStat http://windirstat.info/ 。这最初是文件系统的大小评估工具,但您可以定义自己的大小计算。树状图将有助于对同一文件夹或文件夹树中的文件进行分组。它对磁盘内容的变化具有一定的鲁棒性。
As to mapping the filesystem, take a look at WindirStat http://windirstat.info/ . This is originally a size assessment tool for your filesystem, but you could define your own size calculation. The treemap will help to group files that are the same folder or folder tree. It is somewhat robust to changes in the disk contents.