Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

trident metrics support. just expose underlying registerMetric storm …

…API.
  • Loading branch information...
commit fe3fa6ccd6796263b1f87a3759f62886d8d746c3 1 parent c177d09
Jason Jackson authored
View
2  project.clj
@@ -3,7 +3,7 @@
(do (println (str "ERROR: requires Leiningen 1.x but you are using " lein-version))
(System/exit 1)))
-(defproject storm "0.8.2-wip15"
+(defproject storm "0.8.2-wip16"
:source-path "src/clj"
:test-path "test/clj"
:java-source-path "src/jvm"
View
11 src/jvm/storm/trident/operation/TridentOperationContext.java
@@ -1,5 +1,6 @@
package storm.trident.operation;
+import backtype.storm.metric.api.*;
import backtype.storm.task.TopologyContext;
import backtype.storm.tuple.Fields;
import storm.trident.tuple.TridentTuple;
@@ -29,4 +30,14 @@ public int numPartitions() {
public int getPartitionIndex() {
return _topoContext.getThisTaskIndex();
}
+
+ public IMetric registerMetric(String name, IMetric metric, int timeBucketSizeInSecs) {
+ return _topoContext.registerMetric(name, metric, timeBucketSizeInSecs);
+ }
+ public IMetric registerMetric(String name, IReducer reducer, int timeBucketSizeInSecs) {
+ return _topoContext.registerMetric(name, new ReducedMetric(reducer), timeBucketSizeInSecs);
+ }
+ public IMetric registerMetric(String name, ICombiner combiner, int timeBucketSizeInSecs) {
+ return _topoContext.registerMetric(name, new CombinedMetric(combiner), timeBucketSizeInSecs);
+ }
}
Please sign in to comment.
Something went wrong with that request. Please try again.