public int upTime() { return Time.deltaSecs(startTime); } }
public synchronized void updateTimeout(Integer timeout) { isTimedOut = Time.deltaSecs(getNimbusTimeSecs()) >= timeout; }
Integer delta = startTime == null ? null : Time.deltaSecs(startTime.intValue()); if (startTime != null && ((delta < taskLaunchSecs) || !isTimedOut)) { ret.add(exec);
@Override public void report(Throwable error) { LOG.error("Error", error); if (Time.deltaSecs(intervalStartTime.get()) > errorIntervalSecs) { intervalErrors.set(0); intervalStartTime.set(Time.currentTimeSecs()); } if (intervalErrors.incrementAndGet() <= maxPerInterval) { try { stormClusterState.reportError(stormId, componentId, Utils.hostname(), workerTopologyContext.getThisWorkerPort().longValue(), error); } catch (UnknownHostException e) { throw Utils.wrapInRuntime(e); } } } }
/** * getComponentErrorInfo. * @param errorInfo errorInfo * @param config config * @param topologyId topologyId * @return getComponentErrorInfo */ private static Map<String, Object> getComponentErrorInfo(ErrorInfo errorInfo, Map config, String topologyId) { Map<String, Object> result = new HashMap(); result.put("errorTime", errorInfo.get_error_time_secs()); String host = errorInfo.get_host(); result.put("errorHost", host); int port = errorInfo.get_port(); result.put("errorPort", port); result.put("errorWorkerLogLink", getWorkerLogLink(host, port, config, topologyId)); result.put("errorLapsedSecs", Time.deltaSecs(errorInfo.get_error_time_secs())); result.put("error", errorInfo.get_error()); return result; }
@Override public NimbusSummary getLeader() throws AuthorizationException, TException { getLeaderCalls.mark(); checkAuthorization(null, null, "getClusterInfo"); List<NimbusSummary> nimbuses = stormClusterState.nimbuses(); NimbusInfo leader = leaderElector.getLeader(); for (NimbusSummary nimbusSummary : nimbuses) { if (leader.getHost().equals(nimbusSummary.get_host()) && leader.getPort() == nimbusSummary.get_port()) { nimbusSummary.set_uptime_secs(Time.deltaSecs(nimbusSummary.get_uptime_secs())); nimbusSummary.set_isLeader(true); return nimbusSummary; } } return null; }
TopologyInfo topoInfo = new TopologyInfo(topoId, common.topoName, Time.deltaSecs(common.launchTimeSecs), summaries, extractStatusStr(common.base), errors); if (common.topology.is_set_storm_version()) {
@Test public void deltaSecsTruncatesFractionalSecondsTest() { try (SimulatedTime t = new SimulatedTime()) { int current = Time.currentTimeSecs(); Time.advanceTime(1500); Assert.assertEquals(Time.deltaSecs(current), 1, 0); } }
@Test public void deltaSecsConvertsToSecondsTest() { try (SimulatedTime t = new SimulatedTime()) { int current = Time.currentTimeSecs(); Time.advanceTime(1000); Assert.assertEquals(Time.deltaSecs(current), 1); } }
topoPageInfo.set_uptime_secs(Time.deltaSecs(launchTimeSecs)); topoPageInfo.set_topology_conf(JSONValue.toJSONString(topoConf)); topoPageInfo.set_replication_count(getBlobReplicationCount(ConfigUtils.masterStormCodeKey(topoId)));
public int upTime() { return Time.deltaSecs(startTime); } }