Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
43e9767
update some logging, add comments
robotdan May 13, 2025
55a2aba
working
robotdan May 13, 2025
5a2c059
working
robotdan May 13, 2025
981f84e
working
robotdan May 13, 2025
22dc35c
working
robotdan May 14, 2025
f128fbc
Add logging, and tests
robotdan May 15, 2025
dfdc104
Tests
robotdan May 15, 2025
8c8c3ec
Tests
robotdan May 15, 2025
6836604
Tests
robotdan May 15, 2025
c709bbb
Tests
robotdan May 15, 2025
309e8c3
Working
robotdan May 15, 2025
32746a9
Tests
robotdan May 16, 2025
8356101
Tests
robotdan May 16, 2025
af92fe8
Tests
robotdan May 16, 2025
8ae5cf1
copyright
robotdan May 16, 2025
2f7c476
Working
robotdan May 24, 2025
2376537
Working
robotdan May 24, 2025
b23099d
Working
robotdan May 28, 2025
d425944
Working
robotdan May 28, 2025
78e4c2e
Working
robotdan May 28, 2025
daaa59c
Working
robotdan May 28, 2025
2e0aa12
Working
robotdan May 28, 2025
409b40f
Working
robotdan May 28, 2025
55f14b3
Working
robotdan May 28, 2025
3d322ac
Working
robotdan May 28, 2025
9dc897f
Working
robotdan May 28, 2025
f7148a0
Working
robotdan May 30, 2025
a468f6b
Working
robotdan May 30, 2025
713ccb9
Working
robotdan May 30, 2025
91db717
Tests
robotdan May 30, 2025
e659c0e
Working
robotdan May 30, 2025
a0691f0
Working
robotdan May 30, 2025
797ed9c
Get Tomcat setup
robotdan May 30, 2025
598729b
README
robotdan May 30, 2025
31a8e6f
review edits
robotdan May 30, 2025
993eb99
build updates
robotdan May 30, 2025
cd8c7b7
Working
robotdan Jun 3, 2025
3c45a5c
Working
robotdan Jun 3, 2025
130b48c
Working
robotdan Jun 3, 2025
8a22c0c
Working
robotdan Jun 3, 2025
d69682c
Working
robotdan Jun 4, 2025
251c938
Working
robotdan Jun 4, 2025
d2950be
Working
robotdan Jun 4, 2025
5d312dd
Working
robotdan Jun 4, 2025
a56fce4
Working
robotdan Jun 4, 2025
2ec79ed
Working
robotdan Jun 4, 2025
4f0adc2
Working
robotdan Jun 5, 2025
6a73fa4
Add option to keep additional attributes on cookies
robotdan Jun 5, 2025
cff1c68
Working
robotdan Jun 6, 2025
8519136
Working
robotdan Jun 7, 2025
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Working
  • Loading branch information
robotdan committed Jun 3, 2025
commit cd8c7b74b9eba966833dc13c85419c141b64cb22
6 changes: 6 additions & 0 deletions load-tests/self/build.savant
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,9 @@ target(name: "start", description: "Starts the java-http server for load testing
fail("Unable to start the server!")
}
}

target(name: "suspend", description: "Starts the java-http server for load testing! ", dependsOn: ["app"]) {
if (new ProcessBuilder('./start.sh', '--suspend').directory(new File("build/dist")).inheritIO().start().waitFor() != 0) {
fail("Unable to start the server!")
}
}
37 changes: 20 additions & 17 deletions load-tests/self/src/main/java/io/fusionauth/http/load/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public static void main(String[] args) throws Exception {
// Try to report every 15 seconds. If nothing has changed, skip.
do {
//noinspection BusyWait
Thread.sleep(Duration.ofSeconds(15).toMillis());
Thread.sleep(Duration.ofSeconds(2).toMillis());

// Cut down on noise if we are not running any requests.
var snapshot = new Snapshot(instrumenter);
Expand Down Expand Up @@ -88,7 +88,10 @@ private static Path setupOutput() throws IOException {
Files.createFile(outputFile);
}

System.out.println("Server instrumentation output file. Watch this file for server statistics during your load test.\n - " + outputFile);
System.out.println("""
Server instrumentation output file created. Watch this file for server statistics during your load test.
> watch cat {outputFile}
""".replace("{outputFile}", outputFile.toString()));
return outputFile;
}

Expand All @@ -98,24 +101,24 @@ private static void writeStatus(Path outputFile, Snapshot snapshot) throws IOExc
-------------------------------------------
- Servers started: [%,d]
- Active workers: [%,d]
- Total connections: [%,d]
- Accepted requests: [%,d]
- Bad requests: [%,d]
- Closed connections: [%,d]
- Chunked requests: [%,d]
- Chunked responses: [%,d]
- Closed connections: [%,d]
- Total connections: [%,d]
- Bytes read: [%,d]
- Bytes written: [%,d]
""",
snapshot.now,
snapshot.serversStarted,
snapshot.activeWorkers,
snapshot.servers,
snapshot.workers,
snapshot.acceptedConnections,
snapshot.acceptedRequests,
snapshot.badRequests,
snapshot.closedConnections,
snapshot.chunkedRequests,
snapshot.chunkedResponses,
snapshot.closedConnections,
snapshot.totalConnections,
snapshot.bytesRead,
snapshot.bytesWritten);

Expand All @@ -125,9 +128,9 @@ private static void writeStatus(Path outputFile, Snapshot snapshot) throws IOExc
}

private static class Snapshot {
public long acceptedRequests;
public long acceptedConnections;

public long activeWorkers;
public long acceptedRequests;

public long badRequests;

Expand All @@ -143,20 +146,20 @@ private static class Snapshot {

public long now;

public long serversStarted;
public long servers;

public long totalConnections;
public long workers;

public Snapshot(ThreadSafeCountingInstrumenter instrumenter) {
now = System.currentTimeMillis();
serversStarted = instrumenter.getStartedCount();
activeWorkers = instrumenter.getThreadCount();
servers = instrumenter.getServers();
workers = instrumenter.getWorkers();
acceptedConnections = instrumenter.getAcceptedConnections();
acceptedRequests = instrumenter.getAcceptedRequests();
badRequests = instrumenter.getBadRequests();
chunkedRequests = instrumenter.getChunkedRequests();
chunkedResponses = instrumenter.getChunkedResponses();
closedConnections = instrumenter.getClosedConnections();
totalConnections = instrumenter.getConnections();
bytesRead = instrumenter.getBytesRead();
bytesWritten = instrumenter.getBytesWritten();
}
Expand All @@ -167,12 +170,12 @@ public boolean equals(Object o) {
return false;
}
Snapshot snapshot = (Snapshot) o;
return now == snapshot.now && serversStarted == snapshot.serversStarted && activeWorkers == snapshot.activeWorkers && acceptedRequests == snapshot.acceptedRequests && badRequests == snapshot.badRequests && chunkedRequests == snapshot.chunkedRequests && chunkedResponses == snapshot.chunkedResponses && closedConnections == snapshot.closedConnections && totalConnections == snapshot.totalConnections && bytesRead == snapshot.bytesRead && bytesWritten == snapshot.bytesWritten;
return now == snapshot.now && servers == snapshot.servers && workers == snapshot.workers && acceptedRequests == snapshot.acceptedRequests && badRequests == snapshot.badRequests && chunkedRequests == snapshot.chunkedRequests && chunkedResponses == snapshot.chunkedResponses && closedConnections == snapshot.closedConnections && acceptedConnections == snapshot.acceptedConnections && bytesRead == snapshot.bytesRead && bytesWritten == snapshot.bytesWritten;
}

@Override
public int hashCode() {
return Objects.hash(now, serversStarted, activeWorkers, acceptedRequests, badRequests, chunkedRequests, chunkedResponses, closedConnections, totalConnections, bytesRead, bytesWritten);
return Objects.hash(now, servers, workers, acceptedRequests, badRequests, chunkedRequests, chunkedResponses, closedConnections, acceptedConnections, bytesRead, bytesWritten);
}
}
}
18 changes: 18 additions & 0 deletions src/main/java/io/fusionauth/http/ParseException.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
public class ParseException extends RuntimeException {
private final String state;

private Integer index;

public ParseException() {
this.state = null;
}
Expand All @@ -37,6 +39,22 @@ public ParseException(String message, String state) {
this.state = state;
}

public int getIndex() {
return index;
}

public void setIndex(int index) {
this.index = index;
}

public String getMessage() {
var message = super.getMessage();
if (index != null) {
message += " Occurred at index [" + index + "]";
}
return message;
}

public String getState() {
return state;
}
Expand Down
Loading