public class SystemInfoHandler extends RequestHandlerBase
SolrInfoMBean.Category
Modifier and Type | Field and Description |
---|---|
private static org.slf4j.Logger |
log |
private static long |
ONE_GB |
private static long |
ONE_KB |
private static long |
ONE_MB |
appends, defaults, httpCaching, initArgs, invariants
Constructor and Description |
---|
SystemInfoHandler() |
Modifier and Type | Method and Description |
---|---|
(package private) static void |
addGetterIfAvaliable(java.lang.Object obj,
java.lang.String getter,
NamedList<java.lang.Object> info)
Try to run a getter function.
|
private static java.lang.String |
execute(java.lang.String cmd)
Utility function to execute a function
|
private static SimpleOrderedMap<java.lang.Object> |
getCoreInfo(SolrCore core)
Get system info
|
java.lang.String |
getDescription()
Simple one or two line description
|
static SimpleOrderedMap<java.lang.Object> |
getJvmInfo()
Get JVM Info - including memory info
|
private static SimpleOrderedMap<java.lang.Object> |
getLuceneInfo() |
java.lang.String |
getSource()
CVS Source, SVN Source, etc
|
java.lang.String |
getSourceId()
CVS Id, SVN Id, etc
|
static SimpleOrderedMap<java.lang.Object> |
getSystemInfo()
Get system info
|
java.lang.String |
getVersion()
Simple common usage version, e.g.
|
void |
handleRequestBody(SolrQueryRequest req,
SolrQueryResponse rsp) |
private static java.lang.String |
humanReadableUnits(long bytes,
java.text.DecimalFormat df)
Return good default units based on byte size.
|
getCategory, getDocs, getInitArgs, getName, getStatistics, handleRequest, init
private static org.slf4j.Logger log
private static final long ONE_KB
private static final long ONE_MB
private static final long ONE_GB
public void handleRequestBody(SolrQueryRequest req, SolrQueryResponse rsp) throws java.lang.Exception
handleRequestBody
in class RequestHandlerBase
java.lang.Exception
private static SimpleOrderedMap<java.lang.Object> getCoreInfo(SolrCore core) throws java.lang.Exception
java.lang.Exception
public static SimpleOrderedMap<java.lang.Object> getSystemInfo() throws java.lang.Exception
java.lang.Exception
static void addGetterIfAvaliable(java.lang.Object obj, java.lang.String getter, NamedList<java.lang.Object> info)
OperatingSystemMXBean
If you are running a sun jvm, there are nice functions in:
UnixOperatingSystemMXBean and com.sun.management.OperatingSystemMXBean
it is package protected so it can be tested...private static java.lang.String execute(java.lang.String cmd)
public static SimpleOrderedMap<java.lang.Object> getJvmInfo()
private static SimpleOrderedMap<java.lang.Object> getLuceneInfo() throws java.lang.Exception
java.lang.Exception
public java.lang.String getDescription()
SolrInfoMBean
getDescription
in interface SolrInfoMBean
getDescription
in class RequestHandlerBase
public java.lang.String getVersion()
SolrInfoMBean
getVersion
in interface SolrInfoMBean
getVersion
in class RequestHandlerBase
public java.lang.String getSourceId()
SolrInfoMBean
getSourceId
in interface SolrInfoMBean
getSourceId
in class RequestHandlerBase
public java.lang.String getSource()
SolrInfoMBean
getSource
in interface SolrInfoMBean
getSource
in class RequestHandlerBase
private static java.lang.String humanReadableUnits(long bytes, java.text.DecimalFormat df)