/** * {@inheritDoc} */ @Override public int hashCode() { int code = 0; code += this.getApplicationName().hashCode(); code += ((int)this.getTimestamp()); code += ((int)this.getResponseTime()); return code; }
/** * {@inheritDoc} * * @deprecated since 1.13. Use {@link #serialize(IValueSerializer)} with an array serializer instead. */ @Override @Deprecated public Object[] toArray() { return new Object[] { this.getApplicationName(), this.getTimestamp(), this.getResponseTime() }; } /**
/** * {@inheritDoc} */ @Override public boolean equals(final Object obj) { if (obj == null) return false; if (obj == this) return true; if (obj.getClass() != this.getClass()) return false; final NamedDoubleRecord castedRecord = (NamedDoubleRecord) obj; if (this.getLoggingTimestamp() != castedRecord.getLoggingTimestamp()) return false; if (!this.getApplicationName().equals(castedRecord.getApplicationName())) return false; if (this.getTimestamp() != castedRecord.getTimestamp()) return false; if (isNotEqual(this.getResponseTime(), castedRecord.getResponseTime())) return false; return true; }
@InputPort(name = INPUT_PORT_NAME_VALUE, eventTypes = { NamedDoubleRecord.class }) public void inputExecutionRecord(final NamedDoubleRecord record) { final long timestampMillis = this.timeunit.convert(record.getTimestamp(), super.recordsTimeUnitFromProjectContext); final NamedDoubleTimeSeriesPoint tspoint = new NamedDoubleTimeSeriesPoint(timestampMillis, record.getResponseTime(), record.getApplicationName()); super.deliver(OUTPUT_PORT_NAME_VALUE, tspoint); }
@InputPort(name = INPUT_PORT_NAME_VALUE, eventTypes = { NamedDoubleRecord.class }) public void inputExecutionRecord(final NamedDoubleRecord record) { final long timestampMillis = this.timeunit.convert(record.getTimestamp(), super.recordsTimeUnitFromProjectContext); final NamedDoubleTimeSeriesPoint tspoint = new NamedDoubleTimeSeriesPoint(timestampMillis, record.getResponseTime(), record.getApplicationName()); super.deliver(OUTPUT_PORT_NAME_VALUE, tspoint); }
return false; if (this.getTimestamp() != castedRecord.getTimestamp()) { return false;
/** * Tests the timestamp of the previously converted OperationExecutionRecord. */ @Test public void testConversionTimestamp() { Assert.assertEquals("Check whether timestamp is still intact", RecordConverterTest.loggingTimestamp, this.conversionResult.getTimestamp()); }
/** * {@inheritDoc} */ @Override public void serialize(final IValueSerializer serializer) throws BufferOverflowException { //super.serialize(serializer); serializer.putString(this.getApplicationName()); serializer.putLong(this.getTimestamp()); serializer.putDouble(this.getResponseTime()); } /**
/** * {@inheritDoc} */ @Override public void serialize(final IValueSerializer serializer) throws BufferOverflowException { //super.serialize(serializer); serializer.putString(this.getApplicationName()); serializer.putLong(this.getTimestamp()); serializer.putDouble(this.getResponseTime()); }
/** * Tests {@link NamedDoubleRecord#TestNamedDoubleRecord(string, long, double)}. */ @Test public void testBuffer() { // NOPMD (assert missing) for (int i = 0; i < ARRAY_LENGTH; i++) { // initialize final NamedDoubleRecord record = new NamedDoubleRecord(STRING_VALUES.get(i % STRING_VALUES.size()), LONG_VALUES.get(i % LONG_VALUES.size()), DOUBLE_VALUES.get(i % DOUBLE_VALUES.size())); // check values Assert.assertEquals("NamedDoubleRecord.applicationName values are not equal.", STRING_VALUES.get(i % STRING_VALUES.size()) == null ? "" : STRING_VALUES.get(i % STRING_VALUES.size()), record.getApplicationName()); Assert.assertEquals("NamedDoubleRecord.timestamp values are not equal.", (long) LONG_VALUES.get(i % LONG_VALUES.size()), record.getTimestamp()); Assert.assertEquals("NamedDoubleRecord.responseTime values are not equal.", DOUBLE_VALUES.get(i % DOUBLE_VALUES.size()), record.getResponseTime(), 0.0000001); } }
/** * Tests {@link NamedDoubleRecord#TestNamedDoubleRecord(string, long, double)}. */ @Test public void testParameterConstruction() { // NOPMD (assert missing) for (int i = 0; i < ARRAY_LENGTH; i++) { // initialize final NamedDoubleRecord record = new NamedDoubleRecord(STRING_VALUES.get(i % STRING_VALUES.size()), LONG_VALUES.get(i % LONG_VALUES.size()), DOUBLE_VALUES.get(i % DOUBLE_VALUES.size())); // check values Assert.assertEquals("NamedDoubleRecord.applicationName values are not equal.", STRING_VALUES.get(i % STRING_VALUES.size()) == null ? "" : STRING_VALUES.get(i % STRING_VALUES.size()), record.getApplicationName()); Assert.assertEquals("NamedDoubleRecord.timestamp values are not equal.", (long) LONG_VALUES.get(i % LONG_VALUES.size()), record.getTimestamp()); Assert.assertEquals("NamedDoubleRecord.responseTime values are not equal.", DOUBLE_VALUES.get(i % DOUBLE_VALUES.size()), record.getResponseTime(), 0.0000001); } }