"NOOPd" 对 micrometer.io 意味着什么?

What does "NOOPd" mean for micrometer.io?

阅读 3.1. Composite registries 时,我看到了:

Increments are NOOPd until there is a registry in the composite. The counter’s count will still yield 0 at this point.

NOOPd 是什么意思?

A NO-OP 是一段什么都不做的代码 ("no operation")。推而广之,"to NO-OP something" 意味着让它什么也不做。 "NO-OP'd"(此处拼写为 "NOOPd")是过去分词。也许 "disabled" 会更容易理解。

这意味着 compositeCounter.increment(); 在添加注册表之前什么都不做。在此之前,无论您调用 increment().

的频率如何,计数都将保持为 0

如示例所示:

CompositeMeterRegistry composite = new CompositeMeterRegistry();

Counter compositeCounter = composite.counter("counter");
compositeCounter.increment();  // (1)

SimpleMeterRegistry simple = new SimpleMeterRegistry();
composite.add(simple);  // (2)

compositeCounter.increment();  // (3)

在步骤 2 中添加注册表之前,步骤 1 中的 increment() 调用是 NO-OP。只有第 3 步实际递增计数器(从 01)。