Skip to content
This repository was archived by the owner on Sep 6, 2025. It is now read-only.

Commit 0bbe743

Browse files
Merge pull request #2 from hellofresh/jackson_binding
*update jackson bindings
2 parents e4dbaa1 + 4863fa8 commit 0bbe743

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

browsermob-core/src/main/java/net/lightbody/bmp/core/har/HarEntry.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import com.fasterxml.jackson.annotation.JsonAutoDetect;
44
import com.fasterxml.jackson.annotation.JsonFormat;
55
import com.fasterxml.jackson.annotation.JsonInclude;
6+
import com.fasterxml.jackson.annotation.JsonProperty;
67

78
import java.util.Date;
89
import java.util.concurrent.TimeUnit;
@@ -17,6 +18,8 @@ public class HarEntry {
1718
private volatile HarCache cache = new HarCache();
1819
private volatile HarTimings timings = new HarTimings();
1920
private volatile String serverIPAddress;
21+
@JsonProperty("time")
22+
private volatile long time;
2023
private volatile String connection;
2124
private volatile String comment = "";
2225

@@ -157,4 +160,10 @@ public String getConnection() {
157160
public void setConnection(String connection) {
158161
this.connection = connection;
159162
}
163+
164+
public HarEntry setTime(long time) {
165+
this.time = time;
166+
return this;
167+
}
168+
160169
}

browsermob-core/src/main/java/net/lightbody/bmp/core/har/HarTimings.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,24 @@
11
package net.lightbody.bmp.core.har;
22

3+
import com.fasterxml.jackson.annotation.JsonProperty;
4+
35
import java.util.concurrent.TimeUnit;
46

57
public class HarTimings {
68
// optional values are initialized to -1, which indicates they do not apply to the current request, according to the HAR spec
9+
@JsonProperty("blocked")
710
private volatile long blockedNanos = -1;
11+
@JsonProperty("dns")
812
private volatile long dnsNanos = -1;
13+
@JsonProperty("connect")
914
private volatile long connectNanos = -1;
15+
@JsonProperty("send")
1016
private volatile long sendNanos;
17+
@JsonProperty("wait")
1118
private volatile long waitNanos;
19+
@JsonProperty("receive")
1220
private volatile long receiveNanos;
21+
@JsonProperty("ssl")
1322
private volatile long sslNanos = -1;
1423
private volatile String comment = "";
1524

@@ -49,7 +58,7 @@ public long getDns(TimeUnit timeUnit) {
4958
public void setDns(long dns, TimeUnit timeUnit) {
5059
if (dns == -1) {
5160
this.dnsNanos = -1;
52-
} else{
61+
} else {
5362
this.dnsNanos = TimeUnit.NANOSECONDS.convert(dns, timeUnit);
5463
}
5564
}

0 commit comments

Comments
 (0)