MCPcopy Create free account
hub / github.com/questdb/questdb / Telemetry

Method Telemetry

core/src/main/java/io/questdb/Telemetry.java:82–111  ·  view source on GitHub ↗
(TelemetryTypeBuilder<T> builder, CairoConfiguration configuration)

Source from the content-addressed store, hash-verified

80 private TableWriter writer;
81
82 public Telemetry(TelemetryTypeBuilder<T> builder, CairoConfiguration configuration) {
83 TelemetryType<T> type = builder.build(configuration);
84 final TelemetryConfiguration telemetryConfiguration = type.getTelemetryConfiguration(configuration);
85 enabled = telemetryConfiguration.getEnabled();
86 maxFileNameLen = configuration.getMaxFileNameLength();
87 if (enabled) {
88 telemetryType = type;
89 clock = configuration.getMicrosecondClock();
90 dbSizeEstimateTimeout = telemetryConfiguration.getDbSizeEstimateTimeout() * 1000;
91 telemetryQueue = new RingQueue<>(type.getTaskFactory(), telemetryConfiguration.getQueueCapacity());
92 telemetryPubSeq = new MPSequence(telemetryQueue.getCycle());
93 telemetrySubSeq = new SCSequence();
94 telemetryPubSeq.then(telemetrySubSeq).then(telemetryPubSeq);
95 ttlWeeks = telemetryConfiguration.getTtlWeeks();
96 ThrottleInterval = telemetryConfiguration.getThrottleIntervalMicros();
97 lastEventTimestamps = new IntLongHashMap();
98 taskConsumer = ThrottleInterval > 0 ? this::consumeThrottled : this::consumeDirect;
99 } else {
100 telemetryType = null;
101 clock = null;
102 dbSizeEstimateTimeout = 0;
103 telemetryQueue = null;
104 telemetryPubSeq = null;
105 telemetrySubSeq = null;
106 lastEventTimestamps = null;
107 ttlWeeks = 0;
108 ThrottleInterval = 0;
109 taskConsumer = null;
110 }
111 }
112
113 public void clear() {
114 if (writer != null) {

Callers

nothing calls this directly

Calls 12

getEnabledMethod · 0.95
getQueueCapacityMethod · 0.95
getTtlWeeksMethod · 0.95
getCycleMethod · 0.80
buildMethod · 0.65
getMaxFileNameLengthMethod · 0.65
getMicrosecondClockMethod · 0.65
getTaskFactoryMethod · 0.65
thenMethod · 0.65

Tested by

no test coverage detected