background
In order to better actively perceive the PK indicators of user-level rival products, for example, is Huobi opened faster or Binan opened faster? Is the Huobi WebSocket connection faster or Binan connection faster?
Now these are the questions, it is very important to a woodpecker perception map is competing goods data contrast, now we rely on third-party testing platform (such as: Boce, listen to the cloud), but the data is not good to our needs, and the data must be the most safety directly in our own hands, is the so-called “the data in hand, all I have.”
The target
- Docker the deployment
- Plug-in management
- Scheduled collection of tasks
- Custom metrics
Architecture diagram
Runtime environment
Run based on Docker and run as Node.js, you can do:
- Collect data based on Puppeteer headless browsers such as performance metrics, WebSocket metrics, interface metrics, etc
- Completed based on Ping: domain availability, TTL, packet loss rate detection
Purchase multiple node servers such as: Woodpecker Docker Agent is installed on AliCloud ECS 1U1G nodes in Beijing, Hangzhou, Shanghai, etc., which can actually be understood as the concept of “chicken”. We manage the plug-ins and state installed by these agents in the remote Master, and send them to the corresponding node when the task is triggered. Data collection and reporting are completed by nodes.
It should be noted that the Agent only runs a Docker container in the ECS, and the Master manages/operates the same container. It does not operate on the host and does not overstep its authority (e.g., SSH ECS, which we consider to be the scope of OPS processing).
Master
1. Plug-in management
In the form of code (Node.js), it is managed by modules. Select plug-ins in the task and configure the required parameters of plug-ins. The list of plug-ins is as follows:
-
Ping plug-in
- Configuration: domain name /IP, timeout, times
-
Web page performance metrics plug-in
- Configuration: link, view width and height, UserAgent
- Huobi Global WebSocket test
- Binance WebSocket test
- There’s a lot more you can do…
2. The Agent management
Check the status and distribution of all agents, install/uninstall plug-ins, and manage regional distribution, label and other information.
3. Task management
Send data to the corresponding Agent in a task queue. The task configuration is roughly as follows:
- The name of the task
- Agent, such as BJ01, SG03, HZ03
- Interval of tasks: single, 1s, 1m, 1h, 1h
-
Execution plug-in:
- Ping – { url: ‘www.baidu.com’, timeout: 1000, count: 5 }
- Web Performance – { url: ‘https://www.huobi.me/zh-cn/ex…’ }
- Web Performance – { url: ‘https://www.baidu.com’ }
- Global WebSocket
- Binance WebSocket
Agent
Run a container in the background using Docker, such as:
Docker run \\ -d \\ --name woodpecker-agent \\ -p 8080:8080 \\ -e ACCESS\_KEY\= Generated token \\ Hub. The Woodpecker. The VIP/pk/agent: v1.0.0
OpenAPI provided by this Agent:
- IP:8080/open/v1/status – current Agent status
- IP: 8080 / open/v1 / plugins/install – installing a plug-in, plug-in data uploading to the Agent
- IP: 8080 / open/v1 / task/exec – use the data to perform a task
Woodpecker
Log collection service is pushed to the service by Agent after collection, and then the service enters the database.
Pay attention to
- All above use internal network transmission, such as: master-> agent-> woodpecker-> DB
- Frequent collection of third-party websites may face the risk of IP blocking