Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added three frequency levels for resource watching #6896

Closed
wants to merge 1 commit into from

Conversation

Projects
None yet
3 participants
@uboness
Copy link
Contributor

uboness commented Jul 16, 2014

It's now possible to register watchers along with a specified check frequency. There are three frequencies: low, medium, high. Each one is associated with a check interval that determines how frequent the watchers will check for changes and notify listeners if needed. By default, the intervals are 5s, 30s and 60s respectively, but they can also be customized in the settings. also:

  • Added the WatcherHandle construct by which one can stop it (remove it) and resume it (re add it). Also provides access to the watcher itself and the frequency by which it's checked
  • Changed the default frequency to 30 seconds interval (used to be 60 seconds). The only watcher that is currently effected by this is the script watcher (now auto-loading scripts will auto-load every 30 seconds if changed)

@uboness uboness added v2.0.0 labels Jul 16, 2014


public void resume() {
monitor.watchers.add(watcher);
}

This comment has been minimized.

Copy link
@jpountz

jpountz Jul 16, 2014

Contributor

Should there be sanity checks that you cannot resume a watcher that is already running (so that the watcher doesn't run twice).

This comment has been minimized.

Copy link
@jpountz

jpountz Jul 16, 2014

Contributor

Or maybe alternatively use a CopyOnWriteArraySet instead of a list

This comment has been minimized.

Copy link
@uboness

uboness Jul 17, 2014

Author Contributor

ooooooo... good one!

@jpountz

View changes

src/main/java/org/elasticsearch/watcher/ResourceWatcherService.java Outdated
/**
* Defaults to 30 seconds
*/
MEDIIUM(TimeValue.timeValueSeconds(30)),

This comment has been minimized.

Copy link
@jpountz

jpountz Jul 16, 2014

Contributor

s/MEDIIUM/MEDIUM/

/**
* Defaults to 60 seconds
*/
LOW(TimeValue.timeValueSeconds(60));

This comment has been minimized.

Copy link
@jpountz

jpountz Jul 16, 2014

Contributor

LOW doesn't seem much lower than MEDIUM? Maybe HIGH and LOW would be enough?

This comment has been minimized.

Copy link
@uboness

uboness Jul 17, 2014

Author Contributor

I think 3 levels should give enough flexibility (not sure about 2 levels though). We could lower MEDIUM a bit... maybe to 25 or 20?

Added three frequency levels for resource watching
 It's now possible to register watchers along with a specified check frequency. There are three frequencies: low, medium, high. Each one is associated with a check interval that determines how frequent the watchers will check for changes and notify listeners if needed. By default, the intervals are 5s, 30s and 60s respectively, but they can also be customized in the settings. also:

  - Added the WatcherHandle construct by which one can stop it (remove it) and resume it (re add it). Also provices access to the watchers itself and the frequency by which it's checked
  - Change the default frequency to 30 seconds interval (used to be 60 seconds). The only watcher that is currently effected by this is the script watcher (now auto-loading scripts will auto-load every 30 seconds if changed)
@jpountz

This comment has been minimized.

Copy link
Contributor

jpountz commented Jul 17, 2014

LGTM

@uboness uboness removed the review label Jul 17, 2014

@uboness

This comment has been minimized.

Copy link
Contributor Author

uboness commented Jul 17, 2014

closed by cc8f7dd

@uboness uboness closed this Jul 17, 2014

@uboness uboness deleted the uboness:enhance/resource_watcher branch Jul 19, 2014

@clintongormley clintongormley changed the title Added three frequency levels for resource watching Internal: Added three frequency levels for resource watching Sep 8, 2014

@clintongormley clintongormley changed the title Internal: Added three frequency levels for resource watching Added three frequency levels for resource watching Jun 7, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.