serviceutils.git
2 years agoConvert metrics-impl to OSGi Declarative Services
Robert Varga [Thu, 23 Jul 2020 11:42:54 +0000 (13:42 +0200)]
Convert metrics-impl to OSGi Declarative Services

Rather than going through hybrid generated and hand-written blueprint,
convert activation to OSGi DS, which handles both aspects.

Change-Id: I171e9356a77b00155adc10ac7d9215c4cdd80f85
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump odlparent to 7.0.3
Robert Varga [Wed, 10 Jun 2020 20:24:13 +0000 (22:24 +0200)]
Bump odlparent to 7.0.3

Pick up latest fixes from upstream.

Change-Id: Ia94adac077d56d048e636bd78e85c4fe312a7c5f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump odlparent to 7.0.2
Robert Varga [Sat, 30 May 2020 11:16:57 +0000 (13:16 +0200)]
Bump odlparent to 7.0.2

Pick up latest upgrades from upstream.

Change-Id: I6ba0b55a74b60624f49904be4aa78a243551b6c1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix error-prone reported warnings
Robert Varga [Sat, 30 May 2020 11:30:52 +0000 (13:30 +0200)]
Fix error-prone reported warnings

This cleans up the codebase more to EP's liking.

Change-Id: Iddcc67811bbf75724a4455cde5bf13ddf9d4d157
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump odlparent to 7.0.1
Robert Varga [Tue, 31 Mar 2020 14:38:57 +0000 (16:38 +0200)]
Bump odlparent to 7.0.1

Update odlparent in preparation for Aluminium MRI, also adopting
Guice dependency versions.

Some updates are needed around Truth, but since we are using only
primitive assert, adopt plain JUnit asserts as needed.

Change-Id: I74495579c8d9a7b867b4058d5f2430425d6b190e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix checkstyle
Robert Varga [Tue, 31 Mar 2020 15:00:20 +0000 (17:00 +0200)]
Fix checkstyle

Updated checkstyle is flushing this violation out.

Change-Id: I38fe8c19a6529528420184c693c89046ebe12e4e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoMigrate OSGi companion references
Robert Varga [Tue, 31 Mar 2020 14:42:40 +0000 (16:42 +0200)]
Migrate OSGi companion references

We are using OSGi R6, which has a different artifact providing
the same interfaces. Update references so they do not point to R5.

Change-Id: Ic7ba53794a406dcc53f35aafa70240e5c8bfa0b6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump versions by x.y.(z+1)
jenkins-releng [Sat, 22 Feb 2020 04:30:16 +0000 (04:30 +0000)]
Bump versions by x.y.(z+1)

Signed-off-by: jenkins-releng <jenkins-releng@opendaylight.org>
Change-Id: I0c4b15e27c85d09a29a9c2a150e10a3ca8a4de5a

2 years agoDeprecate Asserts for removal
Robert Varga [Thu, 16 Jan 2020 16:02:15 +0000 (17:02 +0100)]
Deprecate Asserts for removal

We have JUnit 4.13 integrated, which provides equivalent functionality.
Use it directly and deprecate the entire class.

Change-Id: I18e246400b045c89264d91fca6699de837a141b5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoUpdate odlparent to 6.0.4
Robert Varga [Thu, 16 Jan 2020 15:51:11 +0000 (16:51 +0100)]
Update odlparent to 6.0.4

This picks up latest updates.

Change-Id: I07249816ecd2d4252760151eba893a1761e22acb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRework immutables.org integration
Robert Varga [Fri, 22 Nov 2019 09:46:07 +0000 (10:46 +0100)]
Rework immutables.org integration

Rather than depending on the annotation processor, depend only
on the annotations -- the processor comes integrated in the javac
configuration in odlparent.

Change-Id: Icc84c207621fbdad44ef99a46a9bd13dde3d84e5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump to odlparent-6.0.3
Robert Varga [Fri, 22 Nov 2019 09:39:57 +0000 (10:39 +0100)]
Bump to odlparent-6.0.3

This picks up the latest upgrades.

Change-Id: I8359aa6a9326ce0264d6101cb8af490b0502fcf4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoDisable ThreadsWatcher by default
Robert Varga [Wed, 27 Nov 2019 12:06:34 +0000 (13:06 +0100)]
Disable ThreadsWatcher by default

Analyzing the JVM for deadlocks is a stop-the-world operation,
which can end up taking seconds to tens of seconds when the JVM
is heavily loaded. Disable this functionality by default, until
we can devise a better strategy for cutting off deadlock detection.

JIRA: INFRAUTILS-66
Change-Id: I7f3a74605ff7c62a0426d9e197064f382e20bf5f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoTolerate platforms without thread management
Robert Varga [Wed, 27 Nov 2019 11:57:35 +0000 (12:57 +0100)]
Tolerate platforms without thread management

ManagementFactory.getThreadMXBean() can legally return null,
make sure we handle it properly. Also cache the platform bean
so we do not end looking it up over and over again.

Change-Id: I50a1781a5f34abc136e6bfd7402a6985066e9cb0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoUse ByteArrayOutputStream.toString(Charset)
Robert Varga [Wed, 27 Nov 2019 11:43:22 +0000 (12:43 +0100)]
Use ByteArrayOutputStream.toString(Charset)

