Spring Data MongoDB

org.springframework.data.mongodb.monitor
Class ServerInfo

java.lang.Object
  extended by org.springframework.data.mongodb.monitor.AbstractMonitor
      extended by org.springframework.data.mongodb.monitor.ServerInfo

@ManagedResource(description="Server Information")
public class ServerInfo
extends AbstractMonitor

Expose basic server information via JMX

Author:
Mark Pollack, Thomas Darimont

Field Summary
 
Fields inherited from class org.springframework.data.mongodb.monitor.AbstractMonitor
mongo
 
Constructor Summary
ServerInfo(com.mongodb.Mongo mongo)
           
 
Method Summary
 String getHostName()
          Returns the hostname of the used server reported by mongo.
 String getLocalTime()
           
 double getUptime()
           
 double getUptimeEstimate()
           
 String getVersion()
           
 
Methods inherited from class org.springframework.data.mongodb.monitor.AbstractMonitor
getDb, getServerStatus, setPassword, setUsername
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServerInfo

public ServerInfo(com.mongodb.Mongo mongo)
Method Detail

getHostName

@ManagedOperation(description="Server host name")
public String getHostName()
                   throws UnknownHostException
Returns the hostname of the used server reported by mongo.

Returns:
the reported hostname can also be an IP address.
Throws:
UnknownHostException

getUptimeEstimate

@ManagedMetric(displayName="Uptime Estimate")
public double getUptimeEstimate()

getVersion

@ManagedOperation(description="MongoDB Server Version")
public String getVersion()

getLocalTime

@ManagedOperation(description="Local Time")
public String getLocalTime()

getUptime

@ManagedMetric(metricType=COUNTER,
               displayName="Server uptime in seconds",
               unit="seconds")
public double getUptime()

Spring Data MongoDB

Copyright © 2011-2013-2013 Pivotal. All Rights Reserved.