Package org.mockserver.dashboard.model
Class DashboardBodyCap
java.lang.Object
org.mockserver.dashboard.model.DashboardBodyCap
Shortens the bodies the dashboard sends in its live updates. A row carries its exchange's bodies about eight
times over, so uncapped bodies make an update hundreds of megabytes; the dashboard loads a full body on demand
(GET /mockserver/logEntryBody). Sizes are in characters of the body as the dashboard shows it.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classRenders one log entry's bodies for the dashboard: a body already cut for an earlier row under the same variant (with redaction on, its redacted rendering) comes back as that cut text without being decoded again.static final classWhat capping one log entry's messages found: each cut copy's full body length, and roughly how many characters the entry adds to an update. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final int -
Method Summary
Modifier and TypeMethodDescriptionstatic longcapExpectationTree(com.fasterxml.jackson.databind.JsonNode node) Cuts, in place, an expectation's serialised tree for the dashboard's expectations section: everybodylonger than the cap (a JSON or binary body is measured and cut as its serialised text) and every other string longer than the cap.expectationTruncationMarker(String expectationId, long originalLength) What the dashboard needs to say an expectation in its expectations section was cut, and to load it whole by id.truncationMarker(String logEntryId, Object message, long originalLength, boolean loadable) What the dashboard needs to say a body was cut and to load it whole: the log entry it belongs to, which of the entry's messages it is, and the full and shown lengths.
-
Field Details
-
MAX_BODY_CHARACTERS
public static final int MAX_BODY_CHARACTERS- See Also:
-
MESSAGE_OVERHEAD_CHARACTERS
public static final int MESSAGE_OVERHEAD_CHARACTERS- See Also:
-
-
Method Details
-
truncationMarker
public static Map<String,Object> truncationMarker(String logEntryId, Object message, long originalLength, boolean loadable) What the dashboard needs to say a body was cut and to load it whole: the log entry it belongs to, which of the entry's messages it is, and the full and shown lengths. -
capExpectationTree
public static long capExpectationTree(com.fasterxml.jackson.databind.JsonNode node) Cuts, in place, an expectation's serialised tree for the dashboard's expectations section: everybodylonger than the cap (a JSON or binary body is measured and cut as its serialised text) and every other string longer than the cap. Returns the longest original length cut, or 0 when nothing was cut. The dashboard loads the whole expectation by id before editing it, so a cut tree is only ever shown. -
expectationTruncationMarker
public static Map<String,Object> expectationTruncationMarker(String expectationId, long originalLength) What the dashboard needs to say an expectation in its expectations section was cut, and to load it whole by id.
-