Start with a sample project with Docker Compose
Clone our repository and open it in a new VS Code window
git clone https://github.com/sprkl-dev/use-sprkl.git
Install the project with the following:
# You Can also use NPM if not using yarn.
Let's apply some code changes to the repository code to understand better how sprkl works.
Sprkl is built on the idea of analyzing code changes and integrating instrumentation of the scanned changes into the runtime. Once we apply the following code changes, we will get an insightful view of how these code changes play in our application.
In the file,
metrics/metrics.jsuncomment the following code block (starting at line 41).
Note that this code has some inefficiencies that will show up in the Sprkl dashboard
Add the following code to file
Let's deploy the microservices with docker-compose using the following command:
sprkl --recipe=uncommitted -- docker compose up --build -d --force-recreate
Now that the deployment was successful let's run our end-2-end testing:
# If you'll look at the "test:e2e:run" script is running Jest.
sprkl --recipe=uncommitted -- yarn test
Open the Sprkl dashboard by clicking on the Sprkl icon from the main menu.
Check the “insights” section to see the inefficiencies the code contains.