Manoj
Manoj

Reputation: 390

What is the use of NiFi Counters?

I didn't find any documentation related to nifi counters.I Want to know how to use this feature and purpose of this feature.

Upvotes: 6

Views: 1881

Answers (1)

Bryan Bende
Bryan Bende

Reputation: 18660

Counters are a way for a processor to track how many times some event occurred, mostly for monitoring purposes. There is a method in the ProcessSession:

void adjustCounter(String name, long delta, boolean immediate);

So calling this method with ("myCounter", 1, true) would increment the count of "myCounter" by 1, or create the counter if it didn't exist. Counters are not persistent and will be reset on restart. An example is in the syslog processors which increment a counter for each syslog message received.

See discussion here:

https://community.hortonworks.com/questions/50622/apache-nifi-what-are-counters-in-nifi.html

Upvotes: 6

Related Questions