Class DashboardRest
java.lang.Object
jakarta.servlet.GenericServlet
jakarta.servlet.http.HttpServlet
org.apache.juneau.rest.server.servlet.RestServlet
org.apache.juneau.rest.server.servlet.BasicRestServlet
org.apache.juneau.petstore.console.PetstoreConsolePage
org.apache.juneau.petstore.console.dev.DashboardRest
- All Implemented Interfaces:
jakarta.servlet.Servlet,jakarta.servlet.ServletConfig,Serializable,BasicUniversalConfig,DefaultConfig,DefaultHtmlConfig
Dashboard: the dashboard-chrome demo page, built with
DevPageBuilders.dashboard(String, int) only.
?variant= picks how the orders source behaves (ok, slow, truncated or
error; right behaves as ok and puts the rail on the right) and ?v= sets the persist version. /series/<variant> serves one CSV row per UTC day in
[start, end), filtered by reasons, q and lateOnly; /requests counts the series
requests, so a test can see Refresh and Clear cache reach the server.
Example:
GET /console/dev/dashboard?variant=slow GET /console/dev/dashboard/series/ok?start=2026-10-01T00:00:00Z&end=2026-10-08T00:00:00Z&reasons=late
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.juneau.rest.server.servlet.RestServlet
RestServlet.Builder<R extends RestServlet,SELF extends RestServlet.Builder<R, SELF>>, RestServlet.DefaultBuilder<R extends RestServlet> -
Field Summary
Fields inherited from class org.apache.juneau.petstore.console.PetstoreConsolePage
PAGE_HEADER, TEMPLATESFields inherited from class jakarta.servlet.http.HttpServlet
LEGACY_DO_HEAD -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionpage(RestRequest req, String variant, Integer v) Renders the Dashboard page.reasons()Orders by reason over a fixed 28 days, for theby-reasonbar and thesharedonut.requests()The series request counter.voidscript(RestResponse res) Serves the page-local script (thepetstore.laterail section).voidseries(RestRequest req, RestResponse res, String variant, String q, String start, String end, String lateOnly) Theorderssource:day,reason,orders, one row per UTC day.weekdays()Orders by weekday over the same fixed 28 days, for theby-weekdaybar.Methods inherited from class org.apache.juneau.petstore.console.PetstoreConsolePage
builder, freemarker, store, twinMethods inherited from class org.apache.juneau.rest.server.servlet.RestServlet
builder, createAuthenticator, destroy, doLog, getContext, getPath, getPaths, getRequest, getResponse, getRestBuilder, init, log, log, service, setContextMethods inherited from class jakarta.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPatch, doPost, doPut, doTrace, getLastModified, isSensitiveHeader, serviceMethods inherited from class jakarta.servlet.GenericServlet
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
-
Constructor Details
-
DashboardRest
public DashboardRest()
-
-
Method Details
-
page
Renders the Dashboard page.- Parameters:
req- The request.variant- The source variant; anything unknown isok.v- The persist version; below 1 (or absent) is 1.- Returns:
- The page.
-
series
public void series(RestRequest req, RestResponse res, @Path("variant") String variant, @Query("q") @Schema(aev=true) String q, @Query("start") String start, @Query("end") String end, @Query("lateOnly") String lateOnly) throws IOException Theorderssource:day,reason,orders, one row per UTC day.- Parameters:
req- The request (for the repeatedreasonsparameter).res- The response.variant-ok,slow(half the rows, a pause, the rest),truncated(at most 20 rows and the#truncated,20sentinel) orerror(a 500).q- Keeps rows whose reason contains this text, case-insensitively; empty keeps every row.start- The window start, ISO-8601; defaults to 30 days beforeend.end- The window end, ISO-8601, exclusive; defaults to the start of tomorrow (UTC).lateOnly-truekeeps onlylate.- Throws:
IOException- If the response can't be written.
-
reasons
Orders by reason over a fixed 28 days, for theby-reasonbar and thesharedonut.- Returns:
- One row per reason.
-
weekdays
Orders by weekday over the same fixed 28 days, for theby-weekdaybar.- Returns:
- One row per weekday, Monday first.
-
requests
The series request counter.- Returns:
{series: n}.
-
script
Serves the page-local script (thepetstore.laterail section).- Parameters:
res- The response.- Throws:
IOException- If the bundled script can't be read.
-