在asp.net带宽监控 [英] Bandwidth Monitoring in asp.net

查看:134
本文介绍了在asp.net带宽监控的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在开发为每个租户单独的数据库中Asp.Net一个多租户应用程序,其中的要求之一就是监视每个租户的带宽,

Hi, We are developing a multi-tenant application in Asp.Net with separate Database for each tenant, in which one of the requirement is to monitor the bandwidth usage for each tenant,

我试图寻找,但没有发现太大的帮助的话题,我们要监测到底有多少带宽被用于为每个租户,而每个用户都可以拥有自己的顶级域名或子域或两者的结合。

i have tried to search but not found much help on the topic,we want to monitor exactly how much bandwidth is being used for each tenant while each tenant can have its own top level domain or a sub domain or a combination of both.

那么,什么是可用的选项,我能想到的的功能才能

so what are the available options, the ones which i can think of can be


  1. IIS日志监控是指一个单独的应用程序,这将计算带宽为每个租户。

  2. 从应用程序中对登录租客每个请求和响应,然后计算的基础上,总带​​宽的使用。

  3. 使用一些第三方组件(如果可用)

那么你认为什么将是最好的方法,还是否有任何其他方式做到这一点。

So what do you think will be the best approach, also if there is any other way to do this.

推荐答案

好吧,这里是一个想法(我没有测试,留给你)

Ok, here is an idea (that I have not test, leave that to you)

Global.asax中
使用此功能之一(发现有一个有效的最终尺寸的)

On global.asax use one of this function (find the one that have a valid final size)

Application_PostRequestHandlerExecute
Application_ReleaseRequestState

和得到您与发送尺寸

Response.Filter.Length

没有必要求佛,你用得到调用的文件名

No need to metion, that you get the filename of the call using the

HttpContext.Current.Request.Path

此函数调用每一个请求,这样你就可以得到你的尺寸和你做休息。

This functions called with every single request, so you can get your size and you do the rest.

在这里必须注意,您需要先验证这个想法,看看它的工作,也许改进它,并在我的,如果你有COM preSS服务器页面的长度是不正确的,也许你需要COM preSS它Global.asax中有实际lenght。

Here must note, that you need first to test this idea to see if its work, and maybe improve it, and have in mine that if you have compress the pages on server the length is not the correct and maybe you need to compress it on Global.asax to have the actually lenght.

希望这有助于。

这篇关于在asp.net带宽监控的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