[java-identity-provider] branch master updated: IDP-1490 - add system hostname to metrics
Scott Cantor
cantor.2 at osu.edu
Wed Sep 4 15:21:20 EDT 2019
This is an automated email from the git hooks/post-receive script.
scantor pushed a commit to branch master
in repository java-identity-provider.
View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=e4aaaf704a9e25a9a419f36a197323d375ccf217
The following commit(s) were added to refs/heads/master by this push:
new e4aaaf7 IDP-1490 - add system hostname to metrics
e4aaaf7 is described below
commit e4aaaf704a9e25a9a419f36a197323d375ccf217
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Wed Sep 4 15:21:21 2019 -0400
IDP-1490 - add system hostname to metrics
https://issues.shibboleth.net/jira/browse/IDP-1490
---
.../java/net/shibboleth/idp/metrics/impl/CoreGaugeSet.java | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/idp-core/src/main/java/net/shibboleth/idp/metrics/impl/CoreGaugeSet.java b/idp-core/src/main/java/net/shibboleth/idp/metrics/impl/CoreGaugeSet.java
index f0d7e19..1fbeb7c 100644
--- a/idp-core/src/main/java/net/shibboleth/idp/metrics/impl/CoreGaugeSet.java
+++ b/idp-core/src/main/java/net/shibboleth/idp/metrics/impl/CoreGaugeSet.java
@@ -24,6 +24,8 @@ import com.codahale.metrics.RatioGauge;
import net.shibboleth.utilities.java.support.annotation.constraint.NonnullElements;
+import java.net.InetAddress;
+import java.net.UnknownHostException;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
@@ -44,6 +46,18 @@ public class CoreGaugeSet implements MetricSet, MetricFilter {
gauges = new HashMap<>();
gauges.put(
+ "host.name",
+ new Gauge<String>() {
+ public String getValue() {
+ try {
+ return InetAddress.getLocalHost().getHostName();
+ } catch (final UnknownHostException e) {
+ return null;
+ }
+ }
+ });
+
+ gauges.put(
"os.name",
new Gauge<String>() {
public String getValue() {
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list