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

Method getCpuClass

core/src/main/java/io/questdb/Telemetry.java:232–247  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

230 }
231
232 private static short getCpuClass() {
233 final int cpus = Runtime.getRuntime().availableProcessors();
234 if (cpus <= 4) { // 0 - 1-4 cores
235 return TelemetryEvent.SYSTEM_CPU_CLASS_BASE;
236 } else if (cpus <= 8) { // 1 - 5-8 cores
237 return TelemetryEvent.SYSTEM_CPU_CLASS_BASE - 1;
238 } else if (cpus <= 16) { // 2 - 9-16 cores
239 return TelemetryEvent.SYSTEM_CPU_CLASS_BASE - 2;
240 } else if (cpus <= 32) { // 3 - 17-32 cores
241 return TelemetryEvent.SYSTEM_CPU_CLASS_BASE - 3;
242 } else if (cpus <= 64) { // 4 - 33-64 cores
243 return TelemetryEvent.SYSTEM_CPU_CLASS_BASE - 4;
244 }
245 // 5 - 65+ cores
246 return TelemetryEvent.SYSTEM_CPU_CLASS_BASE - 5;
247 }
248
249 private static short getEnvTypeClass() {
250 final int type = Os.getEnvironmentType();

Callers 1

initMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected