产品动态
公告
### 监控 SpringBoot 项目- job_name: 'monitor'scrape_interval: 5smetrics_path: '/actuator/prometheus'static_configs:- targets: ['172.27.XX.XX:8080']
./prometheus --config.file=prometheus.yml
http://localhost:9090,查看 Prometheus 的管理界面。

#!/bin/bash# 初始化计数器counter=1# 无限循环while true; do# 生成当前的 key 和 value,每次都会变化key="test${counter}"value="Hello${counter}"# 使用 curl 调用 Web 服务的 SET 接口,对 Redis 进行 SET 操作echo "Setting key: ${key} with value: ${value}"curl -X POST "http://localhost:8080/redis/set?key=${key}&value=${value}"echo -e "\\n"# 使用 curl 调用 Web 服务的 GET 接口,对 Redis 进行 GET 操作echo "Getting value for key: ${key}"curl -X GET "http://localhost:8080/redis/get?key=${key}"echo -e "\\n"# 计数器加1counter=$((counter + 1))# 等待5秒钟sleep 5done
lettuce_command_completion_seconds_sum{command="SET"}/lettuce_command_completion_seconds_count{command="SET"}

lettuce_command_completion_seconds_max{command="SET"},可以查看 SET 命令的最大延迟,从图中可以看到最大延迟大约为1.35 ms。
文档反馈