-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposed serverless model for a decentralised speedtracker #1
Comments
Function as an APIThis is great, thank you @philhawksworth! I've done some work on the dashboard (see https://github.com/speedtracker/speedtracker/tree/feature/v2), which is mostly aligned with the vision you outlined. Perhaps the only exception is this:
In the proof-of-concept I put together, I created a Netlify Function that retrieves test results from the database based on the parameters it receives, effectively acting as an API. For example, this call returns the test results for a profile called As a result, there's no need to ever rebuild the dashboard site (unless the dashboard itself is being updated), as the front-end application makes XHR calls to the Netlify Function. ProfilesIt's also worth touching on this:
In the current implementation of SpeedTracker, users define the URLs to be tested using the concept of profiles. A profile is a collection of test parameters, which include the URL to be tested, but also other WebPageTest parameters such as the device type, the location of the instance, the number of runs, etc. This is also where budgets for each performance metric can be defined, as well as related alerts. The most common reason for having multiple profiles is to test multiple URLs, but you could use them to test the same URL under different conditions. In the proof-of-concept, the profiles are loaded from a YAML file, which at build time is read and converted into a JavaScript file that the React application can read. Going forward, I think it'd be interesting to provide two options for configuring this:
Next stepsI'll start looking into the functions for triggering tests and processing results, incorporating them with the proof-of-concept. Perhaps at that point we can regroup and re-evaluate how the various pieces work together? |
Overview
In order to remove the need for Speedtraker to maintain a server instance to handle the comms between WebPageTest API requests and a suitable data stores (currently on GitHub), a serverless model could be adopted. This issue is intended to help facilitate a move to this architecture. And to discuss some of the ways it can work.
Summary of logical architecture
At a high level the flow will be like this:
All of the above can be automated through Netlify Functions, events, and build hooks.
Advantages
In this way, each site owner will be bale to execute the requests to WebPageTest directly under their own quota and without the need for an intermediary service.
Each user will also be able to manages and customise their own means of persisting and reporting the data (building upon some easily provisioned and working defaults)
GitHub will no longer be relied upon to be some where for the raw results data to reside.
Since performance metrics will be created for every deploy, we will be able to visualise the impact of performance from every deployment and every commit which triggered that deployment
High level tasks (probably to be tracked separately)
The text was updated successfully, but these errors were encountered: