cloudflare / cloudflare/speedtest

can we get the value of measurement through onResultsChange —instead of Type?

Open
#135 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
738
Forks
83
Avg merge
1d 12h
Merged PRs (30d)
6

Description

with onResultsChange:

import SpeedTest from 'https://cdn.jsdelivr.net/npm/@cloudflare/speedtest';
const engine = new SpeedTest();
engine.onResultsChange = (payload) => {

console.log(payload, "this working");

};
getting:

{
type:"latency"
}

but is there someway so i get value of measurement —
something like:

{
"phase": "during idle",
"ttfb": 56.80000001192093,
"serverTime": 35,
"serverTimeDelta": 3.224999964237213,
"ping": 18.575000047683716
}

Contributor guide

Open the contributing guide

Research direction

Start with the SpeedTest onResultsChange callback and inspect the payload currently reported as {type: "latency"}; compare it with the measurement fields shown in the issue. Determine which values are available at callback time and expose the intended measurement data through the callback, then verify the callback output matches the documented shape.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
networking
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.