@Override public Number getMetric(String metric) { return Rows.objectToNumber(metric, event.get(metric)); }
@Override public long getTimestampFromEpoch() { final RowFunction transform = transforms.get(ColumnHolder.TIME_COLUMN_NAME); if (transform != null) { return Rows.objectToNumber(ColumnHolder.TIME_COLUMN_NAME, transform.eval(row)).longValue(); } else { return row.getTimestampFromEpoch(); } }
@Override public Number getMetric(final String metric) { final RowFunction transform = transforms.get(metric); if (transform != null) { return Rows.objectToNumber(metric, transform.eval(row)); } else { return row.getMetric(metric); } }
@Override public ApproximateHistogram extractValue(InputRow inputRow, String metricName) { Object rawValue = inputRow.getRaw(metricName); if (rawValue == null) { return new ApproximateHistogram(0); } else if (rawValue instanceof ApproximateHistogram) { return (ApproximateHistogram) rawValue; } else { ApproximateHistogram h = new ApproximateHistogram(); if (rawValue instanceof Collection) { for (final Object next : ((Collection) rawValue)) { if (next != null) { h.offer(Rows.objectToNumber(metricName, next).floatValue()); } } } else { h.offer(Rows.objectToNumber(metricName, rawValue).floatValue()); } return h; } } };
Number numberAttempt; try { numberAttempt = Rows.objectToNumber(metricName, rawValue); FixedBucketsHistogram fbh = new FixedBucketsHistogram( aggregatorFactory.getLowerLimit(),
@Override public Number getMetric(String metric) { return Rows.objectToNumber(metric, event.get(metric)); }
@Override public long getTimestampFromEpoch() { final RowFunction transform = transforms.get(ColumnHolder.TIME_COLUMN_NAME); if (transform != null) { return Rows.objectToNumber(ColumnHolder.TIME_COLUMN_NAME, transform.eval(row)).longValue(); } else { return row.getTimestampFromEpoch(); } }
@Override public Number getMetric(final String metric) { final RowFunction transform = transforms.get(metric); if (transform != null) { return Rows.objectToNumber(metric, transform.eval(row)); } else { return row.getMetric(metric); } }
@Override public ApproximateHistogram extractValue(InputRow inputRow, String metricName) { Object rawValue = inputRow.getRaw(metricName); if (rawValue == null) { return new ApproximateHistogram(0); } else if (rawValue instanceof ApproximateHistogram) { return (ApproximateHistogram) rawValue; } else { ApproximateHistogram h = new ApproximateHistogram(); if (rawValue instanceof Collection) { for (final Object next : ((Collection) rawValue)) { if (next != null) { h.offer(Rows.objectToNumber(metricName, next).floatValue()); } } } else { h.offer(Rows.objectToNumber(metricName, rawValue).floatValue()); } return h; } } };