# Class WatchBench

java.lang.Object
org.apache.zookeeper.server.watch.WatchBench

Functional Interface:
  This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

public class WatchBench extends Object

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static class`
`WatchBench.AddSparseWatchState`
`static class`
`WatchBench.InvocationState`
`static class`
`WatchBench.IterationState`
`static class`
`WatchBench.TriggerSparseWatchState`

## Constructor Summary

Constructors
Constructor
Description
`WatchBench()`

## Method Summary

Modifier and Type
Method
Description
`void`
`testAddConcentrateWatch(WatchBench.IterationState state)`
Test concenrate watch case where the watcher watches all paths.
`void`
`testAddSparseWatch(WatchBench.AddSparseWatchState state)`
Test sparse watch case where only one watcher watches all paths, and only one path being watched by all watchers.
`void`
`testTriggerConcentrateWatch(WatchBench.InvocationState state)`
Test trigger watches in concenrate case.
`void`
`testTriggerSparseWatch(WatchBench.TriggerSparseWatchState state)`
Test trigger watches in sparse case.

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### WatchBench

public WatchBench()

## Method Details

### testAddConcentrateWatch

public void testAddConcentrateWatch(WatchBench.IterationState state) throws Exception
Test concenrate watch case where the watcher watches all paths. The output of this test will be the average time used to add the watch to all paths.

Throws:
  `Exception`

### testTriggerConcentrateWatch

public void testTriggerConcentrateWatch(WatchBench.InvocationState state) throws Exception
Test trigger watches in concenrate case. The output of this test is the time used to trigger those watches on all paths.

Throws:
  `Exception`

### testAddSparseWatch

public void testAddSparseWatch(WatchBench.AddSparseWatchState state) throws Exception
Test sparse watch case where only one watcher watches all paths, and only one path being watched by all watchers. The output of this test will be the average time used to add those sparse watches.

Throws:
  `Exception`

### testTriggerSparseWatch

public void testTriggerSparseWatch(WatchBench.TriggerSparseWatchState state) throws Exception
Test trigger watches in sparse case. The output of this test is the time used to trigger those watches on all paths.

Throws:
  `Exception`