From 8f90c6dead61ba507d2d8ba46a89024514fb7b58 Mon Sep 17 00:00:00 2001 From: Shashi Ranjan Date: Tue, 23 Jun 2015 17:51:17 -0700 Subject: [PATCH] updated readme --- README.md | 130 ++++++++++++++++++------------------------------------ 1 file changed, 42 insertions(+), 88 deletions(-) diff --git a/README.md b/README.md index 7aea3bb..bc7d1dc 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,31 @@ # Mashape Analytics Java Agent +> for more information on Mashape Analytics, please visit [apianalytics.com](https://www.apianalytics.com) -Java Agent to report HTTP traffic to [MashapeAPI Analytics](https://www.apianalytics.com/) using [API Log Format](https://github.com/Mashape/api-log-format/).Analytics Java Agent is a custom servlet filter which intercepts the request and response and sends it to API Analytics server asynchronously to generate analytics information. It needs a web container to run, to send data from a app running in Java SE environment please use our standalone proxy or use one of our data collection APIs. +## About +The agent is a custom servlet filter which intercepts the request and response and sends it to API Analytics server asynchronously to generate analytics information. It needs a web container to run, to send data from a app running in Java SE environment please use our standalone proxy or use one of our data collection APIs. -## Installation +## Dependencies - -### With Maven +- `javax.servlet-api-3.0.1` +- `jeromq-0.3.4` +- `gson-1.2.17` +- `log4j-1.2.17` +- `guava-14.0.1` + +### Testing Dependencies + +- `jmockit-1.7` +- `junit-4.12` +- `unirest-java-1.4.5` +- Jetty +*see [pom.xml](https://github.com/Mashape/analytics-agent-java/blob/master/pom.xml#L48-L117) for dependencies* + +## Installation + +### With Maven ```xml @@ -20,96 +37,27 @@ Java Agent to report HTTP traffic to [MashapeAPI Analytics](https://www.apianaly ### Without Maven +- Download the [jar](https://oss.sonatype.org/content/repositories/releases/com/mashape/analytics/agent/analytics-java-agent/) +- clone from [Github](https://github.com/Mashape/analytics-agent-java) - -Application depends on `javax.servlet-api-3.0.1`, `jeromq-0.3.4`, `gson-1.2.17`, `log4j-1.2.17` and `guava-14.0.1`. For testing it depends on `jmockit-1.7`, `junit-4.12`, `unirest-java-1.4.5` and embedded Jetty - -You can download the analytics jar from: -or clone the project from github: - -Dependencies - -```xml - - javax.servlet - javax.servlet-api - 3.0.1 - provided - - - org.zeromq - jeromq - 0.3.4 - - - guava - com.google.guava - jar - 14.0.1 - - - com.google.code.gson - gson - 2.3.1 - - - log4j - log4j - 1.2.17 - - - - - com.googlecode.jmockit - jmockit - 1.7 - test - - - junit - junit - 4.12 - test - - - org.eclipse.jetty - jetty-server - 9.3.0.M1 - test - - - org.eclipse.jetty - jetty-webapp - 9.3.0.M1 - test - - - com.mashape.unirest - unirest-java - 1.4.5 - test - -``` - - -## Configuration for Server +## Usage Filter has been tested on tomcat and should work with Jetty, Jboss and other servers supporting http servlet api. To use the filter you would need to add Analytics filter to web descriptor and set few VM arguments in the server. Add following arguments to the server - Property | Value - -------- | ------ - analytics.token | Api analytics token from https://analytics.mashape.com - analytics.socket.min |Minimum number of threads/sockets to opened for connection to analytics server, default is 10 - analytics.socket.max | Maximum number of threads/sockets allowed to live in pool, default is 20 - analytics.socket.keepalivetime | When the number of threads are greater than the min, this is the maximum time in second that excess idle threads will wait for new tasks before terminating. Default is 30 seconds. - analytics.queue.size | Size of the queue for holding the tasks of transferring data to analytics server, default is 100 - analytics.enabled.flag | Set it true to enable analytics - analytics.environment | Server environment name, default is a empty string - -Update web.xml on server +| Property | Value | Default | +| --------------------------------- | --------------------------------------------------------------------------------- | ------- | +| `analytics.token` | Mashape Analytics Access Token | `-` | +| `analytics.socket.min` | Minimum number of threads/sockets to opened for connection to analytics server | `10` | +| `analytics.socket.max` | Maximum number of threads/sockets allowed to live in pool | `20` | +| `analytics.socket.keepalivetime` | When the number of threads are greater than the min, this is the maximum time that excess idle threads will wait for new tasks before terminating | `-` | +| `analytics.queue.size` | Size of the queue for holding the tasks of transferring data to analytics server | `100` | +| `analytics.enabled.flag` | Set to `true` to enable analytics | `-` | +| `analytics.environment` | Server environment name | `""` | + +Update `web.xml`: ```xml @@ -121,7 +69,7 @@ Update web.xml on server analytics.server.port - 5000 + 5500 @@ -129,3 +77,9 @@ Update web.xml on server /* ``` + +## Copyright and license + +Copyright Mashape Inc, 2015. + +Licensed under [the MIT License](https://github.com/mashape/analytics-agent-java/blob/master/LICENSE) \ No newline at end of file