Brooklyn

brooklyn.qa.longevity
[Java] Class MonitorUtils

java.lang.Object
  brooklyn.qa.longevity.MonitorUtils

public class MonitorUtils

Nested Class Summary
static class MonitorUtils.MemoryUsage

 
Method Summary
static java.lang.Process exec(java.lang.String cmd)

static int findOwnPid()

static MonitorUtils.MemoryUsage getMemoryUsage(int pid)

static MonitorUtils.MemoryUsage getMemoryUsage(int pid, java.lang.String clazzRegexOfInterest, int minInstancesOfInterest)

@param pid

static java.util.List getRunningPids(java.lang.String regex)

static java.util.List getRunningPids(java.lang.String regex, java.lang.String excludingRegex)

Confirm the given pid is running, and that the the process matches the given regex.

static boolean isPidRunning(int pid)

static boolean isPidRunning(int pid, java.lang.String regex)

Confirm the given pid is running, and that the the process matches the given regex.

static boolean isUrlUp(java.net.URL url)

Confirm can read from URL.

static java.util.List searchLog(java.io.File file, java.lang.String grepOfInterest)

static java.util.List searchLog(java.io.File file, java.lang.String grepOfInterest, java.util.Set grepExclusions)

Find lines in the given file that match given given regex.

static java.lang.String waitFor(java.lang.Process process)

Waits for the given process to complete, consuming its stdout and returning it as a string.

 
Methods inherited from class java.lang.Object
java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
 

Method Detail

exec

public static java.lang.Process exec(java.lang.String cmd)


findOwnPid

public static int findOwnPid()


getMemoryUsage

public static MonitorUtils.MemoryUsage getMemoryUsage(int pid)


getMemoryUsage

public static MonitorUtils.MemoryUsage getMemoryUsage(int pid, java.lang.String clazzRegexOfInterest, int minInstancesOfInterest)
Parameters:
pid


getRunningPids

public static java.util.List getRunningPids(java.lang.String regex)


getRunningPids

public static java.util.List getRunningPids(java.lang.String regex, java.lang.String excludingRegex)
Confirm the given pid is running, and that the the process matches the given regex.
Parameters:
regex
excludingRegex


isPidRunning

public static boolean isPidRunning(int pid)


isPidRunning

public static boolean isPidRunning(int pid, java.lang.String regex)
Confirm the given pid is running, and that the the process matches the given regex.
Parameters:
pid
regex


isUrlUp

public static boolean isUrlUp(java.net.URL url)
Confirm can read from URL.
Parameters:
url


searchLog

public static java.util.List searchLog(java.io.File file, java.lang.String grepOfInterest)


searchLog

public static java.util.List searchLog(java.io.File file, java.lang.String grepOfInterest, java.util.Set grepExclusions)
Find lines in the given file that match given given regex.
Parameters:
file
grepOfInterest


waitFor

public static java.lang.String waitFor(java.lang.Process process)
Waits for the given process to complete, consuming its stdout and returning it as a string.

Does not just use Groovy's: process.waitFor() return process.text

Because that code hangs for bing output streams.


 

Brooklyn Multi-Cloud Application Management Platform
brooklyncentral.github.com. Apache License. © 2012.