dongluo1853 2012-08-23 06:42
浏览 37
已采纳

如何检查网站是否已启动并长时间存储结果

I'm monitoring a website (using curl) to see if it's up and to know the response time for a simple GET request on the homepage. I'm using a homemade script to do this, and I don't want to use Nagios or any other existing tool for that.

My problem is that I have no idea how to store the results for a long time period (say, months). I don't need the response time for every single request since epoch of course, but i'd like to get the status (up|down) and an average response time for large periods. For example :

  1. [ last month] -> daily response time (avg)
  2. [ last 3 months ] -> weekly response time (avg)
  3. [ last 12 months ] -> monthly response time (avg)

And for the whole duration, I want to keep the status. For that I will just save the last date when a status change happened I guess.

So the question is : what is the optimal way to store that kind of information with this frequency/retention ? I'm coding in PHP with a Mysql DB behind, but maybe there's something better than a DB for that ?

Any language/tech is accepted as long as it's free and running on linux/unix.

Thank you

  • 写回答

2条回答 默认 最新

  • doudengshen5591 2012-08-23 07:00
    关注

    That sounds like a typical round-robin database. RRDtool allows you to manage such a database. I don't see a reason for re-inventing the wheel.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么