I'm trying to use Heartbeat to roughly check intranet speed. I have a large file on an internal server and I can reach it with heartbeat.
I'm testing on a slow internet connection. In the browser it takes over a minute to load this file. Heartbeat is reporting total time monitor.duration.us
as 1 second or less.
I've tried the following configuration:
heartbeat.monitors:
- type: http
name: "Big File"
urls: ["http://path/to/bluemarble.jpg"]
schedule: '@every 30s'
check.request:
method: GET
Stuff I've tried:
I attempted to set the method just in case it was trying to do a HEAD
request.
I tried also using a regex like so to ensure the content was long, but got a TCP error:
check.response:
body: '.{500,}'
[...]
> error.message: "read tcp [ipv6]:port->[ipv6]:port: use of closed network connection"
I also tried adding a timestamp to the url to prevent caching, but the variable didn't expand:
urls: ["http://aotapps/speedtest/bluemarble.jpg%{+yyyy.MM.ddThh:mm:ss}"]
> monitor.url: "http://path/to/bluemarble.jpg?t=%{+yyyy.MM.ddThh:mm:ss}"
I suspect that it's only reading the first TCP frame and/or using a cached response for the content.
I'm not even sure if I'm on the right track - has anyone done this or suggest how it might be possible? Ideally I'd like to use [fixed file size] / http.rtt.content.us
as my speed metric.