-
Notifications
You must be signed in to change notification settings - Fork 173
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
Orbit Metrics Round 2 #73
Merged
Merged
Changes from all commits
Commits
Show all changes
46 commits
Select commit
Hold shift + click to select a range
b4b03a5
Orbit Metrics
FieldFlux f915165
Basic Metrics Configuration. Only Slf4j is supported.
FieldFlux a045663
Graphite and Ganglia Reporter configs
bwjefft 9991b90
Graphite and Ganglia Reporter configs
FieldFlux 421df72
Merge branch 'metricsredux' of https://github.com/fieldflux/orbit int…
bwjefft fa2beab
Have the stage pass in the runtime Id for unique prefixing
FieldFlux 913d96d
Improved Graphite reporting
FieldFlux a1f5a4c
Moving Execution Metrics to getter methods due to limitation in
FieldFlux 021d672
Fixing a bug in ReporterConfig that would cause period time units to be
FieldFlux 8a2e52b
Cleaning up Metrics Manager and adding some warnings/exceptions
FieldFlux be6834b
Moving metrics out into its own module under util
FieldFlux c5f6bb8
Fixing POM to correctly reference orbit-parent
FieldFlux a8eb502
Added a Container Component so that metrics an be initialized if not …
FieldFlux f11b308
Added the ability to remove metrics from the registry.
FieldFlux db4c604
Orbit Metrics
FieldFlux cfa0ca0
Basic Metrics Configuration. Only Slf4j is supported.
FieldFlux b4804d1
Graphite and Ganglia Reporter configs
bwjefft 7b3cb64
Have the stage pass in the runtime Id for unique prefixing
FieldFlux 40a57e4
Improved Graphite reporting
FieldFlux b6580f1
Moving Execution Metrics to getter methods due to limitation in
FieldFlux 764c26d
Fixing a bug in ReporterConfig that would cause period time units to be
FieldFlux 2ab2664
Cleaning up Metrics Manager and adding some warnings/exceptions
FieldFlux b22a9a3
Moving metrics out into its own module under util
FieldFlux a7513cb
Fixing POM to correctly reference orbit-parent
FieldFlux 8962f81
Added a Container Component so that metrics an be initialized if not …
FieldFlux 58f00cc
Added the ability to remove metrics from the registry.
FieldFlux 5251fe9
Fixing compile error after merging in latest from master
bwjefft c9f1186
Removing runtime prefix generation in favour of config-based setting
bwjefft c24d4d4
Handle duplicate metric exception better
bwjefft 8c59f21
Fix metric name generation to use the correct class name
FieldFlux 61511cc
Merge branch 'metricsredux' of https://github.com/FieldFlux/orbit int…
FieldFlux d12493c
Fixing missed merge conflict.
FieldFlux edd7197
Unregister Execution metrics on Stage Shutdown
FieldFlux a60bbb1
Jmx Reporter
FieldFlux 5a5be5d
Delete .orig files introduced during branch merge
FieldFlux 26711cf
Move Stage Metrics deregistration to be the last thing during Stage
FieldFlux ba2901a
Added a Stage Extension for runtime metric registration and deregistr…
FieldFlux ee12c52
Remove unneeded interface
FieldFlux e660b27
Move Metric Name Sanitization into Metrics Manager to reduce mistakes...
FieldFlux f0fa6e1
Remove unintentional changes.
FieldFlux 3142bf4
Revert Commons POM
FieldFlux bfa3125
Sanitization Regex is now statically compiled and reused.
FieldFlux cf9956a
Fixing formatting
FieldFlux b48a9b9
Cleaning up some try catches
FieldFlux e9b8e61
Metric Scope is now controlled via an enum.
FieldFlux b6ef66f
adding missing copyright
FieldFlux File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!--~ | ||
Copyright (C) 2015 Electronic Arts Inc. All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions | ||
are met: | ||
|
||
1. Redistributions of source code must retain the above copyright | ||
notice, this list of conditions and the following disclaimer. | ||
2. Redistributions in binary form must reproduce the above copyright | ||
notice, this list of conditions and the following disclaimer in the | ||
documentation and/or other materials provided with the distribution. | ||
3. Neither the name of Electronic Arts, Inc. ("EA") nor the names of | ||
its contributors may be used to endorse or promote products derived | ||
from this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY ELECTRONIC ARTS AND ITS CONTRIBUTORS "AS IS" AND ANY | ||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL ELECTRONIC ARTS OR ITS CONTRIBUTORS BE LIABLE FOR ANY | ||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
--> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<parent> | ||
<groupId>com.ea.orbit</groupId> | ||
<artifactId>orbit-actors-parent</artifactId> | ||
<version>0.3.2-SNAPSHOT</version> | ||
<relativePath>../..</relativePath> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<name>Orbit Actors Extension: Metrics Support</name> | ||
<artifactId>orbit-actors-metrics</artifactId> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>com.ea.orbit</groupId> | ||
<artifactId>orbit-actors-core</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.ea.orbit</groupId> | ||
<artifactId>orbit-metrics</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
</dependencies> | ||
|
||
</project> |
82 changes: 82 additions & 0 deletions
82
...etrics/src/main/java/com/ea/orbit/actors/extensions/metrics/MetricsLifetimeExtension.java
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,82 @@ | ||
/* | ||
Copyright (C) 2015 Electronic Arts Inc. All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions | ||
are met: | ||
|
||
1. Redistributions of source code must retain the above copyright | ||
notice, this list of conditions and the following disclaimer. | ||
2. Redistributions in binary form must reproduce the above copyright | ||
notice, this list of conditions and the following disclaimer in the | ||
documentation and/or other materials provided with the distribution. | ||
3. Neither the name of Electronic Arts, Inc. ("EA") nor the names of | ||
its contributors may be used to endorse or promote products derived | ||
from this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY ELECTRONIC ARTS AND ITS CONTRIBUTORS "AS IS" AND ANY | ||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL ELECTRONIC ARTS OR ITS CONTRIBUTORS BE LIABLE FOR ANY | ||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
*/ | ||
|
||
package com.ea.orbit.actors.extensions.metrics; | ||
|
||
import com.ea.orbit.actors.extensions.LifetimeExtension; | ||
import com.ea.orbit.actors.runtime.AbstractActor; | ||
import com.ea.orbit.actors.runtime.ActorReference; | ||
import com.ea.orbit.concurrent.Task; | ||
import com.ea.orbit.metrics.MetricsManager; | ||
|
||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
/** | ||
* {@link MetricsLifetimeExtension} allows for automatic registration and deregistration of annotated Orbit Metrics | ||
* | ||
*/ | ||
public class MetricsLifetimeExtension implements LifetimeExtension | ||
{ | ||
private static final Logger logger = LoggerFactory.getLogger(MetricsLifetimeExtension.class); | ||
@Override | ||
public Task preActivation(AbstractActor actor) | ||
{ | ||
try | ||
{ | ||
String actorId = ActorReference.getId(ActorReference.from(actor)).toString(); | ||
MetricsManager.getInstance().registerExportedMetrics(actor, actorId); | ||
} | ||
catch(Exception ex) | ||
{ | ||
logger.error("Unexpected error while registering Actor Metrics for " + actor.getClass().getName() + ": " + ex.getMessage()); | ||
} | ||
finally | ||
{ | ||
return Task.done(); | ||
} | ||
} | ||
|
||
@Override | ||
public Task postDeactivation(final AbstractActor<?> actor) | ||
{ | ||
try | ||
{ | ||
String actorId = ActorReference.getId(ActorReference.from(actor)).toString(); | ||
MetricsManager.getInstance().unregisterExportedMetrics(actor, actorId); | ||
} | ||
catch(Exception ex) | ||
{ | ||
logger.error("Unexpected error while unregistering Actor Metrics for " + actor.getClass().getName() + ": " + ex.getMessage()); | ||
} | ||
finally | ||
{ | ||
return Task.done(); | ||
} | ||
} | ||
} |
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
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see above.