最近在阅读JUC源码的时候,由于多线程并发时情况比较复杂,所以源码中经常出现一些无限循环用于等待确保或是某些目的的完成,通常我一般无限循环都是用while(true),但是我发现在concurrent包中经常用for(;;)来实现。这让我产生了困惑,难道for(;;)会比while(true)性能更好一些吗?于是我决定自己分别编译比较一下。 我编写了如下的程序: public class Test2 { public void whileTest() { int i = 0; while (true) { i++; } } public
...继续阅读
(33)
The stdout filter plugin allows printing to the standard output the data flowed through the filter plugin, which can be very useful while debugging.
The plugin has no configuration parameters, is very simple to use.
Command Line $ bin/fluent-bit -i cpu -F stdout -m '*' -o null We have specified to gather CPU usage metrics and print them out in a human-readable way when they flow through the stdout plugin, setting -m '*'to print all the metrics.
Fluent Bit v1.8.0 * Copyright (C) 2019-2021 The Fluent Bit Authors * Copyright (C) 2015-2018 Treasure Data * Fluent Bit is a CNCF sub-project under th
...继续阅读
(24)