Search in sources :

Example 1 with NanosecondClock

use of io.questdb.std.NanosecondClock in project questdb by bluestreak01.

the class TelemetryJob method appendConfigRow.

private void appendConfigRow(SqlCompiler compiler, TableWriter configWriter, Long256 id, boolean enabled) {
    TableWriter.Row row = configWriter.newRow();
    if (null == id) {
        final MicrosecondClock clock = compiler.getEngine().getConfiguration().getMicrosecondClock();
        final NanosecondClock nanosecondClock = compiler.getEngine().getConfiguration().getNanosecondClock();
        final long a = nanosecondClock.getTicks();
        final long b = clock.getTicks();
        row.putLong256(0, a, b, 0, 0);
        LOG.info().$("new instance [id=").$256(a, b, 0, 0).$(", enabled=").$(enabled).$(']').$();
    } else {
        row.putLong256(0, id);
    }
    row.putBool(1, enabled);
    row.putSym(2, configuration.getBuildInformation().getQuestDbVersion());
    row.putSym(3, System.getProperty(OS_NAME));
    String packageStr = System.getenv().get(QDB_PACKAGE);
    if (null != packageStr) {
        row.putSym(4, packageStr);
    }
    row.append();
    configWriter.commit();
}
Also used : MicrosecondClock(io.questdb.std.datetime.microtime.MicrosecondClock) TableWriter(io.questdb.cairo.TableWriter) NanosecondClock(io.questdb.std.NanosecondClock)

Aggregations

TableWriter (io.questdb.cairo.TableWriter)1 NanosecondClock (io.questdb.std.NanosecondClock)1 MicrosecondClock (io.questdb.std.datetime.microtime.MicrosecondClock)1