This is a faster version available in Java 10+, use it instead
of toString(String). Since we are in the area, remove unneeded
IOException throws/catch.

Change-Id: I074cc1a8db3479d423b537a6bc9925ff1b87de50
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix NPE when updating metrics configuration
Tomas Cere [Tue, 26 Nov 2019 11:35:25 +0000 (12:35 +0100)]
Fix NPE when updating metrics configuration

Incorrect brace nesting was causing NPE when updating config.

Change-Id: I762451984e628bdc9074926578e99318b666552c
Signed-off-by: Tomas Cere <tomas.cere@pantheon.tech>
2 years agoBump to odlparent-6.0.1
Robert Varga [Wed, 6 Nov 2019 14:08:23 +0000 (15:08 +0100)]
Bump to odlparent-6.0.1

This picks up latest upgrades and fixes.

Change-Id: I8db358b0af81394a561071d98bffea168dda47cc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump odlparent to 6.0.0
Robert Varga [Wed, 21 Aug 2019 12:11:54 +0000 (14:11 +0200)]
Bump odlparent to 6.0.0

This bumps odlparent to 6.0.0 as part of Magnesium MRI.

Change-Id: I19505dd80b832cd6ed8b68daf471d9e90d3dfdd2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump odlparent to 5.0.2
Robert Varga [Wed, 21 Aug 2019 12:11:23 +0000 (14:11 +0200)]
Bump odlparent to 5.0.2

This bumps odlparent to pick up latest references.

Change-Id: Ica16c98bd6eeeb2530bdc9cee4bb7f198e4a6ab0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix checkstyle
Robert Varga [Wed, 21 Aug 2019 12:31:36 +0000 (14:31 +0200)]
Fix checkstyle

These violations are caught by updated checkstyle, fix them up.

Change-Id: I082fbfe4998b88151b4cd39af2d6bbc7f027e0be
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump versions by x.y.(z+1)
jenkins-releng [Mon, 12 Aug 2019 16:14:12 +0000 (16:14 +0000)]
Bump versions by x.y.(z+1)

Signed-off-by: jenkins-releng <jenkins-releng@opendaylight.org>
Change-Id: Ib57798ae70c24d686e0ef66ca07aab01e94092d8

2 years agoBump odlparent to 5.0.1
Robert Varga [Thu, 18 Jul 2019 10:32:49 +0000 (12:32 +0200)]
Bump odlparent to 5.0.1

This picks up the latest upgrades.

Change-Id: If6006a94197839a9718cd5eae16b0a025913af93
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoEliminate use of jsr-305
Robert Varga [Sat, 29 Jun 2019 09:27:26 +0000 (11:27 +0200)]
Eliminate use of jsr-305

We are using a single @ThreadSafe annotation and a few @Nullable
annotations. Migrate the first to a comment and the others to JDT.

Change-Id: I7b42f6c39d1730567fa35273517c6c8483b79be4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoMigrate Threadswatcher use of infrautils APIs
Robert Varga [Sat, 13 Apr 2019 08:14:34 +0000 (10:14 +0200)]
Migrate Threadswatcher use of infrautils APIs

This fixes up references to deprecated utils methods.

Change-Id: I22d34b3a3c533e68d31c901b9a3fbe5cc397a882
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRemove JSR305 dependency from metrics-impl
Robert Varga [Sat, 13 Apr 2019 08:11:41 +0000 (10:11 +0200)]
Remove JSR305 dependency from metrics-impl

There is only a single reference, move it to JDT.

Change-Id: I562ea4a4b4c23388587757bd102c8c223b13ac91
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoUse @code instead of <tt>
Stephen Kitt [Tue, 30 Apr 2019 16:19:44 +0000 (18:19 +0200)]
Use @code instead of <tt>

<tt> breaks Javadocs, the Javadoc markup is {@code ...}.

Change-Id: Iee194acb06c1b01434af0525b3a750ca55bb3a26
Signed-off-by: Stephen Kitt <skitt@redhat.com>
2 years agoBump odlparent to 5.0.0
Robert Varga [Fri, 15 Mar 2019 15:31:14 +0000 (16:31 +0100)]
Bump odlparent to 5.0.0

This bumps the version to MRI, adding JSR305 dependencies where
needed.

Change-Id: I5d4ad0a4c31a31bd0ef36ab6adb2eade6c9fb0a0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix annotation positions
Robert Varga [Mon, 8 Apr 2019 15:40:40 +0000 (17:40 +0200)]
Fix annotation positions

errorprone is complaining a bit about non-TYPE_USE annotations
being in the wrong place. Fix up most of the violations, omitting
@Nullable, as that is pending migration to JDT, which will fix
those warnings.

Change-Id: I3a8f076f64192b675168af462656576f085a5522
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRemove post-odlparent-4.0.9 changes
Robert Varga [Fri, 15 Mar 2019 16:17:36 +0000 (17:17 +0100)]
Remove post-odlparent-4.0.9 changes

javax.annotation-api version is declared by odlparent, do not
repeat it here.

Change-Id: I88518900c7c79887e8fc74276b98f02bad3133ed
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump versions by x.y.(z+1)
jenkins-releng [Fri, 1 Feb 2019 13:06:29 +0000 (13:06 +0000)]
Bump versions by x.y.(z+1)

Change-Id: Iad90fad64275055fb499d8382227330d53df26a5
Signed-off-by: jenkins-releng <jenkins-releng@opendaylight.org>
2 years agoBump to odlparent 4.0.9
Stephen Kitt [Fri, 18 Jan 2019 15:32:48 +0000 (16:32 +0100)]
Bump to odlparent 4.0.9

Change-Id: I84a781c028b0ed9e9fb3b660ef8777c319c6d51b
Signed-off-by: Stephen Kitt <skitt@redhat.com>
2 years agoUse odl-dropwizard-metrics
Robert Varga [Thu, 10 Jan 2019 15:38:05 +0000 (16:38 +0100)]
Use odl-dropwizard-metrics

odlparent-4.0.8+ provides a dependency import and the corresponding
feature, use it instead of packaging our own.

Change-Id: Id42c3bbec8eee3a04432e5ad5fec37d0a316f628
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump to odlparent 4.0.8
Stephen Kitt [Wed, 9 Jan 2019 14:54:53 +0000 (15:54 +0100)]
Bump to odlparent 4.0.8

Change-Id: I788dc0ffa71b2728e1cdbd6650b60dd2952f1b87
Signed-off-by: Stephen Kitt <skitt@redhat.com>
2 years agoUse metrics-bom for versions
Robert Varga [Tue, 1 Jan 2019 21:46:47 +0000 (22:46 +0100)]
Use metrics-bom for versions

Rather than repeating versions, import metrics-bom to get all
versions declared to a consistent set. Also upgrades to version
4.0.5, with three patches:

https://github.com/dropwizard/metrics/releases/tag/v4.0.4
https://github.com/dropwizard/metrics/releases/tag/v4.0.5

Change-Id: I5520555540525f81ee865fda873429bd237a4122
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoAdd javax.annotation-api dependencies
Robert Varga [Thu, 3 Jan 2019 23:30:26 +0000 (00:30 +0100)]
Add javax.annotation-api dependencies

Java 11 is shipping without these, hence we need to add dependecies.

Change-Id: Ie99cc82c2c565e0539e03fdc5e64cf09d72731ab
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoCleanup dependency structure
Robert Varga [Thu, 3 Jan 2019 15:23:02 +0000 (16:23 +0100)]
Cleanup dependency structure

Our parent should import our artifacts, so we can freely refer
to them with proper versions and scope -- otherwise it is extremely
easy to leak things like infrautils-testutils to runtime.

Change-Id: I79bf9a04ec87d50e1434f317d926168980d71b69
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump odlparent to 4.0.7
Robert Varga [Tue, 1 Jan 2019 21:47:47 +0000 (22:47 +0100)]
Bump odlparent to 4.0.7

This fixes SFT/JDK11 compatibility.

Change-Id: Ibec02d9a65a7587633a423b0babc4e8fcbaf2655
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump to odlparent 4.0.5
Stephen Kitt [Fri, 21 Dec 2018 09:10:17 +0000 (10:10 +0100)]
Bump to odlparent 4.0.5

Change-Id: I2adeaf4ba7b3e0dac43a9685912eb9757b26ad29
Signed-off-by: Stephen Kitt <skitt@redhat.com>
2 years agoadd modernizer-maven-plugin to infrautils' parent
Michael Vorburger [Fri, 2 Feb 2018 00:54:04 +0000 (01:54 +0100)]
add modernizer-maven-plugin to infrautils' parent

see https://github.com/gaul/modernizer-maven-plugin

This change was prepared 9 months ago, and is now finally
ready to go in, following last week's release of modernizer-maven-plugin
with my https://github.com/gaul/modernizer-maven-plugin/pull/67.

Change-Id: Id85737d789efb7ee07c8c7a34bdac39d8a96e076
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
2 years agoBump odlparent to 4.0.2
Robert Varga [Mon, 6 Aug 2018 19:01:46 +0000 (21:01 +0200)]
Bump odlparent to 4.0.2

This bumps to Neon-targeted odlparent.

Change-Id: Id376a54639daf286aaef5486a9a82b6f762c5c3c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Signed-off-by: Stephen Kitt <skitt@redhat.com>
2 years agoexpose report() method in MetricsFileReporter
Michael Vorburger [Sun, 23 Sep 2018 11:48:40 +0000 (13:48 +0200)]
expose report() method in MetricsFileReporter

so that performance tests (e.g. etc'd) can dump Timer metrics.

Change-Id: I22fb8a7f8f1305bd4bbcba7f74b5faacb8e1c438
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
2 years agominor change in MetricsFileReporter
Michael Vorburger [Sun, 23 Sep 2018 11:41:41 +0000 (13:41 +0200)]
minor change in MetricsFileReporter

just move a line up, this should make no difference.  This is in
preparation of the refactoring in the next commit which moves part of
the report() method out into a new method.

Change-Id: If4912e0d7f9b0ac97fda65f56c5dffb12e608133
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
2 years agobump dropwizard.metrics from 4.0.2 to 4.0.3
Michael Vorburger [Tue, 4 Sep 2018 21:34:09 +0000 (23:34 +0200)]
bump dropwizard.metrics from 4.0.2 to 4.0.3

very minor bump; no details in release notes on
https://github.com/dropwizard/metrics/releases

Change-Id: I9850f5479eb1cbfd63fb6c28e3ff2776e827b3be
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
2 years agoPort to Blueprint annotations
Stephen Kitt [Mon, 3 Sep 2018 14:06:48 +0000 (16:06 +0200)]
Port to Blueprint annotations

Blueprint annotations are a perfect match for Blueprint features, and
avoid issues with Pax CDI annotations (including the removal of
@OsgiService and @OsgiServiceProvider in Pax CDI API 1.0.0).

Change-Id: Ic1642863d8c2c7189fd8f8dd0ce1f5ebff619080
Signed-off-by: Stephen Kitt <skitt@redhat.com>
2 years agoAvoid depending on immutables.value at runtime
Robert Varga [Tue, 7 Aug 2018 08:09:03 +0000 (10:09 +0200)]
Avoid depending on immutables.value at runtime

Change-Id: Ia399e0cf7b258d4760461ee5b5635f7e41343f33
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump versions by x.(y+1).z for next dev cycle
Anil Belur [Thu, 9 Aug 2018 12:40:15 +0000 (18:10 +0530)]
Bump versions by x.(y+1).z for next dev cycle

Change-Id: Iefeaa1909c4bcce65fac47f523e1f46c518ad8f3
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
2 years agoAdding coverage for MetricProvider
manojna v [Wed, 8 Aug 2018 08:28:18 +0000 (13:58 +0530)]
Adding coverage for MetricProvider

Change-Id: I3948497978ff639b76f6032c664b5d16ed162dfc
Signed-off-by: manojna v <manojna.vijayakrishna@ericsson.com>
2 years agoadd odl-infrautils-metrics-sample to docs
Michael Vorburger [Tue, 31 Jul 2018 08:58:29 +0000 (10:58 +0200)]
add odl-infrautils-metrics-sample to docs

Change-Id: I2795643ce73f17f5e64d0d6c09fca57ec6438af4
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
2 years agoAdd infrautils getting-started-guide
Faseela K [Sat, 21 Jul 2018 06:25:07 +0000 (11:55 +0530)]
Add infrautils getting-started-guide

based on https://wiki.opendaylight.org/view/Infrastructure_Utilities:Main

but removed:
* "Planned Features" section (because official documentation should cover only what's available, not dreams)
* architectural layer positioning in intro (because it's somewhat controversial, and not relevant to end users anyway)
* removed some "history" ('originally in') - look forward, not backward! ;-)

Change-Id: I7e5d88bf7f62d79e5abafef0045e3da0b53c8b64
Signed-off-by: Faseela K <faseela.k@ericsson.com>
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
2 years agoBump to odlparent 3.1.3
Stephen Kitt [Wed, 18 Jul 2018 16:06:39 +0000 (18:06 +0200)]
Bump to odlparent 3.1.3

Change-Id: I9b2c6f8a6b9f22c1bf64864c710f9767cc46c170
Signed-off-by: Stephen Kitt <skitt@redhat.com>
2 years agobump dropwizard.metrics from 3.2.5 to 4.0.2
Michael Vorburger [Thu, 24 May 2018 09:19:35 +0000 (11:19 +0200)]
bump dropwizard.metrics from 3.2.5 to 4.0.2

release notes on https://github.com/dropwizard/metrics/releases

see INFRAUTILS-40 for future next bump from 4.0.2 to 5.0.0 (or at least
4.1.0)

JIRA: INFRAUTILS-41
Change-Id: Icc7f3e02d8a42c4684f772c1fff8fed17471cf9b
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
2 years agoBump odlparent to 3.1.2
Stephen Kitt [Wed, 30 May 2018 13:43:31 +0000 (15:43 +0200)]
Bump odlparent to 3.1.2

Change-Id: Ib384fc3c04deef61b106751aac7a28791acbf8b7
Signed-off-by: Stephen Kitt <skitt@redhat.com>
2 years agoadd a Counter to MetricsExample, to demo not only Meter
Michael Vorburger [Tue, 20 Mar 2018 14:03:01 +0000 (15:03 +0100)]
add a Counter to MetricsExample, to demo not only Meter

Change-Id: I248739db4353e3a52663b18db331f8b93e53a8c5
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
2 years agobump Prometheus client libraries from 0.1.0 to 0.4.0
dependabot[bot] [Mon, 28 May 2018 17:18:24 +0000 (17:18 +0000)]
bump Prometheus client libraries from 0.1.0 to 0.4.0

Change-Id: Ib81527a5361355e4a8ee9a1559748f4b61f4a90d
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
2 years agoAdding additional label support for meters.
eaksahu [Wed, 9 May 2018 15:38:22 +0000 (21:08 +0530)]
Adding additional label support for meters.

Added additional function to MetricProvider factory class for creating
meters with 4 and 5 labels.

Change-Id: I5fa6a26b5fefec5dcb9a6e31c65e98b8ea0427f6
Signed-off-by: eaksahu <a.k.sahu@ericsson.com>
2 years agoBump to odlparent 3.1.0 and yangtools 2.0.3
Stephen Kitt [Thu, 22 Mar 2018 17:24:32 +0000 (18:24 +0100)]
Bump to odlparent 3.1.0 and yangtools 2.0.3

Change-Id: Ic40708ad8cc3f52111d0da6080e70331ed8f4dfc
Signed-off-by: Stephen Kitt <skitt@redhat.com>
2 years agoexpand meterWithOneDynamicLabel in MetricsExample with 2 keys, for demo
Michael Vorburger [Tue, 20 Mar 2018 14:23:52 +0000 (15:23 +0100)]
expand meterWithOneDynamicLabel in MetricsExample with 2 keys, for demo

Change-Id: Ia939226928c2322602857f5fb53cba0866ed7f02
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
2 years agofix PrometheusMetricProviderImpl bug related to labels
Michael Vorburger [Tue, 20 Mar 2018 21:15:49 +0000 (22:15 +0100)]
fix PrometheusMetricProviderImpl bug related to labels

Change-Id: Ib09e02b646254c99c4278757e4767672e3644a2d
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
2 years agoadd MetricsExampleTest
Michael Vorburger [Tue, 20 Mar 2018 14:20:46 +0000 (15:20 +0100)]
add MetricsExampleTest

just to make sure that the MetricsExample does not have any glaring bugs

Change-Id: I6b31b1d5011b05e48e46417e66e3baeedfa7cfd9
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
2 years agoremove meterWithTwoDynamicLabels from MetricsExample, to simplify
Michael Vorburger [Tue, 20 Mar 2018 14:12:31 +0000 (15:12 +0100)]
remove meterWithTwoDynamicLabels from MetricsExample, to simplify

Change-Id: I6998a9ef1512adbf95dfd42afe9f080fed603352
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
2 years agoadd Karaf features and what else is required for Prometheus metrics demo
Michael Vorburger [Mon, 19 Mar 2018 12:54:27 +0000 (13:54 +0100)]
add Karaf features and what else is required for Prometheus metrics demo

new odl-infrautils-metrics-sample & odl-infrautils-metrics-prometheus

This change has everything needed to be able to show it off in a fully
working demo under OSGi with Karaf.  (Before this, only the standalone
MetricsPrometheusExampleMain launcher was really usable.)

The PrometheusMetricProviderImpl class will probably see further
evolutions some day (depending on project's interest), but that can come
later.

Change-Id: I066068fcc75e7a0a4951139ad9b4164e893838ee
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
2 years agofix bugs in MetricProviderImpl re. re-using instead of new metric object
Michael Vorburger [Wed, 21 Mar 2018 01:10:37 +0000 (02:10 +0100)]
fix bugs in MetricProviderImpl re. re-using instead of new metric object

Change-Id: I877c6b40fafb861f3dc8aa1fccdd9bd2fc991d00
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
2 years agoClean up lambdas
Stephen Kitt [Fri, 16 Feb 2018 11:02:13 +0000 (12:02 +0100)]
Clean up lambdas

Use method references where appropriate, and expression lambdas
instead of single-expression lambdas or functional interface
declarations.

Change-Id: I2ee9e2f35f1e5b76132178f0d2bb36f057d0ee36
Signed-off-by: Stephen Kitt <skitt@redhat.com>
2 years agoFix a couple of thinkos in metrics Configuration
Stephen Kitt [Wed, 7 Mar 2018 11:14:09 +0000 (12:14 +0100)]
Fix a couple of thinkos in metrics Configuration

maxThreads ends up using setThreadsWatcherIntervalMS, and
maxThreadsMaxLogIntervalSecs ignores the provided value. This patch
fixes these.

Change-Id: I7374ecfe41519f0e263381c651fad6dd116e925c
Signed-off-by: Stephen Kitt <skitt@redhat.com>
2 years agoMetrics implementation based on http://Prometheus.io
Michael Vorburger [Wed, 24 Jan 2018 14:01:02 +0000 (15:01 +0100)]
Metrics implementation based on Prometheus.io

This does not yet include proper OSGi web integration with a web IT,
Configuration and required Karaf Feature work, but is a suitable "MVP"
for initial demos (e.g. for the ONS ODL DDF). More TBD in future
changes; that makes this series easier to review as well.

Change-Id: I7d18a413e5db71b1953529bf4103141fddf70649
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
2 years agomake new ThreadsWatcher log intervals configurable (and fix volatile)
Michael Vorburger [Wed, 28 Feb 2018 11:50:54 +0000 (12:50 +0100)]
make new ThreadsWatcher log intervals configurable (and fix volatile)

Change-Id: Id902b7e066ee9f31df83c64de2142562aaeb1f64
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
2 years agomake ThreadsWatcher log at fixed intervals, not continuously
Michael Vorburger [Wed, 28 Feb 2018 11:28:50 +0000 (12:28 +0100)]
make ThreadsWatcher log at fixed intervals, not continuously

yet let it still check at shorter intervals than it will log

because it's been observed that when we hit max threads or deadlock,
then as it is, it will log continuously like crazy, at the speed of the
intervals it checks (defaults to 500ms).  Increasing that interval to a
much larger value (say 1min) is a shame because that could then take a
longer time to find issues, or even miss them.  So that this does it can
keep checking frequently, but doesn't have to report and spew logs as
often.

The new max log intervals are hard-coded to 1min in this first change.

see https://lists.opendaylight.org/pipermail/infrautils-dev/2018-February/000596.html

Change-Id: I075d9789af7c091e67b75c390963e71351f60672
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
2 years agoUse new Map methods
Stephen Kitt [Fri, 16 Feb 2018 11:04:25 +0000 (12:04 +0100)]
Use new Map methods

computeIfAbsent() and forEach() allow some code simplification.

Change-Id: I233b91f36b33fab56c13636507a7bf68d3319c6e
Signed-off-by: Stephen Kitt <skitt@redhat.com>
2 years agoBump versions by x.(y+1).z for next dev cycle
Anil Belur [Mon, 26 Feb 2018 07:41:43 +0000 (17:41 +1000)]
Bump versions by x.(y+1).z for next dev cycle

Change-Id: I43d4438c6e1c8f4756cc9bfb08bb8d7b45fdade7
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
2 years agomake util, jobcoordinator and metrics null safe for analysis by NullAway
Michael Vorburger [Tue, 13 Feb 2018 13:41:00 +0000 (14:41 +0100)]
make util, jobcoordinator and metrics null safe for analysis by NullAway

see https://github.com/uber/NullAway

Change-Id: Ic4c85a7f80f5392c7e0856e3cd431ad838e66d1a
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
2 years agoAdd label support for Timer metric type.
Tarun Thakur [Tue, 13 Feb 2018 10:20:15 +0000 (15:50 +0530)]
Add label support for Timer metric type.

This patch is to add label support for timer metric type
in similar way to label support for Counter type in
https://git.opendaylight.org/gerrit/#/c/67812/

This will enable applications to create metric key with multiple labels key-value pairs.

Change-Id: I44b70f1465d2a7fd6b34d2d0f114c393f264be6a
Signed-off-by: Tarun Thakur <tarun.t@altencalsoftlabs.com>
2 years agomake metrics file reporter configurable by fileReporterIntervalSecs prop
K.V Suneelu Verma [Wed, 7 Feb 2018 04:57:31 +0000 (10:27 +0530)]
make metrics file reporter configurable by fileReporterIntervalSecs prop

A value of 0 on that new property means it's disabled; 0 is the default.

Change-Id: I7d2f3506941877a59fe3db949aba66ec47e9c7ce
Signed-off-by: K.V Suneelu Verma <k.v.suneelu.verma@ericsson.com>
2 years agoAdd label support for counter metric type
Tarun Thakur [Thu, 1 Feb 2018 11:26:55 +0000 (16:56 +0530)]
Add label support for counter metric type

This patch is to add label support for counter metric type
in similar way to label support for Meter type in
https://git.opendaylight.org/gerrit/#/c/67535/

This will enable applications to create metric key with multiple labels
key-value pairs.

Change-Id: I2928d1af90236f6347d0d143713f1dfde326a1d4
Signed-off-by: Tarun Thakur <tarun.t@altencalsoftlabs.com>
2 years agointroduce MetricDescriptor and add support for labels to metrics
Michael Vorburger [Wed, 24 Jan 2018 14:00:11 +0000 (15:00 +0100)]
introduce MetricDescriptor and add support for labels to metrics

something I meant to do anyway, but seeing the "magic Strings" used in
proposed new metrics usages I3a0f87ec3f60a207a56ec29eef5b28a22e3fd0c3
and Ib458d151ffed331ccd2b717ad3abef0ebecf3f80 and
I2a4edeeb9deb72de15b8e4b75adf225843c4ddfb underlines why we need
this rather sooner than later.

the current Codahale Dropwizard Metrics implementation ultimately just
turns it into a String after all.  The point of this is that a) that
String now has a uniform format for all such labels, instead of trusting
using applications to use one described in text (that never works), and
my upcoming alternative metrics implementation based on
http://Prometheus.io will have direct native support for labels, and
will be able to do fun stuff like aggregate metrics across these labels.

Change-Id: I0a8ff9ef1cc09b56c0a115e5ce043ece63fa969a
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
2 years agoMake metrics' threads deadlock watcher interval configurable
Michael Vorburger [Wed, 10 Jan 2018 12:54:25 +0000 (13:54 +0100)]
Make metrics' threads deadlock watcher interval configurable

I've manually locally tested that this works as intended.

Change-Id: I01aa244fe6ed9be64bbbfa2904c9841f8b3edc12
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
2 years agoINFRAUTILS-22: Detect when more than N threads, and log details
Michael Vorburger [Thu, 21 Dec 2017 03:25:46 +0000 (04:25 +0100)]
INFRAUTILS-22: Detect when more than N threads, and log details

Change-Id: I1262d19a81c3d0f976d01f2f524fd77cb6c4b588
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
2 years agoadd new TestMetricProviderImpl
Michael Vorburger [Thu, 25 Jan 2018 13:35:09 +0000 (14:35 +0100)]
add new TestMetricProviderImpl

required by JobCoordinatorTestModule in genius (see
I80e3f5b6e8a601345cd2fbae79f0de22d0fa0e7d) for jobcoordinator with
metrics (see I530d20946a80933b05371c5220def447be1ee5e6)

Change-Id: Ie90562c2f8205bab8817d370d077def9a3419d52
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
2 years agoReplace metrics.CloseableMetric with a more generic utils.Closeable
Michael Vorburger [Mon, 8 Jan 2018 22:52:52 +0000 (23:52 +0100)]
Replace metrics.CloseableMetric with a more generic utils.Closeable

as suggested by Tom in I76ce2e1600e8f99eb735aac4c29c423cc01c59ee review.

Change-Id: Iba7bda3f51594764c21ba8d4dd7dc69f824f5125
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
2 years agoMetricsFileReporter directory/ file prefix "metrics" instead "counters"
Michael Vorburger [Tue, 16 Jan 2018 23:28:55 +0000 (00:28 +0100)]
MetricsFileReporter directory/ file prefix "metrics" instead "counters"

Change-Id: I868835632fbccab2f318c329b45f8eb766d67554
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
2 years agoINFRAUTILS-21: Automatic deadlock detection logging
Michael Vorburger [Thu, 21 Dec 2017 03:09:27 +0000 (04:09 +0100)]
INFRAUTILS-21: Automatic deadlock detection logging

This will check every minute if there are any dead-locked threads,
and if there are then it will log details about them.

This can also be used to easily implement INFRAUTILS-22 now.

Change-Id: I936064b48a8df632d0f8c7f7ec3c2e6b01ede147
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
2 years agorename [Metrics]FileReporterTest and some other very minor changes
Michael Vorburger [Tue, 16 Jan 2018 23:15:24 +0000 (00:15 +0100)]
rename [Metrics]FileReporterTest and some other very minor changes

Change-Id: I2e23af179700d8f06e810d1c27eb3fbada8de508
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
2 years agoBetter JavaDoc for Meter and Counter
Michael Vorburger [Wed, 10 Jan 2018 15:50:44 +0000 (16:50 +0100)]
Better JavaDoc for Meter and Counter

to clarify for review I73bf730d0f0e2f96fa4a84ab471e18f33305360c

Change-Id: I02642b188a62489e3e7d108d0ce9099c7533bfea
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
2 years agoMetrics for JVM gauges
Michael Vorburger [Thu, 21 Dec 2017 02:05:59 +0000 (03:05 +0100)]
Metrics for JVM gauges

Change-Id: If4df62eb5f6136910ba03303fac6897684b55bc8
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
2 years agoadded metrics file reporter
K.V Suneelu Verma [Wed, 20 Dec 2017 10:08:25 +0000 (15:38 +0530)]
added metrics file reporter

This file reporter dumps the counters to local file at every 2 mins.
one file is created for every hour.
counter files are retained for one week .

This helps doing offline analysis of the counters.

Change-Id: I033aa8628de8bfee8cdca7da564eb45a8c567c52
Signed-off-by: K.V Suneelu Verma <k.v.suneelu.verma@ericsson.com>
2 years agoAdjust for odlparent 3
Stephen Kitt [Wed, 6 Dec 2017 12:39:33 +0000 (13:39 +0100)]
Adjust for odlparent 3

* Update Karaf dependencies.
* Update feature dependencies (odl-guava-23).

Change-Id: I56fc628b26d51a9b1342249f363142cf64282af7
Signed-off-by: Stephen Kitt <skitt@redhat.com>
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
2 years agoadd get() method to metrics Counter and Meter
Michael Vorburger [Tue, 9 Jan 2018 13:57:19 +0000 (14:57 +0100)]
add get() method to metrics Counter and Meter

because I realized while adapting the JobCoordinator to metrics in
I8620996d3be56d86c85f184057e1a23ae3119140 that for tests a get() does
have its uses, after all... ;-)

But it's really intended just for tests, and not other uses. So no plans
to, and IMHO in this API it would not make sense, to expose more like
e.g. via methods such as Dropwizard's getMeanRate() or
getFifteenMinuteRate() ... those are implementation details, which
application clients should never require - and with a future Prometheus
or Ceilometer instead of Dropwizard implementation the Java client of
such system would possibly not even expose that, as such aggregation
would happen inside such external metrics servers.

Timer intentionally has no get() as tests should never be needing that;
and it would be totally unreliable to test for that, anyway.

Change-Id: Ic02a483d2c33c3279369ccfa98362c6ad50892bc
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
2 years agoMetrics new API, decoupled from Dropwizard Codahale's
Michael Vorburger [Thu, 21 Dec 2017 00:47:21 +0000 (01:47 +0100)]
Metrics new API, decoupled from Dropwizard Codahale's

because I'm hoping, some fine day in 2019 when I have time (never?), to
provide an alternative implementation backed directly & natively by
http://Prometheus.io, as an alternative to Dropwizard Codahale's.

The new API mimics the original one closely (and it's trivial to switch
any code already using it..), minus any kind of "reporting" methods such
as getFiveMinuteRate() etc. That is fine because those methods should be
of no interest to applications who "provide" metrics - only to those who
want to report - which in this design should just be metrics.impl, via
Dropwizard's JMX and File etc. reporters, and in the future Prometheus.

While we're at it, we make the Meter, Counter & Timer close-able for
unregistration, and allow Timer to time using the Checked Callable and
Runnable, which is handy.

Change-Id: I76ce2e1600e8f99eb735aac4c29c423cc01c59ee
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
2 years agoMetricProvider now verifies that the ID has not already been used
Michael Vorburger [Wed, 20 Dec 2017 22:06:18 +0000 (23:06 +0100)]
MetricProvider now verifies that the ID has not already been used

This is important as it guarantees that an ODL application cannot "spy
on" or "steal" (and modify!) another one's metrics - they are
intentionally only accessible to the creator.

The initial JavaDoc already stated this, but it wasn't actually
implemented as documented there; now it is.

Change-Id: Ib207e28a29e09c4eadf68ac8566a4b4add007b6d
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
2 years agoSwitch metrics to use infrautils parent (w. error-prone, CPD & CP dupes)
Michael Vorburger [Mon, 20 Nov 2017 18:01:29 +0000 (19:01 +0100)]
Switch metrics to use infrautils parent (w. error-prone, CPD & CP dupes)

Change-Id: Ia35f1135aad8ceedc2440a7904bb6b108ddc1798
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
2 years agoMetrics Step 2: New Karaf feature etc. with an IT
Michael Vorburger [Tue, 14 Nov 2017 23:00:46 +0000 (00:00 +0100)]
Metrics Step 2: New Karaf feature etc. with an IT

Validation of the OSGi service registration, the new
odl-infrautils-metrics Karaf feature etc. is covered by an integration
test.

Background in https://jira.opendaylight.org/browse/INFRAUTILS-19

Change-Id: Iac4b6e6f89f1bc82a2a6978978730ecffd7df633
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
2 years agoMetrics Step 1: Basic infrautils.metrics API & Impl bundles outline
Michael Vorburger [Thu, 9 Nov 2017 01:06:03 +0000 (02:06 +0100)]
Metrics Step 1: Basic infrautils.metrics API & Impl bundles outline

Not yet usable as is, but for code review purposes intentionally going
to build this up step by step for folks to follow along more easily.

Next step after this: jobcoordinator-impl dependency to metrics-api,
first usage of metrics for JobCoordinatorMonitor, and correct OSGi
service registration, Karaf features etc. stuff.

Background in https://jira.opendaylight.org/browse/INFRAUTILS-19

Change-Id: Ia11f9973a018cfa392a35358a4467035ecf84e93
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
2 years agoInitial empty repository
Andrew Grimberg [Wed, 30 Mar 2016 19:06:49 +0000 (19:06 +0000)]
Initial empty repository

2 years agoBump versions by x.(y+1).z 56/97556/1
jenkins-releng [Tue, 21 Sep 2021 00:25:43 +0000 (00:25 +0000)]
Bump versions by x.(y+1).z

Signed-off-by: jenkins-releng <jenkins-releng@opendaylight.org>
Change-Id: Ifd5b62524fea85979e87b65f7852d1d395850340

2 years agoBump upstream versions 22/97522/1
Robert Varga [Sun, 19 Sep 2021 19:52:36 +0000 (21:52 +0200)]
Bump upstream versions

Adopt controller-4.0.3 et al.

Change-Id: Ie879429bae518da7e7cebed2e638b119dd548a2a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump upstream versions 28/97328/2
Robert Varga [Wed, 25 Aug 2021 14:09:24 +0000 (16:09 +0200)]
Bump upstream versions

Adopt controller-4.0.2 et al.

Change-Id: I6dbc86646a897016140d9a1412fefb72d4ccecb1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump upstream versions 87/97087/2
Robert Varga [Thu, 5 Aug 2021 18:56:22 +0000 (20:56 +0200)]
Bump upstream versions

Adopt controller-4.0.1 et al.

Change-Id: I5dc5fdb3fd6e5353eec6409919ff3db45a8ccaad
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoBump MRI upstreams 40/96440/5
Robert Varga [Mon, 7 Jun 2021 14:59:53 +0000 (16:59 +0200)]
Bump MRI upstreams

Adopt latest versions, namely;
- odlparent-9.0.2
- yangtools-7.0.3
- infrautils-2.0.2
- mdsal-8.0.0
- controller-4.0.0

Change-Id: I6cac0995eead2e27494a7e5f44feaa847b238a3b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoUxe GuicedEE javax.inject 42/96442/1
Robert Varga [Mon, 7 Jun 2021 15:03:59 +0000 (17:03 +0200)]
Uxe GuicedEE javax.inject

This is a proper JPMS module as well as a proper jar, use it instead
of tje old javax.inject thing.

Change-Id: I00da453d8ee51f2b37a4884d7a0d4b846d7b1b74
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoUse osgi.core R7 41/96441/1
Robert Varga [Mon, 7 Jun 2021 15:01:02 +0000 (17:01 +0200)]
Use osgi.core R7

The name of core artifact has changed, update it to pull in OSGi R7+.

Change-Id: If5d5671595b2143a346a2a9ab417749c9021e2b1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoBump MRI upstreams 67/95367/1
Robert Varga [Fri, 26 Feb 2021 10:00:46 +0000 (11:00 +0100)]
Bump MRI upstreams

Adopt following versions:
- odlparent-8.1.1
- infrautils-1.9.6
- yangtools-6.0.5
- mdsal-7.0.6
- controller-3.0.7

Change-Id: I2285fed3112cb2e9e9c2b8cefce637171c5a67b5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>