logf
This commit is contained in:
parent
e127a7e73c
commit
3e84eac3cb
|
@ -10,6 +10,9 @@ import java.util.Map;
|
|||
|
||||
import javax.annotation.PostConstruct;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
|
@ -24,10 +27,13 @@ public class MetricUtils {
|
|||
@Autowired(required = false)
|
||||
private Map<String, MetricInfo> kpiMetrics;
|
||||
|
||||
private static final Log log = LogFactory.getLog(MetricUtils.class);
|
||||
|
||||
@PostConstruct
|
||||
public void registerToMainEndpoint() {
|
||||
if (kpiMetrics != null) {
|
||||
kpiMetrics.forEach((k, v) -> Metrics.gauge(k, v, o -> o.obtainValue()));
|
||||
log.info("KPI METRICS REGISTERED: " + StringUtils.join(kpiMetrics.keySet(), ", "));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue