Permalink
Browse files

S4-130 fix metrics config for csv output

- also minor update for twitter-adapter s4r name in corresponding build file
  • Loading branch information...
1 parent 039c11f commit 2a5f92cbc514027930fe2f55ed25aff5d915c841 @matthieumorel matthieumorel committed Mar 15, 2013
@@ -106,10 +106,10 @@ private void init() {
} else {
String group1 = matcher.group(1);
- if ("csv".equals(group1)) {
- String outputDir = matcher.group(2);
- long period = Long.valueOf(matcher.group(3));
- TimeUnit timeUnit = TimeUnit.valueOf(matcher.group(4));
+ if (group1.startsWith("csv")) {
+ String outputDir = group1.substring("csv:".length());
+ long period = Long.valueOf(matcher.group(2));
+ TimeUnit timeUnit = TimeUnit.valueOf(matcher.group(3));
logger.info("Reporting metrics through csv files in directory [{}] with frequency of [{}] [{}]",
new String[] { outputDir, String.valueOf(period), timeUnit.name() });
CsvReporter.enable(new File(outputDir), period, timeUnit);
@@ -46,8 +46,6 @@ project.ext["archivesBaseName"] = "$project.name"
project.ext["distRootFolder"] = "$archivesBaseName-${-> version}"
-// Append the suffix 'SNAPSHOT' when the build is not for release.
-version = new Version(major: 0, minor: 0, bugfix: 0, isRelease: false)
group = 'org.apache.s4'
apply plugin: 'java'
@@ -31,7 +31,8 @@ The `s4.metrics.config` parameter enables periodic dumps of aggregated statistic
Examples:
# dump metrics to csv files to /path/to/directory every 10 seconds
- csv:file://path/to/directory:10:SECONDS
+ # (recommendation: use a clean directory)
+ csv:/path/to/directory:10:SECONDS
# dump metrics to the console every minute
console:1:MINUTES
@@ -47,12 +47,14 @@ Have a look at the code in these directories. You'll note that:
* Build and deploy twitter-counter app
./s4 s4r -b=`pwd`/test-apps/twitter-counter/build.gradle -appClass=org.apache.s4.example.twitter.TwitterCounterApp twitter-counter
+
./s4 deploy -appName=twitter-counter -c=cluster1 -s4r=`pwd`/test-apps/twitter-counter/build/libs/twitter-counter.s4r
-* Build and deploy twitter-adapter app. In this example, we don't directly specify the app class of the adapter, we use the deployment approach for apps (remember, the adapter is also an app). Notice that the twitter-adapter package also has a different naming scheme. [^1]
+* Build and deploy twitter-adapter app. In this example, we don't directly specify the app class of the adapter, we use the deployment approach for apps (remember, the adapter is also an app).
./s4 s4r -b=`pwd`/test-apps/twitter-adapter/build.gradle -appClass=org.apache.s4.example.twitter.TwitterInputAdapter twitter-adapter
- ./s4 deploy -appName=twitter-adapter -c=cluster2 -s4r=`pwd`/test-apps/twitter-adapter/build/libs/twitter-adapter-0.0.0-SNAPSHOT.s4r -p=s4.adapter.output.stream=RawStatus
+
+ ./s4 deploy -appName=twitter-adapter -c=cluster2 -s4r=`pwd`/test-apps/twitter-adapter/build/libs/twitter-adapter.s4r -p=s4.adapter.output.stream=RawStatus
* Observe the current 10 most popular topics in file TopNTopics.txt. The file gets updated at regular intervals, and only outputs topics with a minimum of 10 occurrences, so you may have to wait a little before the file is updated :
@@ -79,7 +81,3 @@ Last, the [javadoc](http://people.apache.org/~mmorel/apache-s4-0.6.0-incubating-
We hope this will help you start rapidly, and remember: we're happy to help!
----
-
-###Footnotes
-
-[^1]: Modifying the `build.gradle` script you can change several aspects of the build process. By default the name of the `s4r` package is the application name provided in the packaging step, but you can attach the version automatically as in this example.

0 comments on commit 2a5f92c

Please sign in to comment.