@Test public void testGetUptimeForClusterNoGetUpSince() { Cluster cluster = new Cluster(); int minutes = 10; cluster.setUptime(Duration.ofMinutes(minutes).toString()); long uptime = stackUtil.getUptimeForCluster(cluster, false); assertEquals(Duration.ofMinutes(minutes).toMillis(), uptime); }
public long getUptimeForCluster(Cluster cluster, boolean addUpsinceToUptime) { Duration uptime = Duration.ZERO; if (StringUtils.isNotBlank(cluster.getUptime())) { uptime = Duration.parse(cluster.getUptime()); } if (cluster.getUpSince() != null && addUpsinceToUptime) { long now = new Date().getTime(); uptime = uptime.plusMillis(now - cluster.getUpSince()); } return uptime.toMillis(); }
StackUtil { public long getUptimeForCluster(Cluster cluster, boolean addUpsinceToUptime) { Duration uptime = Duration.ZERO; if (StringUtils.isNotBlank(cluster.getUptime())) { uptime = Duration.parse(cluster.getUptime()); } if (cluster.getUpSince() != null && addUpsinceToUptime) { long now = new Date().getTime(); uptime = uptime.plusMillis(now - cluster.getUpSince()); } return uptime.toMillis(); } }
StackUtil { public long getUptimeForCluster(Cluster cluster, boolean addUpsinceToUptime) { Duration uptime = Duration.ZERO; if (StringUtils.isNotBlank(cluster.getUptime())) { uptime = Duration.parse(cluster.getUptime()); } if (cluster.getUpSince() != null && addUpsinceToUptime) { long now = new Date().getTime(); uptime = uptime.plusMillis(now - cluster.getUpSince()); } return uptime.toMillis(); }  }
StackUtil { public long getUptimeForCluster(Cluster cluster, boolean addUpsinceToUptime) { Duration uptime = Duration.ZERO; if (StringUtils.isNotBlank(cluster.getUptime())) { uptime = Duration.parse(cluster.getUptime()); } if (cluster.getUpSince() != null && addUpsinceToUptime) { long now = new Date().getTime(); uptime = uptime.plusMillis(now - cluster.getUpSince()); } return uptime.toMillis(); }  Set<Node> collectNodes(Stack stack); Set<Node> collectReachableNodes(Stack stack); Set<Node> collectNodesFromHostnames(Stack stack, Set<String> hostnames); Set<Node> collectNodesWithDiskData(Stack stack); Set<Node> collectNewNodesWithDiskData(Stack stack, Set<String> newNodeAddresses); String extractClusterManagerIp(StackView stackView); String extractClusterManagerIp(Stack stack); String extractClusterManagerAddress(Stack stack); long getUptimeForCluster(Cluster cluster, boolean addUpsinceToUptime); CloudCredential getCloudCredential(Stack stack); }
StackUtil { public long getUptimeForCluster(Cluster cluster, boolean addUpsinceToUptime) { Duration uptime = Duration.ZERO; if (StringUtils.isNotBlank(cluster.getUptime())) { uptime = Duration.parse(cluster.getUptime()); } if (cluster.getUpSince() != null && addUpsinceToUptime) { long now = new Date().getTime(); uptime = uptime.plusMillis(now - cluster.getUpSince()); } return uptime.toMillis(); }  Set<Node> collectNodes(Stack stack); Set<Node> collectReachableNodes(Stack stack); Set<Node> collectNodesFromHostnames(Stack stack, Set<String> hostnames); Set<Node> collectNodesWithDiskData(Stack stack); Set<Node> collectNewNodesWithDiskData(Stack stack, Set<String> newNodeAddresses); String extractClusterManagerIp(StackView stackView); String extractClusterManagerIp(Stack stack); String extractClusterManagerAddress(Stack stack); long getUptimeForCluster(Cluster cluster, boolean addUpsinceToUptime); CloudCredential getCloudCredential(Stack stack);  }