All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.glassfish.jersey.examples.micrometer.TimedResource Maven / Gradle / Ivy

The newest version!
/*
 * Copyright (c) 2023 Oracle and/or its affiliates. All rights reserved.
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Distribution License v. 1.0, which is available at
 * http://www.eclipse.org/org/documents/edl-v10.php.
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */

package org.glassfish.jersey.examples.micrometer;

import io.micrometer.core.annotation.Timed;

import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.Produces;

import static org.glassfish.jersey.examples.micrometer.App.WEB_PATH;

@Path("timed")
public class TimedResource {

    public static final String MESSAGE = "Gaining measures in the annotated way. "
            + "
Take a look at the standard way of measurements
" + "Or just go to summary to check what you've got"; public static final String TIMER_NAME = "http.timers"; public static final String TIMER_DESCRIPTION = "resource measurement timer"; @GET @Produces("text/html") @Timed(value = TIMER_NAME, description = TIMER_DESCRIPTION, histogram = true) public String getTimedMessage() { return MESSAGE; } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy