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

org.tkit.quarkus.log.rs.RestInterceptorContext Maven / Gradle / Ivy

There is a newer version: 2.36.0
Show newest version
package org.tkit.quarkus.log.rs;

import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.HashSet;
import java.util.Set;

public class RestInterceptorContext {

    RestServiceValue.MethodItem ano;

    String method;

    String uri;

    String path;

    String durationString;

    long durationMillis;

    double durationSec;

    boolean exclude = false;

    String logger = RestInterceptorContext.class.getName();

    Set mdcKeys = new HashSet<>();

    private final long startTime;

    RestInterceptorContext() {
        this.startTime = System.currentTimeMillis();
    }

    public void close() {
        durationMillis = (System.currentTimeMillis() - startTime);
        durationSec = BigDecimal.valueOf(durationMillis / 1000f).setScale(3, RoundingMode.HALF_DOWN).doubleValue();
        durationString = String.format("%.3f", durationSec);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy