This is a Java client for the GoDaddy/timings application. It was developed against the timings-docker containers.
- Installed Java JDK8.
- Installed IntelliJ Community Edition.
- Import as a Maven project.
- Build it locally using
mvn package
. - Publish it to your local Maven repository using this.
-- Example:
mvn install:install-file -Dfile=./target/timings-client-1.0-SNAPSHOT.jar -DpomFile=pom.xml
- Or you can add the dependency to your Maven POM.
<dependency>
<groupId>com.kevingann</groupId>
<artifactId>timings-client</artifactId>
<version>0.7-SNAPSHOT</version>
</dependency>
The GoDaddy/timings application leverages the Web Performance API available in most browsers.
Here's an example of what's being injected to obtain performance data.
var visualCompleteTime = 0;
if (performance.getEntriesByName('initialPageLoad').length) {
visualCompleteTime = parseInt(performance.getEntriesByName('initialPageLoad')[0].startTime);
window.performance.clearMarks();
};
return {
time:new Date().getTime(),
timing:window.performance.timing,
visualCompleteTime: visualCompleteTime,
url: document.location.href,
resources: window.performance.getEntriesByType('resource')
};
Refer to Web Performance API to understand the data being returned.