Skip to content

Instantly share code, notes, and snippets.

@m0mus

m0mus/HelloWorld.java Secret

Last active Sep 9, 2018
Embed
What would you like to do?
Helidon Takes Flight #2
// create metric registry
MetricsSupport metricsSupport = MetricsSupport.create();
// get the registry
MetricRegistry registry = RegistryFactory
.getRegistryFactory()
.get()
.getRegistry(MetricRegistry.Type.APPLICATION);
// create a counter
Counter helloCounter = registry.counter("helloCounter");
Routing routing = Routing.builder()
// register metric support with web server
.register(metricsSupport)
.get("/hello", (req, res) -> {
// increase counter
helloCounter.inc();
res.send("Hello World");
})
.build();
WebServer.create(routing)
.start();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.