Skip to content
This repository
  • 2 commits
  • 2 files changed
  • 0 comments
  • 1 contributor
14  pom.xml
@@ -54,12 +54,16 @@
54 54
       <artifactId>scala-library</artifactId>
55 55
       <version>${scala.version}</version>
56 56
     </dependency>
57  
-
58 57
     <dependency>
59  
-    <groupId>com.codahale</groupId>
60  
-    <artifactId>logula_${scala.version}</artifactId>
61  
-    <version>2.1.3</version>
62  
-  </dependency>
  58
+      <groupId>com.yammer.metrics</groupId>
  59
+      <artifactId>metrics-core</artifactId>
  60
+      <version>2.0.2</version>
  61
+    </dependency>
  62
+    <dependency>
  63
+      <groupId>com.codahale</groupId>
  64
+      <artifactId>logula_${scala.version}</artifactId>
  65
+      <version>2.1.3</version>
  66
+    </dependency>
63 67
     <dependency>
64 68
       <groupId>com.codahale</groupId>
65 69
       <artifactId>simplespec_2.8.1</artifactId>
15  src/main/scala/com/posterous/finatra/App.scala
@@ -17,13 +17,24 @@ import com.twitter.finagle.builder.{Server, ServerBuilder}
17 17
  */
18 18
 import com.codahale.logula.Logging
19 19
 import org.apache.log4j.Level
  20
+import com.yammer.metrics.Metrics
  21
+import com.yammer.metrics.core.Meter
  22
+import com.yammer.metrics.reporting.ConsoleReporter
  23
+import java.util.concurrent.TimeUnit
  24
+
20 25
 
21 26
 
22 27
 
23 28
 object App extends Logging {
24 29
 
25  
-  class FinatraService extends Service[Request, Response]{  
26  
-   def apply(request: Request) = {
  30
+ 
  31
+  class FinatraService extends Service[Request, Response] {  
  32
+
  33
+    val requests:Meter = Metrics.newMeter(this.getClass, "requests", "requests", TimeUnit.SECONDS);
  34
+    //ConsoleReporter.enable(1, TimeUnit.SECONDS)
  35
+    
  36
+    def apply(request: Request) = {
  37
+      requests.mark
27 38
       Router.dispatchAndReturn(request)
28 39
     }
29 40
   }

No commit comments for this range

Something went wrong with that request. Please try again.