/** * @param pipeline * @return load recorded by the pipeline */ long getLoad(MigratablePipeline pipeline) { return pipelineLoadCounter.get(pipeline); } }
/** * @param pipeline * @return load recorded by the pipeline */ long getLoad(MigratablePipeline pipeline) { return pipelineLoadCounter.get(pipeline); } }
private void appendSelectorInfo( NioThread minThread, Map<NioThread, Set<MigratablePipeline>> pipelinesPerOwner, StringBuilder sb) { Set<MigratablePipeline> pipelines = pipelinesPerOwner.get(minThread); for (MigratablePipeline pipeline : pipelines) { Long loadPerPipeline = pipelineLoadCount.get(pipeline); sb.append(pipeline) .append(": ") .append(loadPerPipeline) .append(LINE_SEPARATOR); } sb.append(LINE_SEPARATOR); } }
private void appendSelectorInfo( NioThread minThread, Map<NioThread, Set<MigratablePipeline>> pipelinesPerOwner, StringBuilder sb) { Set<MigratablePipeline> pipelines = pipelinesPerOwner.get(minThread); for (MigratablePipeline pipeline : pipelines) { Long loadPerPipeline = pipelineLoadCount.get(pipeline); sb.append(pipeline) .append(": ") .append(loadPerPipeline) .append(LINE_SEPARATOR); } sb.append(LINE_SEPARATOR); }
private void updateNewFinalImbalance() { imbalance.minimumLoad = Long.MAX_VALUE; imbalance.maximumLoad = Long.MIN_VALUE; imbalance.srcOwner = null; imbalance.dstOwner = null; for (NioThread owner : ioThreads) { long load = ownerLoad.get(owner); int pipelineCount = ownerToPipelines.get(owner).size(); if (load > imbalance.maximumLoad && pipelineCount > 1) { // if a nioThread has only 1 handle, there is no point in making it a source nioThread since // there is no pipeline that can be migrated anyway. In that case it is better to move on to // the next nioThread. imbalance.maximumLoad = load; imbalance.srcOwner = owner; } if (load < imbalance.minimumLoad) { imbalance.minimumLoad = load; imbalance.dstOwner = owner; } } }
private void updateNewFinalImbalance() { imbalance.minimumLoad = Long.MAX_VALUE; imbalance.maximumLoad = Long.MIN_VALUE; imbalance.srcOwner = null; imbalance.dstOwner = null; for (NioThread owner : ioThreads) { long load = ownerLoad.get(owner); int pipelineCount = ownerToPipelines.get(owner).size(); if (load > imbalance.maximumLoad && pipelineCount > 1) { // if a nioThread has only 1 handle, there is no point in making it a source nioThread since // there is no pipeline that can be migrated anyway. In that case it is better to move on to // the next nioThread. imbalance.maximumLoad = load; imbalance.srcOwner = owner; } if (load < imbalance.minimumLoad) { imbalance.minimumLoad = load; imbalance.dstOwner = owner; } } }
.append("------------") .append(LINE_SEPARATOR); Long loadPerOwner = ownerLoad.get(minThread); appendSelectorInfo(minThread, ownerToPipelines, sb); loadPerOwner = ownerLoad.get(maxThread); sb.append("Max NioThread ") .append(maxThread) loadPerOwner = ownerLoad.get(thread); sb.append("NioThread ") .append(thread)
.append("------------") .append(LINE_SEPARATOR); Long loadPerOwner = ownerLoad.get(minThread); appendSelectorInfo(minThread, ownerToPipelines, sb); loadPerOwner = ownerLoad.get(maxThread); sb.append("Max NioThread ") .append(maxThread) loadPerOwner = ownerLoad.get(thread); sb.append("NioThread ") .append(thread)
private void renderSamples(DiagnosticsLogWriter writer, int sampleCount) { writer.startSection("samples"); for (String key : occurrenceMap.keySet()) { long value = occurrenceMap.get(key); if (value == 0) { continue; } double percentage = (1d * value) / sampleCount; writer.writeEntry(key + " sampleCount=" + value + " " + defaultFormat.format(percentage)); } writer.endSection(); }
private void renderSamples(DiagnosticsLogWriter writer, int sampleCount) { writer.startSection("samples"); for (String key : occurrenceMap.keySet()) { long value = occurrenceMap.get(key); if (value == 0) { continue; } double percentage = (1d * value) / sampleCount; writer.writeEntry(key + " sampleCount=" + value + " " + defaultFormat.format(percentage)); } writer.endSection(); }
private void renderSamples(DiagnosticsLogWriter writer, int sampleCount) { writer.startSection("samples"); for (String key : occurrenceMap.keySet()) { long value = occurrenceMap.get(key); if (value == 0) { continue; } double percentage = (1d * value) / sampleCount; writer.writeEntry(key + " sampleCount=" + value + " " + defaultFormat.format(percentage)); } occurrenceMap.reset(); writer.endSection(); }
private void renderHistory(DiagnosticsLogWriter writer) { writer.startSection("History"); for (String item : occurrences.descendingKeys()) { writer.writeEntry(item + " samples=" + occurrences.get(item)); } writer.endSection(); }
private void renderSamples(DiagnosticsLogWriter writer, int sampleCount) { writer.startSection("samples"); for (String key : occurrenceMap.keySet()) { long value = occurrenceMap.get(key); if (value == 0) { continue; } double percentage = (1d * value) / sampleCount; writer.writeEntry(key + " sampleCount=" + value + " " + defaultFormat.format(percentage)); } occurrenceMap.reset(); writer.endSection(); }
private void renderSlowHistory(DiagnosticsLogWriter writer) { writer.startSection("SlowHistory"); for (String item : slowOccurrences.descendingKeys()) { writer.writeEntry(item + " samples=" + slowOccurrences.get(item)); } writer.endSection(); } }
private void renderInvocations(DiagnosticsLogWriter writer) { writer.startSection("invocations"); for (String op : occurrenceMap.keySet()) { long count = occurrenceMap.get(op); if (count < threshold) { continue; } writer.writeKeyValueEntry(op, count); } writer.endSection(); } }
private void renderSlowHistory(DiagnosticsLogWriter writer) { writer.startSection("SlowHistory"); for (String item : slowOccurrences.descendingKeys()) { writer.writeEntry(item + " samples=" + slowOccurrences.get(item)); } writer.endSection(); } }
private void renderHistory(DiagnosticsLogWriter writer) { writer.startSection("History"); for (String item : occurrences.descendingKeys()) { writer.writeEntry(item + " samples=" + occurrences.get(item)); } writer.endSection(); }
private void renderInvocations(DiagnosticsLogWriter writer) { writer.startSection("invocations"); for (String op : occurrenceMap.keySet()) { long count = occurrenceMap.get(op); if (count < threshold) { continue; } writer.writeKeyValueEntry(op, count); } writer.endSection(); } }
private void write(DiagnosticsLogWriter writer, String text, ItemCounter<String> samples) { writer.startSection(text); long total = samples.total(); for (String name : samples.descendingKeys()) { long s = samples.get(name); writer.writeKeyValueEntry(name, s + " " + (HUNDRED * s / total) + "%"); } writer.endSection(); }
private void write(DiagnosticsLogWriter writer, String text, ItemCounter<String> samples) { writer.startSection(text); long total = samples.total(); for (String name : samples.descendingKeys()) { long s = samples.get(name); writer.writeKeyValueEntry(name, s + " " + (HUNDRED * s / total) + "%"); } writer.endSection(); }