@Override public boolean apply(@Nonnull ReportPoint point) { this.message = null; long pointTime = point.getTimestamp(); long rightNow = Clock.now(); // within <hoursInPastAllowed> ago and within <hoursInFutureAllowed> boolean pointInRange = (pointTime > (rightNow - this.hoursInPastAllowed * DateUtils.MILLIS_PER_HOUR)) && (pointTime < (rightNow + (this.hoursInFutureAllowed * DateUtils.MILLIS_PER_HOUR))); if (!pointInRange) { outOfRangePointTimes.inc(); this.message = "WF-402: Point outside of reasonable timeframe (" + point.toString() + ")"; } return pointInRange; }
Clock.set(newConfig.currentTime);
Clock.set(newConfig.currentTime);
long timestamp = check.get("timestamp") == null ? Clock.now() : check.get("timestamp").asLong() * 1000; reportValue(metricName, hostName, tags, check.get("status"), timestamp, pointCounter); return true;
long timestamp = check.get("timestamp") == null ? Clock.now() : check.get("timestamp").asLong() * 1000; reportValue(metricName, hostName, tags, check.get("status"), timestamp, pointCounter); return true;
@Override public boolean apply(@NotNull ReportPoint point) { this.message = null; long pointTime = point.getTimestamp(); long rightNow = Clock.now(); // within <hoursInPastAllowed> ago and within <hoursInFutureAllowed> boolean pointInRange = (pointTime > (rightNow - this.hoursInPastAllowed * DateUtils.MILLIS_PER_HOUR)) && (pointTime < (rightNow + (this.hoursInFutureAllowed * DateUtils.MILLIS_PER_HOUR))); if (!pointInRange) { outOfRangePointTimes.inc(); this.message = "WF-402: Point outside of reasonable timeframe (" + point.toString() + ")"; } return pointInRange; }
jsonResponse.put("currentTime", Clock.now()); jsonResponse.put("allowAnyHostKeys", true); writeHttpResponse(ctx, HttpResponseStatus.OK, jsonResponse, request);
jsonResponse.put("currentTime", Clock.now()); jsonResponse.put("allowAnyHostKeys", true); writeHttpResponse(ctx, HttpResponseStatus.OK, jsonResponse, request);
@Override @SuppressWarnings("unchecked") void reportInternal(ReportPoint point) { validatePoint(point, handle, Validation.Level.NUMERIC_ONLY); String strPoint = serializer.apply(point); refreshValidPointsLoggerState(); if ((logData || logPointsFlag) && (logSampleRate >= 1.0d || (logSampleRate > 0.0d && RANDOM.nextDouble() < logSampleRate))) { // we log valid points only if system property wavefront.proxy.logpoints is true or RawValidPoints log level is // set to "ALL". this is done to prevent introducing overhead and accidentally logging points to the main log // Additionally, honor sample rate limit, if set. validPointsLogger.info(strPoint); } getTask().add(strPoint); receivedCounter.inc(); receivedPointLag.update(Clock.now() - point.getTimestamp()); }
@Override @SuppressWarnings("unchecked") void reportInternal(ReportPoint point) { validatePoint(point, handle, Validation.Level.NUMERIC_ONLY); String strPoint = serializer.apply(point); refreshValidPointsLoggerState(); if ((logData || logPointsFlag) && (logSampleRate >= 1.0d || (logSampleRate > 0.0d && RANDOM.nextDouble() < logSampleRate))) { // we log valid points only if system property wavefront.proxy.logpoints is true or RawValidPoints log level is // set to "ALL". this is done to prevent introducing overhead and accidentally logging points to the main log // Additionally, honor sample rate limit, if set. validPointsLogger.info(strPoint); } getTask().add(strPoint); receivedCounter.inc(); receivedPointLag.update(Clock.now() - point.getTimestamp()); }
point.setTable(customerId); point.setTimestamp(Clock.now()); AbstractWrapper wrapper = new ReportPointWrapper(point); try {
receivedPointLag.update(Clock.now() - point.getTimestamp());
receivedPointLag.update(Clock.now() - point.getTimestamp());
point.setTable(customerId); point.setTimestamp(Clock.now()); AbstractWrapper wrapper = new ReportPointWrapper(point); try {
builder.setMetric(metricName); JsonNode time = metric.get("timestamp"); long ts = Clock.now(); // if timestamp is not available, fall back to Clock.now() if (time != null) { int timestampSize = Long.toString(time.asLong()).length();
builder.setMetric(metricName); JsonNode time = metric.get("timestamp"); long ts = Clock.now(); // if timestamp is not available, fall back to Clock.now() if (time != null) { int timestampSize = Long.toString(time.asLong()).length();