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

Method getTableCountClass

core/src/main/java/io/questdb/Telemetry.java:266–283  ·  view source on GitHub ↗
(CairoEngine engine)

Source from the content-addressed store, hash-verified

264 }
265
266 private static short getTableCountClass(CairoEngine engine) {
267 final long tableCount = engine.getTableTokenCount(false);
268 if (tableCount <= 10) { // 0 - 0-10 tables
269 return TelemetryEvent.SYSTEM_TABLE_COUNT_CLASS_BASE;
270 } else if (tableCount <= 25) { // 1 - 11-25 tables
271 return TelemetryEvent.SYSTEM_TABLE_COUNT_CLASS_BASE - 1;
272 } else if (tableCount <= 50) { // 2 - 26-50 tables
273 return TelemetryEvent.SYSTEM_TABLE_COUNT_CLASS_BASE - 2;
274 } else if (tableCount <= 100) { // 3 - 51-100 tables
275 return TelemetryEvent.SYSTEM_TABLE_COUNT_CLASS_BASE - 3;
276 } else if (tableCount <= 250) { // 4 - 101-250 tables
277 return TelemetryEvent.SYSTEM_TABLE_COUNT_CLASS_BASE - 4;
278 } else if (tableCount <= 1000) { // 5 - 251-1000 tables
279 return TelemetryEvent.SYSTEM_TABLE_COUNT_CLASS_BASE - 5;
280 }
281 // 6 - 1001+ tables
282 return TelemetryEvent.SYSTEM_TABLE_COUNT_CLASS_BASE - 6;
283 }
284
285 private void consumeDirect(T task) {
286 task.writeTo(writer, clock.getTicks());

Callers 1

initMethod · 0.95

Calls 1

getTableTokenCountMethod · 0.65

Tested by

no test coverage detected