Skip to content

Commit 7e5195d

Browse files
committed
Add BuildTracker
1 parent 42e1fca commit 7e5195d

File tree

14 files changed

+214
-5
lines changed

14 files changed

+214
-5
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
77

88
## [Unreleased]
99

10+
## [1.3.0] - 2020-03-27
11+
### Added
12+
- Build Tracker server
13+
- Bump dependencies (lhci, sitespeed.io)
14+
1015
## [1.2.0] - 2020-03-20
1116
### Added
1217
- Bump all dependecies to latest versions

README.md

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Framework consists of next services:
1111
- **Sitespeed.io**: set of tools for frontend load testing
1212
- **Webpagetest**: private instance of webpagetest server for frontend tests execution
1313
- **K6**: tool for backend load testing
14+
- **Build Tracker** tool for monitoring asset sizes and performance budgets
1415
- **Grafana**: data visualization & monitoring
1516
- **Graphite**: time series DB platform for metrics
1617
- **InfluxDB**: time series DB optimized for fast storage and retrieval of time series data
@@ -69,11 +70,12 @@ All containers should be up and running
6970

7071
### Services endpoints
7172

72-
- **jenkins** localhost:8181
73-
- **LHCI** localhost:9001
74-
- **webpagetest server** localhost:4000
75-
- **grafana** localhost:3000
76-
- **portainer** localhost:9000
73+
- **jenkins** [localhost:8181](http://localhost:8181/)
74+
- **LHCI** [localhost:9001](http://localhost:9001/)
75+
- **webpagetest server** [localhost:4000](http://localhost:4000/)
76+
- **build tracker server** [localhost:9002](http://localhost:9002/)
77+
- **grafana** [localhost:3000](http://localhost:3000/)
78+
- **portainer** [localhost:9000](http://localhost:9000/)
7779

7880
### How to stop
7981

@@ -131,6 +133,18 @@ The results will be saved on the associated k6 reports folder and also pushed to
131133

132134
*To add this dashboard follow the instructions [here](https://k6.io/docs/results-visualization/influxdb-+-grafana).*
133135

136+
## Build Tracker
137+
138+
*Track performance budgets & prevent unexpected bloat.*
139+
140+
![](docs/img/build-tracker-example.png)
141+
142+
The docker compose services contains the build tracker server that can be used to send build artifacts from the build tracker CLI and monitor.
143+
144+
Once the service is running access [localhost:9002](http://localhost:9002) to see the dashboard.
145+
146+
In order to send build artifacts follow the instructions on the [docs site](https://buildtracker.dev/docs/packages/cli). You can also find an example in the test folder for build tracker in this repo.
147+
134148
## Grafana
135149

136150
### Available metrics

buildtracker/Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FROM node:12
2+
3+
WORKDIR /usr/src/buildtracker
4+
COPY package.json .
5+
COPY build-tracker.config.js .
6+
RUN npm install
7+
8+
EXPOSE 9002
9+
CMD [ "npm", "start" ]

buildtracker/build-tracker.config.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
const withPostgres = require('@build-tracker/plugin-with-postgres').default;
2+
3+
module.exports = withPostgres({
4+
url: 'http://127.0.0.1:9002',
5+
pg: {
6+
user: 'myuser',
7+
password: 'mypassword',
8+
host: 'postgres', // This is the docker-componse container name for postgres https://docs.docker.com/compose/networking/
9+
database: 'postgres'
10+
}
11+
});

buildtracker/package.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"name": "buildtracker",
3+
"version": "0.0.0",
4+
"scripts": {
5+
"start": "bt-server setup && bt-server run"
6+
},
7+
"dependencies": {
8+
"@build-tracker/server": "1.0.0-beta.14",
9+
"@build-tracker/plugin-with-postgres": "latest"
10+
}
11+
}

docker-compose.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,14 @@ services:
4040
shm_size: 2g
4141
volumes:
4242
- ./reports/sitespeed-result/:/sitespeed.io/sitespeed-result
43+
buildtracker:
44+
container_name: buildtracker
45+
build: ./buildtracker
46+
depends_on:
47+
- postgres
48+
ports:
49+
- "9002:3000"
50+
restart: unless-stopped
4351
lhci-server:
4452
container_name: lhci-server
4553
build: ./lhci-server
@@ -119,6 +127,14 @@ services:
119127
environment:
120128
- INFLUXDB_DB=k6
121129
restart: unless-stopped
130+
postgres:
131+
container_name: postgres
132+
image: postgres:12-alpine
133+
environment:
134+
- POSTGRES_USER=myuser
135+
- POSTGRES_PASSWORD=mypassword
136+
ports:
137+
- "5432:5432"
122138
jenkins:
123139
container_name: jenkins
124140
# image: jenkins/jenkins:lts
@@ -169,5 +185,6 @@ volumes:
169185
# grafana-home:
170186
# grafana-conf:
171187
influxdb:
188+
postgres:
172189
grafana:
173190
jenkins-home:

docs/img/build-tracker-example.png

230 KB
Loading

docs/img/framework-architecture.png

118 KB
Loading
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
applicationUrl: "http://127.0.0.1:9002", // The same as your server config `url`
3+
artifacts: ["dist-v1/**/*.js"] // an Array of glob-style file paths
4+
};

0 commit comments

Comments
 (0)