-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* [WIP] Micrometer metrics instrumentation This is a work-in-progress attempt at instrumenting the driver with Micrometer as an optional alternative metrics implementation to the existing internal one. * Bring it to life. * Update Micrometer metrics This update includes general improvements, refactorings and tests. * Make MetricsAdapter a supported, public api. - Set scope of micrometer to provided - Rename MetricsProvider to MetricsAdapter (it does not provide metrics, the driver does. It adapts the drivers metrics to something external) - Make it a public interface - Remove dependencies to other internal interfaces and classes (such as BoltServerAddress and the pool itself via ServerAddress and intsuppliers) - Reduce visibility of internal classes as much as possible - Make sure that adapters are not serialized - Apply the clock to the internal adapter (an oversight from the previous iteration) * Saving a file before commiting seems to be relevant. * Not messing up the file while saven even more so. * Make interfaces internal again, provide an enum to select the provider, use global registry by default. This change keeps the existing serialization feature of config correct. It will work for everyone just using micrometer as is with the global registry. if there is a need to select the registriy, we can work on that later. * Move micrometer-core optional tag to dependency declaration * Update Config javadoc and remove imports of internal metrics classes * Update withMetricsEnabled(boolean) implementation * Enable ConfigBuilder.withMetricsAdapter documentation * Update driver/src/main/java/org/neo4j/driver/ConnectionPoolMetrics.java Co-authored-by: Gerrit Meier <meistermeier@gmail.com> * Update ConnectionPoolMetrics documentation * Update MetricsAdapter documentation * Update formatting in ConfigTest * Update wording * Updated wording * Formatting * Update driver/src/main/java/org/neo4j/driver/internal/metrics/DevNullMetricsListener.java Co-authored-by: Gerrit Meier <meistermeier@gmail.com> * Update driver/src/main/java/org/neo4j/driver/internal/metrics/MicrometerConnectionPoolMetrics.java Co-authored-by: Gerrit Meier <meistermeier@gmail.com> * Fix compilation error * Update failing test * Fix GetConnectionPoolMetrics access * Delete redundant counters based on review feedback Co-authored-by: Tommy Ludwig <8924140+shakuzen@users.noreply.github.com> Co-authored-by: Gerrit Meier <meistermeier@gmail.com> Co-authored-by: Michael Simons <michael.simons@neo4j.com> Co-authored-by: Tommy Ludwig <8924140+shakuzen@users.noreply.github.com> Co-authored-by: Gerrit Meier <meistermeier@gmail.com> Co-authored-by: Michael Simons <michael.simons@neo4j.com>
- Loading branch information
1 parent
3edf0e2
commit 05eb4a3
Showing
47 changed files
with
1,861 additions
and
398 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* Copyright (c) "Neo4j" | ||
* Neo4j Sweden AB [http://neo4j.com] | ||
* | ||
* This file is part of Neo4j. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.neo4j.driver; | ||
|
||
/** | ||
* Defines which metrics consumer to use: Should metrics be consumed and exposed via driver's default consumer or provided with one of the external facades. | ||
*/ | ||
public enum MetricsAdapter | ||
{ | ||
/** | ||
* Disables metrics. | ||
*/ | ||
DEV_NULL, | ||
|
||
/** | ||
* Consumes and publishes metrics via the driver itself. | ||
*/ | ||
DEFAULT, | ||
|
||
/** | ||
* Consumes and publishes metrics via Micrometer. Ensure that Micrometer is on classpath when using this option. | ||
*/ | ||
MICROMETER | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.