@Test public void testIsUrlUp() throws Exception { assertFalse(MonitorUtils.isUrlUp(new URL("http: }
public static boolean isUrlUp(URL url) { try { HttpToolResponse result = HttpTool.httpGet( HttpTool.httpClientBuilder().trustAll().build(), URI.create(url.toString()), ImmutableMap.<String,String>of()); int statuscode = result.getResponseCode(); if (statuscode != 200) { LOG.info("Error reading URL {}: {}, {}", new Object[]{url, statuscode, result.getReasonPhrase()}); return false; } else { return true; } } catch (Exception e) { LOG.info("Error reading URL {}: {}", url, e); return false; } }
MonitorUtils { public static boolean isUrlUp(URL url) { try { HttpToolResponse result = HttpTool.httpGet( HttpTool.httpClientBuilder().trustAll().build(), URI.create(url.toString()), ImmutableMap.<String,String>of()); int statuscode = result.getResponseCode(); if (statuscode != 200) { LOG.info("Error reading URL {}: {}, {}", new Object[]{url, statuscode, result.getReasonPhrase()}); return false; } else { return true; } } catch (Exception e) { LOG.info("Error reading URL {}: {}", url, e); return false; } } }
MonitorUtils { public static boolean isUrlUp(URL url) { try { HttpToolResponse result = HttpTool.httpGet( HttpTool.httpClientBuilder().trustAll().build(), URI.create(url.toString()), ImmutableMap.<String,String>of()); int statuscode = result.getResponseCode(); if (statuscode != 200) { LOG.info("Error reading URL {}: {}, {}", new Object[]{url, statuscode, result.getReasonPhrase()}); return false; } else { return true; } } catch (Exception e) { LOG.info("Error reading URL {}: {}", url, e); return false; } }  }
MonitorUtils { public static boolean isUrlUp(URL url) { try { HttpToolResponse result = HttpTool.httpGet( HttpTool.httpClientBuilder().trustAll().build(), URI.create(url.toString()), ImmutableMap.<String,String>of()); int statuscode = result.getResponseCode(); if (statuscode != 200) { LOG.info("Error reading URL {}: {}, {}", new Object[]{url, statuscode, result.getReasonPhrase()}); return false; } else { return true; } } catch (Exception e) { LOG.info("Error reading URL {}: {}", url, e); return false; } }  static boolean isUrlUp(URL url); static boolean isPidRunning(int pid); static boolean isPidRunning(int pid, String regex); static List<Integer> getRunningPids(String regex); static List<Integer> getRunningPids(String regex, String excludingRegex); static MemoryUsage getMemoryUsage(int pid); static MemoryUsage getMemoryUsage(int pid, String clazzRegexOfInterest, int minInstancesOfInterest); static List<String> searchLog(File file, String grepOfInterest); static List<String> searchLog(File file, String grepOfInterest, Set<String> grepExclusions); static Process exec(String cmd); static String waitFor(Process process); static int findOwnPid(); }
MonitorUtils { public static boolean isUrlUp(URL url) { try { HttpToolResponse result = HttpTool.httpGet( HttpTool.httpClientBuilder().trustAll().build(), URI.create(url.toString()), ImmutableMap.<String,String>of()); int statuscode = result.getResponseCode(); if (statuscode != 200) { LOG.info("Error reading URL {}: {}, {}", new Object[]{url, statuscode, result.getReasonPhrase()}); return false; } else { return true; } } catch (Exception e) { LOG.info("Error reading URL {}: {}", url, e); return false; } }  static boolean isUrlUp(URL url); static boolean isPidRunning(int pid); static boolean isPidRunning(int pid, String regex); static List<Integer> getRunningPids(String regex); static List<Integer> getRunningPids(String regex, String excludingRegex); static MemoryUsage getMemoryUsage(int pid); static MemoryUsage getMemoryUsage(int pid, String clazzRegexOfInterest, int minInstancesOfInterest); static List<String> searchLog(File file, String grepOfInterest); static List<String> searchLog(File file, String grepOfInterest, Set<String> grepExclusions); static Process exec(String cmd); static String waitFor(Process process); static int findOwnPid();  }