Skip to content

Commit d48fa32

Browse files
authored
Merge branch 'master' into fix-col-top-replace-commit-merge
2 parents 08faaed + daf6d1c commit d48fa32

File tree

55 files changed

+838
-299
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+838
-299
lines changed

core/src/main/java/io/questdb/DefaultTelemetryConfiguration.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,16 @@ public int getQueueCapacity() {
4747
return 16;
4848
}
4949

50+
@Override
51+
public long getThrottleIntervalMicros() {
52+
return Micros.MINUTE_MICROS;
53+
}
54+
55+
@Override
56+
public int getTtlWeeks() {
57+
return 4;
58+
}
59+
5060
@Override
5161
public boolean hideTables() {
5262
return false;

core/src/main/java/io/questdb/PropServerConfiguration.java

Lines changed: 36 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -508,12 +508,9 @@ public class PropServerConfiguration implements ServerConfiguration {
508508
private final long systemWalWriterEventAppendPageSize;
509509
private final long systemWriterDataAppendPageSize;
510510
private final boolean tableTypeConversionEnabled;
511-
private final TelemetryConfiguration telemetryConfiguration = new PropTelemetryConfiguration();
511+
private final TelemetryConfiguration telemetryConfiguration;
512512
private final long telemetryDbSizeEstimateTimeout;
513513
private final boolean telemetryDisableCompletely;
514-
private final boolean telemetryEnabled;
515-
private final boolean telemetryHideTables;
516-
private final int telemetryQueueCapacity;
517514
private final CharSequence tempRenamePendingTablePrefix;
518515
private final int textAnalysisMaxLines;
519516
private final TextConfiguration textConfiguration = new PropTextConfiguration();
@@ -1647,11 +1644,17 @@ public PropServerConfiguration(
16471644
this.sqlWindowInitialRangeBufferSize = getInt(properties, env, PropertyKey.CAIRO_SQL_ANALYTIC_INITIAL_RANGE_BUFFER_SIZE, 32);
16481645
this.sqlTxnScoreboardEntryCount = Numbers.ceilPow2(getInt(properties, env, PropertyKey.CAIRO_O3_TXN_SCOREBOARD_ENTRY_COUNT, 16384));
16491646
this.latestByQueueCapacity = Numbers.ceilPow2(getInt(properties, env, PropertyKey.CAIRO_LATEST_ON_QUEUE_CAPACITY, 32));
1650-
this.telemetryEnabled = getBoolean(properties, env, PropertyKey.TELEMETRY_ENABLED, true);
1647+
1648+
// telemetry config
1649+
boolean telemetryEnabled = getBoolean(properties, env, PropertyKey.TELEMETRY_ENABLED, true);
16511650
this.telemetryDisableCompletely = getBoolean(properties, env, PropertyKey.TELEMETRY_DISABLE_COMPLETELY, false);
1652-
this.telemetryQueueCapacity = Numbers.ceilPow2(getInt(properties, env, PropertyKey.TELEMETRY_QUEUE_CAPACITY, 512));
1653-
this.telemetryHideTables = getBoolean(properties, env, PropertyKey.TELEMETRY_HIDE_TABLES, true);
1651+
int telemetryQueueCapacity = Numbers.ceilPow2(getInt(properties, env, PropertyKey.TELEMETRY_QUEUE_CAPACITY, 512));
1652+
boolean telemetryHideTables = getBoolean(properties, env, PropertyKey.TELEMETRY_HIDE_TABLES, true);
16541653
this.telemetryDbSizeEstimateTimeout = getMillis(properties, env, PropertyKey.TELEMETRY_DB_SIZE_ESTIMATE_TIMEOUT, Micros.SECOND_MILLIS);
1654+
int telemetryTableTTLWeeks = getInt(properties, env, PropertyKey.TELEMETRY_TABLE_TTL_WEEKS, 4);
1655+
long telemetryThrottleInterval = getMicros(properties, env, PropertyKey.TELEMETRY_EVENT_THROTTLE_INTERVAL, 60000000L);
1656+
this.telemetryConfiguration = new PropTelemetryConfiguration(telemetryEnabled, telemetryQueueCapacity, telemetryHideTables, telemetryTableTTLWeeks, telemetryThrottleInterval);
1657+
16551658
this.o3PartitionPurgeListCapacity = getInt(properties, env, PropertyKey.CAIRO_O3_PARTITION_PURGE_LIST_INITIAL_CAPACITY, 1);
16561659
this.ioURingEnabled = getBoolean(properties, env, PropertyKey.CAIRO_IO_URING_ENABLED, true);
16571660
this.cairoMaxCrashFiles = getInt(properties, env, PropertyKey.CAIRO_MAX_CRASH_FILES, 100);
@@ -6133,6 +6136,19 @@ public byte getRequiredAuthType() {
61336136
}
61346137

61356138
private class PropTelemetryConfiguration implements TelemetryConfiguration {
6139+
private final long ThrottleInterval;
6140+
private final Boolean enabled;
6141+
private final boolean hideTable;
6142+
private final int queueCapacity;
6143+
private final int ttlWeeks;
6144+
6145+
PropTelemetryConfiguration(boolean enabled, int queueCapacity, boolean hideTable, int ttlWeeks, long ThrottleInterval) {
6146+
this.enabled = enabled;
6147+
this.queueCapacity = queueCapacity;
6148+
this.hideTable = hideTable;
6149+
this.ttlWeeks = ttlWeeks;
6150+
this.ThrottleInterval = ThrottleInterval;
6151+
}
61366152

61376153
@Override
61386154
public long getDbSizeEstimateTimeout() {
@@ -6146,17 +6162,27 @@ public boolean getDisableCompletely() {
61466162

61476163
@Override
61486164
public boolean getEnabled() {
6149-
return telemetryEnabled;
6165+
return enabled;
61506166
}
61516167

61526168
@Override
61536169
public int getQueueCapacity() {
6154-
return telemetryQueueCapacity;
6170+
return queueCapacity;
6171+
}
6172+
6173+
@Override
6174+
public long getThrottleIntervalMicros() {
6175+
return ThrottleInterval;
6176+
}
6177+
6178+
@Override
6179+
public int getTtlWeeks() {
6180+
return ttlWeeks;
61556181
}
61566182

61576183
@Override
61586184
public boolean hideTables() {
6159-
return telemetryHideTables;
6185+
return hideTable;
61606186
}
61616187
}
61626188

core/src/main/java/io/questdb/PropertyKey.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,8 @@ public enum PropertyKey implements ConfigPropertyKey {
490490
TELEMETRY_DISABLE_COMPLETELY("telemetry.disable.completely"),
491491
TELEMETRY_QUEUE_CAPACITY("telemetry.queue.capacity"),
492492
TELEMETRY_HIDE_TABLES("telemetry.hide.tables"),
493+
TELEMETRY_TABLE_TTL_WEEKS("telemetry.table.ttl.weeks"),
494+
TELEMETRY_EVENT_THROTTLE_INTERVAL("telemetry.event.throttle.interval"),
493495
TELEMETRY_DB_SIZE_ESTIMATE_TIMEOUT("telemetry.db.size.estimate.timeout"),
494496
PG_UPDATE_CACHE_ENABLED("pg.update.cache.enabled"),
495497
PG_UPDATE_CACHE_BLOCK_COUNT("pg.update.cache.block.count"),

0 commit comments

Comments
 (0)