Skip to content

Commit

Permalink
Forked metric-apptuit from JInsight (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
rshivane authored Feb 27, 2018
1 parent c123c7a commit 7c3859e
Show file tree
Hide file tree
Showing 21 changed files with 94 additions and 1,959 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
*.iml
.idea/
target/
dependency-reduced-pom.xml
49 changes: 27 additions & 22 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,35 @@ env:
- METRICS_VERSION=3.2.6
- METRICS_VERSION=4.0.2

install:
- sudo apt-get -qq update
- sudo apt-get install -y xmlstarlet
jdk:
- oraclejdk8

services:
- memcached
- redis-server

addons:
sonarcloud:
organization: "$SONAR_ORG"
token:
secure: "$SONAR_TOKEN"

jdk:
- oraclejdk8
cache:
directories:
- '$HOME/.m2/repository'
- '$HOME/.sonar/cache'
- '$HOME/.codacy/reporter'

services:
- memcached
- redis-server
before_install:
- sudo apt-get install jq
- wget -O ~/.codacy/reporter/codacy-reporter-latest.jar $(curl https://api.github.com/repos/codacy/codacy-coverage-reporter/releases/latest | jq -r .assets[0].browser_download_url)

install:
- sudo apt-get -qq update
- sudo apt-get install -y xmlstarlet

before_script:
- if [[ "$METRICS_VERSION" = "3.2.6" ]]; then export IS_PRIMARY_MATRIX_JOB=true; fi
- xmlstarlet ed --inplace -u "/_:project/_:properties/_:metrics.version" -v "$METRICS_VERSION" pom.xml;
- SEMVER_REGEX="^v(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(\-[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?(\+[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?$"
- |
Expand All @@ -49,33 +60,27 @@ before_script:
fi
- echo $TRAVIS_TAG
- echo $PACKAGE_VERSION
- echo $IS_PRIMARY_MATRIX_JOB

script:
- |
if [[ "$SONAR_ENABLED" = "true" ]] && [[ "$TRAVIS_PULL_REQUEST" = "false" ]]; then
if [[ "$SONAR_ENABLED" = "true" ]] && [[ "$TRAVIS_PULL_REQUEST" = "false" ]] && [[ "$IS_PRIMARY_MATRIX_JOB" = "true" ]]; then
mvn verify sonar:sonar -Denv.server.ip=127.0.0.1
else
mvn verify -Denv.server.ip=127.0.0.1
fi
before_install:
- sudo apt-get install jq
- wget -O ~/.codacy/reporter/codacy-reporter-latest.jar $(curl https://api.github.com/repos/codacy/codacy-coverage-reporter/releases/latest | jq -r .assets[0].browser_download_url)

after_success:
- bash <(curl -s https://codecov.io/bash)
- java -cp ~/.codacy/reporter/codacy-reporter-latest.jar com.codacy.CodacyCoverageReporter -l Java -r target/site/jacoco/jacoco.xml
- |
if [[ "$IS_PRIMARY_MATRIX_JOB" = "true" ]]; then
bash <(curl -s https://codecov.io/bash);
java -cp ~/.codacy/reporter/codacy-reporter-latest.jar com.codacy.CodacyCoverageReporter -l Java -r target/site/jacoco/jacoco.xml;
fi
deploy:
- provider: script
script: "mvn -s .maven.settings.xml deploy -DskipTests"
skip_cleanup: true
on:
tags: true
condition: $PACKAGE_VERSION != "" && $METRICS_VERSION == "3.2.6" && $BINTRAY_API_KEY != ""

cache:
directories:
- '$HOME/.m2/repository'
- '$HOME/.sonar/cache'
- '$HOME/.codacy/reporter'
condition: $PACKAGE_VERSION != "" && $IS_PRIMARY_MATRIX_JOB == "true" && $BINTRAY_API_KEY != ""
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ Instrumenting a JVM with JInsight Java Agent is refreshingly simple:

Refer the **[Agent installation guide](https://github.com/ApptuitAI/JInsight/wiki/UsageJInsightAgent)** for detailed instructions.

If you want additional metrics specific to your application/workflows, beyond the [out-of-the-box metrics](https://github.com/ApptuitAI/JInsight/wiki/Metrics) provided by the agent, jinsight provides a rich toolkit to capture metrics from your code. Refer the **[API integration guide](https://github.com/ApptuitAI/JInsight/wiki/UsageDropwizard)** for help instrumenting your code with metrics.

If you want to programmatically capture metrics specific to your application/workflows, beyond the [out-of-the-box metrics](https://github.com/ApptuitAI/JInsight/wiki/Metrics) provided by the JInsight agent, we recommend using [Dropwizard Metrics](http://metrics.dropwizard.io/) library for it. The **[metrics-apptuit](https://github.com/ApptuitAI/metrics-apptuit/wiki/UsageDropwizard)** library can be used to push the metrics collected by Dropwizard to ApptuitAI.

## LICENSE

Expand Down
65 changes: 38 additions & 27 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ limitations under the License.
</repository>
</distributionManagement>

<repositories>
<repository>
<id>jinsight-bintray</id>
<url>https://dl.bintray.com/apptuitai/maven</url>
</repository>
</repositories>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down Expand Up @@ -89,10 +95,10 @@ limitations under the License.
<netty.version>4.1.15.Final</netty.version>
<surefire.version>2.20.1</surefire.version>
<junit.version>4.12</junit.version>
<powermock.version>1.7.3</powermock.version>
<jacoco.version>0.8.0</jacoco.version>
<byteman.version>3.0.11</byteman.version>
<metrics.version>3.2.6</metrics.version>
<apptuit.reporter.version>0.6.0</apptuit.reporter.version>

<!-- Acceptance Criteria -->
<enforce.code.style>false</enforce.code.style>
Expand All @@ -105,6 +111,11 @@ limitations under the License.
</properties>

<dependencies>
<dependency>
<groupId>ai.apptuit</groupId>
<artifactId>metrics-apptuit</artifactId>
<version>${apptuit.reporter.version}</version>
</dependency>
<dependency>
<groupId>org.jboss.byteman</groupId>
<artifactId>byteman</artifactId>
Expand All @@ -121,16 +132,12 @@ limitations under the License.
<artifactId>metrics-jvm</artifactId>
<version>${metrics.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-jdk14</artifactId>
<version>1.7.25</version>
</dependency>


<!--
BCI Testing related dependencies
-->

<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
Expand Down Expand Up @@ -230,24 +237,6 @@ limitations under the License.
<version>1.10.19</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito</artifactId>
<version>${powermock.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
<version>${powermock.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-testng</artifactId>
<version>${powermock.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jacoco</groupId>
<artifactId>org.jacoco.agent</artifactId>
Expand All @@ -274,10 +263,9 @@ limitations under the License.
<scope>test</scope>
</dependency>
</dependencies>
<build>

<build>
<plugins>

<!-- Plugins for post compile phase -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down Expand Up @@ -402,7 +390,27 @@ limitations under the License.
<artifactId>maven-shade-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
<createDependencyReducedPom>true</createDependencyReducedPom>
<keepDependenciesWithProvidedScope>true</keepDependenciesWithProvidedScope>
<promoteTransitiveDependencies>true</promoteTransitiveDependencies>
<relocations>
<relocation>
<pattern>com.codahale.metrics</pattern>
<shadedPattern>ai.apptuit.metrics.jinsight.relo.codahale</shadedPattern>
</relocation>
<relocation>
<pattern>org.slf4j</pattern>
<shadedPattern>ai.apptuit.metrics.jinsight.relo.slf4j</shadedPattern>
</relocation>
<relocation>
<pattern>ai.apptuit.metrics.client</pattern>
<shadedPattern>ai.apptuit.metrics.jinsight.relo.client</shadedPattern>
</relocation>
<relocation>
<pattern>ai.apptuit.metrics.dropwizard</pattern>
<shadedPattern>ai.apptuit.metrics.jinsight.relo.dwizreporter</shadedPattern>
</relocation>
</relocations>
</configuration>
<executions>
<execution>
Expand Down Expand Up @@ -497,6 +505,9 @@ limitations under the License.
<ignoreErrors>${ignore.license.checks}</ignoreErrors>
<reportStyle>xml</reportStyle>
<reportFile>${project.build.directory}/reports/license-check-results.xml</reportFile>
<excludes>
<exclude>${project.basedir}/dependency-reduced-pom.xml</exclude>
</excludes>
</configuration>
<executions>
<execution>
Expand Down
Loading

0 comments on commit 7c3859e

Please sign in to comment.