本文整理汇总了Java中com.neverwinterdp.util.text.TabularFormater类的典型用法代码示例。如果您正苦于以下问题:Java TabularFormater类的具体用法?Java TabularFormater怎么用?Java TabularFormater使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TabularFormater类属于com.neverwinterdp.util.text包,在下文中一共展示了TabularFormater类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: print
import com.neverwinterdp.util.text.TabularFormater; //导入依赖的package包/类
public void print(Monitor monitor) {
String[] header = {
"Method", "Count", "Response", "ClientLimitTimeout", "Timeout", "CloseChannelException", "ConnectionTimeoutException", "Unknown Error"
};
TabularFormater formater = new TabularFormater(header);
formater.setTitle("DemandSpike Monitor");
for (MethodMonitor sel : monitor.getRequestMonitors()) {
formater.addRow(
sel.getMethod(),
sel.getCount(),
sel.getResponseCount(),
sel.getClientLimitTimeoutCount(),
sel.getTimeoutExceptionCount(),
sel.getCloseChannelExceptionCount(),
sel.getConnectionTimeoutExceptionCount(),
sel.getUnknownErrorCount()
);
}
System.out.println(formater.getFormatText());
}
示例2: format
import com.neverwinterdp.util.text.TabularFormater; //导入依赖的package包/类
static public String format(String title, List<VMDescriptor> descriptors) throws Exception {
TabularFormater formater = new TabularFormater("ID", "Path", "Roles", "Cores", "Memory");
formater.setIndent(" ");
for(int i = 0; i < descriptors.size(); i++) {
VMDescriptor descriptor = descriptors.get(i) ;
formater.addRow(
descriptor.getId(),
descriptor.getStoredPath(),
StringUtil.join(descriptor.getVmConfig().getRoles(), ","),
descriptor.getCpuCores(),
descriptor.getMemory()
);
}
formater.setTitle(title);
return formater.getFormatText();
}
示例3: report
import com.neverwinterdp.util.text.TabularFormater; //导入依赖的package包/类
public void report(Appendable out) throws IOException {
String[] header = { "Name", "Value" };
TabularFormater reportFormater = new TabularFormater(header);
reportFormater.setTitle("Dataflow Test Report ");
reportFormater.addRow("Source", sourceGeneratorReport.getSourceName());
reportFormater.addRow(" Number Of Streams", sourceGeneratorReport.getNumberOfStreams());
reportFormater.addRow(" Write Count", sourceGeneratorReport.getWriteCount());
reportFormater.addRow(" Duration", sourceGeneratorReport.getDuration() + "ms");
reportFormater.addRow("Sink", sinkValidatorReport.getSinkName());
reportFormater.addRow(" Number Of Streams", sinkValidatorReport.getNumberOfStreams());
reportFormater.addRow(" Read", sinkValidatorReport.getReadCount());
reportFormater.addRow(" Duration", sinkValidatorReport.getDuration() + "ms");
out.append("\n");
out.append(reportFormater.getFormatText());
}
示例4: dump
import com.neverwinterdp.util.text.TabularFormater; //导入依赖的package包/类
public void dump(Appendable out, String title) throws IOException {
String[] header = {
"From", "To", "In Sequence", "Duplication"
};
TabularFormater formater = new TabularFormater(header);
formater.setTitle(title);
SequenceMap prevSeqMap = null;
for (int i = 0; i < map.size(); i++) {
SequenceMap seqMap = map.get(i);
boolean inSequence = true;
if (prevSeqMap != null) {
inSequence = prevSeqMap.getCurrent() + 1 == seqMap.getFrom();
}
Object[] cells = {
seqMap.getFrom(), seqMap.getCurrent(), inSequence, seqMap.getDuplicatedDescription()
};
formater.addRow(cells);
prevSeqMap = seqMap;
}
out.append(formater.getFormatText());
}
示例5: info
import com.neverwinterdp.util.text.TabularFormater; //导入依赖的package包/类
private void info(List<PartitionMetadata> holder) {
String[] header = {
"Partition Id", "Leader", "Replicas"
};
TabularFormater formater = new TabularFormater(header);
formater.setTitle("Partitions");
for(PartitionMetadata sel : holder) {
StringBuilder replicas = new StringBuilder();
for(Broker broker : sel.replicas()) {
if(replicas.length() > 0) replicas.append(",");
replicas.append(broker.port());
}
formater.addRow(sel.partitionId(), sel.leader().port(), replicas.toString());
}
System.out.println(formater.getFormatText());
}
示例6: TimerPrinter
import com.neverwinterdp.util.text.TabularFormater; //导入依赖的package包/类
public TimerPrinter() {
tformater = new TabularFormater(
"Name", "Count",
"Min", "Max", "Mean", "Std Dev",
"75%", "90%", "95%", "99%", "99.999",
"1 Min", "5 Min", "15 Min", "M Rate"
) ;
tformater.setTitle("Timer") ;
}
示例7: testAlgorithms
import com.neverwinterdp.util.text.TabularFormater; //导入依赖的package包/类
void testAlgorithms(String title, NumericDistribution dist) {
System.out.println("****************************************************************************");
System.out.println(title);
System.out.println("****************************************************************************");
dist.dumpBuckets();
long[] numberSet = dist.getNumericSet() ;
AlgorithmRunner qdigestRunner = new QDigestAlgorithmRunner() ;
qdigestRunner.run(numberSet);
qdigestRunner.printExecuteTime("QDigest");
AlgorithmRunner neverwinterdpQDigestRunner = new NeverwinterDPQDigestAlgorithmRunner() ;
neverwinterdpQDigestRunner.run(numberSet);
neverwinterdpQDigestRunner.printExecuteTime("NeverwinterDP QDigest");
AlgorithmRunner tdigestRunner = new TDigestAlgorithmRunner() ;
tdigestRunner.run(numberSet);
tdigestRunner.printExecuteTime("TDigest");
AlgorithmRunner codahaleRunner = new CodahaleReservoirAlgorithmRunner() ;
codahaleRunner.run(numberSet);
codahaleRunner.printExecuteTime("Codahale Reservoid");
TabularFormater tformater = new TabularFormater("Percentile", "QDigest", "N QDigest", "TDigest", "Codahale Reservoir", "Expect Value") ;
DecimalFormat pFormater = new DecimalFormat("#.00");
for(int i = 1; i <= 100; i++) {
double percent = (double)i/100 ;
tformater.addRow(
i + "%",
pFormater.format(qdigestRunner.getQuantile(percent)),
pFormater.format(neverwinterdpQDigestRunner.getQuantile(percent)),
pFormater.format(tdigestRunner.getQuantile(percent)),
pFormater.format(codahaleRunner.getQuantile(percent)),
dist.getValueByPercentile(percent)
);
}
System.out.println(tformater.getFormatText());
System.out.println("\n\n\n");
}
示例8: dumpBuckets
import com.neverwinterdp.util.text.TabularFormater; //导入依赖的package包/类
public void dumpBuckets() {
Bucket[] array = getSortBuckets();
DecimalFormat pFormater = new DecimalFormat("#.00");
TabularFormater tformater = new TabularFormater("#", "Value", "Frequency", "Percentile", "Acc Percentile") ;
for(int i = 0; i < array.length; i++) {
Bucket sel = array[i] ;
String percentile = pFormater.format(sel.getPercentile() * 100) + "%" ;
String accPercentile = pFormater.format(sel.accPercentile * 100) + "%" ;
tformater.addRow(i + 1, sel.getValue(), sel.getCount(), percentile, accPercentile);
}
System.out.println(tformater.getFormatText());
}
示例9: testCombination
import com.neverwinterdp.util.text.TabularFormater; //导入依赖的package包/类
@Test
public void testCombination() {
NumericDistribution dist = new NumericDistribution();
long[] set1 = dist.generate(1, 10, 60000) ;
QDigest qdigest1 = new QDigest(COMPRESSION_FACTOR);
qdigest1.offer(set1) ;
long[] set2 = dist.generate(1, 100, 40000) ;
QDigest qdigest2 = new QDigest(COMPRESSION_FACTOR);
qdigest2.offer(set2) ;
QDigest qdigestUnion = QDigest.unionOf(qdigest1, qdigest2) ;
dist.dumpBuckets();
TabularFormater tformater = new TabularFormater("Percentile", "QDigest Combined", "Expect Value") ;
DecimalFormat pFormater = new DecimalFormat("#.00");
for(int i = 1; i <= 100; i++) {
double percent = (double)i/100 ;
tformater.addRow(
i + "%",
pFormater.format(qdigestUnion.getQuantile(percent)),
dist.getValueByPercentile(percent)
);
}
System.out.println(tformater.getFormatText());
}
示例10: format
import com.neverwinterdp.util.text.TabularFormater; //导入依赖的package包/类
public String format(String title, String ident) {
TabularFormater formater = new TabularFormater("Name", "App Home", "Workers", "Executor Per Worker");
formater.setIndent(" ");
for (int i = 0; i < descriptors.size(); i++) {
DataflowDescriptor descriptor = descriptors.get(i);
formater.addRow(
descriptor.getName(),
descriptor.getDataflowAppHome(),
descriptor.getNumberOfWorkers(),
descriptor.getNumberOfExecutorsPerWorker()
);
}
formater.setTitle(title);
return formater.getFormatText();
}
示例11: print
import com.neverwinterdp.util.text.TabularFormater; //导入依赖的package包/类
public void print(Appendable out, String title) {
TabularFormater formater = new TabularFormater("Partition", "Read");
formater.setTitle(title + "(" + totalMessages + ")");
formater.setIndent(" ");
for (Map.Entry<Integer, Integer> entry : counters.entrySet()) {
formater.addRow(entry.getKey(), entry.getValue());
}
try {
out.append(formater.getFormatText()).append("\n");
} catch (IOException e) {
e.printStackTrace();
}
}
示例12: CounterPrinter
import com.neverwinterdp.util.text.TabularFormater; //导入依赖的package包/类
public CounterPrinter() {
tformater = new TabularFormater("Name", "Count") ;
tformater.setTitle("Counter") ;
}