我如何以编程方式找出 IIS 服务器有多少资源以及每个资源上的流量..等
我想编写一个程序来找出IIS服务器有哪些资源以及每个资源有多少次点击。资源可以是任何内容,从 html 页面到声音剪辑、图片等文件。我想找到所有这些资源的列表,然后我还必须计算流量。那么这是否可以在不使用任何现有工具的情况下完成。我不允许自己使用任何工具。我研究了 WMI 类,但是他们没有像我想要的那样提供非常详细的数据。我还考虑过使用 ISAPI 过滤器记录每个请求。但我发现学习起来非常困难。那么这是一个好方法吗?或者我应该看看别的东西吗?
I want to write a program to find out what resources an IIS server has and how many hits are there on each resource. The resource can be anything from a html page to files like sound clips, pictures , etc. I want to find out a list of all these resources and then i got to calculate the traffic as well. So can this be done without using any existing tool. I am not allowing myself to use any tools. I looked into WMI classes, but they do not give very detailed data like i want. I also thought about using ISAPI Filters to log each request. But i am finding it very difficult to learn. So is that a good way to go ? or shall i look at some thing else ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
只分析服务器的访问日志是最简单的,但如果您想编写代码,ISAPI 过滤器肯定可以做到。 SDK中有示例。作为通配符脚本映射安装的 ISAPI 扩展也可以工作。如果您使用过滤器,您可能应该只注册 preproc_headers。有些通知会严重影响性能,即使您在其中执行的操作很少,因为它们会在 IIS 内重新路由请求路径。 (这里特别考虑 send_raw_data 。)
It would be easiest to just analyze the server's access logs, but if you want to write code, an ISAPI filter would certainly do it. There are samples in the SDK. An ISAPI extension, installed as a wildcard script-map, would also work. If you use a filter, you should probably only register for preproc_headers. Some of the notifications have a significant performance penalty, even if you do very little inside them, since they re-route the request path inside IIS. (Thinking specifically of send_raw_data here.)