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

add support to delegate to spectator #445

Merged
merged 5 commits into from
May 10, 2018

Conversation

brharrington
Copy link
Contributor

This is a first stab at adding a hook that will allow
updates that go to standard Servo types to be forwarded
to a Spectator registry. In most cases the updates will
be sent as they happen, e.g., the basic counter will
increment the spectator counter internally. This avoids
delays or other data quality issues.

Because so much of Servo is based on static, the main
integration point is a static reference in
SpectatorContext. The default registry is a noop
implementation so it must be set as early as possible
in the application setup.

To minimize the compatibility issues the existing
Servo implementations were changed as little as possible.
Concerns:

  • Custom monitor implementations that get registered
    will currently get ignored. Will look into that later.
  • User defined functions registered as gauges will now
    get called more frequently. This might cause load issues
    if they perform expensive operations inline.

This is a first stab at adding a hook that will allow
updates that go to standard Servo types to be forwarded
to a Spectator registry. In most cases the updates will
be sent as they happen, e.g., the basic counter will
increment the spectator counter internally. This avoids
delays or other data quality issues.

Because so much of Servo is based on static, the main
integration point is a static reference in
SpectatorContext. The default registry is a noop
implementation so it must be set as early as possible
in the application setup.

To minimize the compatibility issues the existing
Servo implementations were changed as little as possible.
Concerns:

- Custom monitor implementations that get registered
  will currently get ignored. Will look into that later.
- User defined functions registered as gauges will now
  get called more frequently. This might cause load issues
  if they perform expensive operations inline.
@brharrington brharrington requested a review from dmuino May 10, 2018 04:56
@@ -0,0 +1,91 @@
package com.netflix.servo;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

License?

Not really sure how it was passing before, some of these were
from files I didn't modify.
This interface would allow us to detect when polling
whether or not the monitor type reports directly to
spectator or would need to be sent in separately.
@brharrington
Copy link
Contributor Author

Most recent test failure is:

Gradle suite > Gradle test > com.netflix.servo.monitor.StatsMonitorTest.testExpiration FAILED
    java.lang.AssertionError at StatsMonitorTest.java:42

Only on jdk8 build, looks like a flakey test to me.

@brharrington
Copy link
Contributor Author

brharrington commented May 10, 2018

Still need to add tests for:

  • Custom monitors
  • BucketTimer
  • ContextualCounter
  • ContextualTimer
  • StatsTimer
  • PeakRateCounter
  • MinGauge

Also updates StatsMonitor to have a `computeStats` method
to force the update without worrying about timing issues
in the tests.
Adds tests for ContentualCounter, ContextualTimer,
PeakRateCounter, and MinGauge. The PeakRateCounter
and MinGauge are examples of custom meters.
@dmuino dmuino merged commit d13c088 into Netflix:master May 10, 2018
@brharrington brharrington deleted the delegate-to-spectator branch May 10, 2018 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants