Skip to content

Commit 848cdcd

Browse files
committed
Add metrics
1 parent 940c4ff commit 848cdcd

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

  • stubbornjava-examples/src/main/java/com/stubbornjava/examples/undertow/handlebars

‎stubbornjava-examples/src/main/java/com/stubbornjava/examples/undertow/handlebars/WebpackServer.java‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package com.stubbornjava.examples.undertow.handlebars;
22

3+
import static com.stubbornjava.common.undertow.handlers.CustomHandlers.timed;
4+
35
import org.slf4j.Logger;
46
import org.slf4j.LoggerFactory;
57

@@ -78,10 +80,10 @@ private static HttpHandler wrapWithMiddleware(HttpHandler handler) {
7880
// Simple routing, anything not matching a route will fall back
7981
// to the not found handler.
8082
private static final HttpHandler ROUTES = new RoutingHandler()
81-
.get("/", WebpackServer::home)
82-
.get("/hello", WebpackServer::hello)
83-
.get("/static*", CustomHandlers.resource(""))
84-
.setFallbackHandler(WebpackServer::notFound)
83+
.get("/", timed("home", WebpackServer::home))
84+
.get("/hello", timed("hello", WebpackServer::hello))
85+
.get("/static*", timed("static", CustomHandlers.resource("")))
86+
.setFallbackHandler(timed("notfound", WebpackServer::notFound))
8587
;
8688

8789
public static void main(String[] args) {

0 commit comments

Comments
 (0)