use of org.questdb.examples.support.Price in project questdb by bluestreak01.
the class SslReplicationServerMain method publishPrice.
private void publishPrice(JournalWriter<Price> writer, int count) throws JournalException {
long tZero = System.currentTimeMillis();
System.out.println("sending: " + tZero);
Price p = new Price();
for (int i = 0; i < count; i++) {
p.setTimestamp(tZero + i);
p.setNanos(System.nanoTime());
p.setSym(String.valueOf(i % 20));
p.setPrice(i * 1.04598 + i);
writer.append(p);
}
// commit triggers network publishing
writer.commit();
}
Aggregations