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

Improve metrics filter #1193

Merged
merged 5 commits into from
Sep 15, 2017
Merged

Improve metrics filter #1193

merged 5 commits into from
Sep 15, 2017

Conversation

arteam
Copy link
Member

@arteam arteam commented Sep 15, 2017

Improvement to #1118.

  • Add explicit flag to control tracking filters

We should not guess whether to include filter metrics based on the
metric name. Since tracking of filter times is a new feature, it
should be enabled explicitly for users who want it. For other users,
the process of migrating to the new instrumented listener should be
backward-compatible.

  • Split contexts to several variables

To be more much more clear what event handlers do. Otherwise, they
reuse the common variable and the correct behaviour depends on the
sequence in which Jersey produces events.

  • Remove the superfluous method "key"

  • Make TimerRequestEventListener a static inner class
    So we its creation doesn't carry all fields of
    InstrumentedResourceMethodApplicationListener and we explicitly
    set fields its state.

  • Don't use a ClockProvider

Clock is already an abstraction over a tick represented by a long value,
so it seem superfluous to use a provided for a class which doesn't have
any state and doesn't change.

`Clock` is already an abstraction over a tick represented by a long value,
so it seem superfluous to use a provided for a class which doesn't have
any state and doesn't change.
So we its creation doesn't carry all fields of
`InstrumentedResourceMethodApplicationListener` and we explicitly
set fields its state.
To be more much more clear what event handlers do. Otherwise, they
reuse the common variable and the correct behaviour depends on the
sequence in which Jersey produces events.
We should not guess whether to include filter metrics based on the
metric name. Since tracking of filter times is a new feature, it
should be enabled explicitly for users who want it. For other users,
the process of migrating to the new instrumented listener should be
backward-compatible.
@arteam arteam added this to the 3.2.5 milestone Sep 15, 2017
@arteam arteam merged commit 497491b into 3.2-development Sep 15, 2017
@arteam arteam deleted the improve_metrics_filter branch September 15, 2017 07:58
arteam added a commit that referenced this pull request Sep 15, 2017
* Don't use a ClockProvider

`Clock` is already an abstraction over a tick represented by a long value,
so it seem superfluous to use a provided for a class which doesn't have
any state and doesn't change.

* Make TimerRequestEventListener a static inner class

So we its creation doesn't carry all fields of
`InstrumentedResourceMethodApplicationListener` and we explicitly
set fields its state.

* Remove the superfluous method "key"

* Split contexts to several variables

To be more much more clear what event handlers do. Otherwise, they
reuse the common variable and the correct behaviour depends on the
sequence in which Jersey produces events.

* Add explicit flag to control tracking filters

We should not guess whether to include filter metrics based on the
metric name. Since tracking of filter times is a new feature, it
should be enabled explicitly for users who want it. For other users,
the process of migrating to the new instrumented listener should be
backward-compatible.
@arteam arteam modified the milestones: 3.2.5, 4.0.0 Sep 15, 2017
@jplock jplock modified the milestones: 4.0.0, 3.2.5 Sep 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants