简体   繁体   English

为网站监控服务存储大量“正常运行时间”数据

[英]Storing vast amounts of "uptime" data for a website monitoring service

this is more of a general discussion rather than a code question.这更像是一般性讨论,而不是代码问题。

I have a website monitoring platform whereby users of the system can input their website URL and we'll check it every X minutes based on the customer's interval, at each interval, an entry is stored as a UptimeCheck model in the Laravel 8 project with the status being down or up.我有一个网站监控平台,系统用户可以输入他们的网站 URL 我们将根据客户的时间间隔每 X 分钟检查一次,在每个时间间隔,一个条目存储为UptimeCheck 8 项目中的 UptimeCheck model 8 项目状态为 down 或 up。

If a customer has 20 monitors, and each checks every minute, then over a 30 day period for the one customer they'd accumulate over 1 million rows.如果一位客户有 20 台显示器,并且每台显示器每分钟检查一次,那么在 30 天的时间里,对于一位客户,他们将累积超过 100 万行。

My query, is really do I need to keep this number of rows?我的查询,我真的需要保留这些行数吗?

The reason this number of rows is kept is so that we can present a graph showing the average website uptime.保留此行数的原因是我们可以呈现一个显示平均网站正常运行时间的图表。

My thinking is that if I created some kind of SVG programatically for each day and store this in the table then I wouldn't need to store as many entries, but my concern here is how would I merge SVG models into one to present a daily graph?我的想法是,如果我每天以编程方式创建某种类型的 SVG 并将其存储在表中,那么我就不需要存储那么多条目,但我关心的是如何将 SVG 模型合并为一个以呈现每日图形?

What kind of libraries could I use and how else might I approach this?我可以使用什么样的库,还有什么方法可以解决这个问题?

Unlike performance, the trick for storing uptime data is simple.与性能不同,存储正常运行时间数据的技巧很简单。 You don't store it.你不存储它。 ;) You need to store DOWNTIME data instead. ;) 您需要存储 DOWNTIME 数据。 Register only unavailability events and extrapolate uptime when displaying reports.仅注册不可用事件并在显示报告时推断正常运行时间。

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

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