Speedlog is a server that stores the performance log of third-party applications.
I developed speedlog to monitor the performance of the front-end.
But you can use speedlog in any applications that can send REST requests.
speedlog + perfumejs + graphiteSpeedlog may be a suitable back-end for storing data collected using perfume.js
Use the following docker-compose.yml file to start the speedlog server and graphite server.
Specify a random key in the parameter
--jwtkey
version: '3'
services:
app:
image: khyurri/speedlog:0.1.9
command: "/opt/speedlog/main
--jwtkey=***
--mongo=mongo:27017
--alloworigin='*'
--tz=\"Local\"
--graphite=graphite:2003
--project=myProject"
depends_on:
- mongo
- graphite
ports:
- "8012:8012"
restart: always
mongo:
image: mongo:3.6
graphite:
image: graphiteapp/graphite-statsd
ports:
- "8013:80"
After launch, 2 services will be publicly available on the host:
speedlog. Port 8012graphite web interface. Port 8013To connect perfume.js to speedlog add the following code to the perfume initialization
var project = "myProject";
const perfume = new Perfume({
firstPaint: true,
analyticsTracker: (metricName, duration, browser) => {
var xhr = new XMLHttpRequest();
xhr.open('POST', 'http://127.0.0.1:8012/event/');
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.send(JSON.stringify({
"metricName": metricName,
"durationMs": duration,
"project": project
}));
}
});
Do not forget to replace IP
127.0.0.1with a real host
Now you can open graphite in a browser at the address http: //127.0.0.1:8013 and build something like this

speedlog versions and InstallationPrior to version 1.0.0, I am actively developing speedlog, which means:
The latest version is always available on dockerhub.
Docker — my recommended way to install speedlog.
The first parameter to cli must be the mode of the speedlog. If mode is not passed,
then speedlog starts in default mode: runserver
Available modes
| Mode | Description |
|---|---|
| runserver | starts the server |
| adduser | adds user |
| addproject | adds project |
| delete | deletes user or project |
Starting the server and creating the myProject project (if not created)
speedlog --jwtkey=*** --mongo=mongo:27017 --project=myProject"
User Creation
speedlog adduser --login=admin --password="-?sEcrE7-"
Starting the server with exporting data to graphite
speedlog --jwtkey=*** --mongo=mongo:27017 --graphite=graphite:2003
Project creation
speedlog addproject --project=myproject
Delete project
speedlog delete --project=myproject
Delete user
speedlog delete --login=admin
I need help translating documentation into English!
Content type
Image
Digest
Size
7.4 MB
Last updated
almost 7 years ago
docker pull khyurri/speedlog:0.9