Skip to content

前端监控:定时监控站点渲染情况,记录异常并保存截图: puppeteer, thinkjs,mongodb,headless-chrome,vuejs

Notifications You must be signed in to change notification settings

zhentaoo/hawk-eye

Repository files navigation

Hawk-eye: 小型前端监控系统,PuppeteerJS + ThinkJS + VueJS

Usage

  1. npm i
  2. npm start

监控系统

  • 通过Puppeteer,定时爬取被监控站点,如果有异常则保存截图至 /data/err
  • 创建一个后台Server,为定时脚本提供API,记录成功or失败的情况
  • server提供api,可以查询所有的监控记录

运行说明

1. PuppeteerJS: 定时脚本,爬取被监控对象的状态

/scripts/monitor-pp.js

2. ThinkJS+MongoDB: Restful API

  • 使用ThinkJS创建一个简单的RestFUl API服务
  • 文档: https://thinkjs.org/zh-cn/doc/3.0/rest.html#toc-b15
  • 安装2.0脚手架:npm install -g thinkjs@2
  • 初始化项目:thinkjs new hawk-eye
  • 创建restful api:thinkjs controller home/monitor -r
  • mongod: 启动mongodb服务
  • mongo: 启动mongodb客户端

3. 运行结果

About

前端监控:定时监控站点渲染情况,记录异常并保存截图: puppeteer, thinkjs,mongodb,headless-chrome,vuejs

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published