/** Build a populated string registry for all tests. */
  private IRegistry<String> makeStringRegistry() {
    final IRegistry<String> stringRegistry = new Registry<String>();
    // get registers string and returns their ID
    stringRegistry.get(PROPERTY_OPERATION_SIGNATURE);
    stringRegistry.get(PROPERTY_CLASS_SIGNATURE);
    stringRegistry.get(PROPERTY_CAUSE);

    return stringRegistry;
  }
Esempio n. 2
0
 /**
  * This constructor converts the given array into a record.
  *
  * @param buffer The bytes for the record.
  * @throws BufferUnderflowException if buffer not sufficient
  */
 public CPUUtilizationRecord(final ByteBuffer buffer, final IRegistry<String> stringRegistry)
     throws BufferUnderflowException {
   this.timestamp = buffer.getLong();
   this.hostname = stringRegistry.get(buffer.getInt());
   this.cpuID = stringRegistry.get(buffer.getInt());
   this.user = buffer.getDouble();
   this.system = buffer.getDouble();
   this.wait = buffer.getDouble();
   this.nice = buffer.getDouble();
   this.irq = buffer.getDouble();
   this.totalUtilization = buffer.getDouble();
   this.idle = buffer.getDouble();
 }
Esempio n. 3
0
 /** {@inheritDoc} */
 @Override
 public void writeBytes(final ByteBuffer buffer, final IRegistry<String> stringRegistry)
     throws BufferOverflowException {
   buffer.putLong(this.getTimestamp());
   buffer.putInt(stringRegistry.get(this.getHostname()));
   buffer.putInt(stringRegistry.get(this.getCpuID()));
   buffer.putDouble(this.getUser());
   buffer.putDouble(this.getSystem());
   buffer.putDouble(this.getWait());
   buffer.putDouble(this.getNice());
   buffer.putDouble(this.getIrq());
   buffer.putDouble(this.getTotalUtilization());
   buffer.putDouble(this.getIdle());
 }
 /** {@inheritDoc} */
 @Override
 public void writeBytes(final ByteBuffer buffer, final IRegistry<String> stringRegistry)
     throws BufferOverflowException {
   buffer.putLong(this.getTimestamp());
   buffer.putLong(this.getTraceId());
   buffer.putInt(this.getOrderIndex());
   buffer.putInt(stringRegistry.get(this.getClassSignature()));
   buffer.putInt(this.getObjectId());
 }
Esempio n. 5
0
 /** {@inheritDoc} */
 @Override
 public void registerStrings(final IRegistry<String> stringRegistry) { // NOPMD (generated code)
   stringRegistry.get(this.getHostname());
   stringRegistry.get(this.getCpuID());
 }
 /** {@inheritDoc} */
 @Override
 public void registerStrings(final IRegistry<String> stringRegistry) { // NOPMD (generated code)
   stringRegistry.get(this.getClassSignature());
 }
 /**
  * This constructor converts the given array into a record.
  *
  * @param buffer The bytes for the record.
  * @throws BufferUnderflowException if buffer not sufficient
  */
 public ConstructionEvent(final ByteBuffer buffer, final IRegistry<String> stringRegistry)
     throws BufferUnderflowException {
   super(buffer, stringRegistry);
   this.classSignature = stringRegistry.get(buffer.getInt());
   this.objectId = buffer.getInt();
 }