Using Heartbeat as a Speed Test

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.

Hey, thanks for writing.

So, the good news is this should work. The bad news is that there's a bug preventing it from working. The bug, which you found, is that we prematurely close large bodies before finishing reading them.

https://github.com/elastic/beats/pull/8660 fixed it. It's set to be released in 6.5.0 . There's always a small chance that any feature could be pulled before release, but that is not very likely in this case.

we also have 6.x package builds here: https://beats-ci.elastic.co/job/elastic+beats+6.x+multijob-package-linux/gcsObjects/

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.