Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Hold off on Java 7 until the JDK for Mac ships.

Otherwise it's a massive complication to use the beta JDK for pushing just this module.
  • Loading branch information...
commit a12c1fa82aa29dc697ab8ed935725422ab391376 1 parent d34357a
Coda Hale authored October 18, 2011
52  metrics-java7/pom.xml
... ...
@@ -1,52 +0,0 @@
1  
-<?xml version="1.0" encoding="UTF-8"?>
2  
-<project xmlns="http://maven.apache.org/POM/4.0.0"
3  
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4  
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5  
-    <modelVersion>4.0.0</modelVersion>
6  
-
7  
-    <parent>
8  
-        <groupId>com.yammer.metrics</groupId>
9  
-        <artifactId>metrics-parent</artifactId>
10  
-        <version>2.0.0-BETA18-SNAPSHOT</version>
11  
-    </parent>
12  
-
13  
-    <groupId>com.yammer.metrics</groupId>
14  
-    <artifactId>metrics-java7</artifactId>
15  
-
16  
-    <properties>
17  
-        <java7.home>/Library/Java/JavaVirtualMachines/JDK 1.7.0 Developer Preview.jdk/Contents/Home</java7.home>
18  
-    </properties>
19  
-
20  
-    <dependencies>
21  
-        <dependency>
22  
-            <groupId>com.yammer.metrics</groupId>
23  
-            <artifactId>metrics-core</artifactId>
24  
-            <version>${project.version}</version>
25  
-        </dependency>
26  
-        <dependency>
27  
-            <groupId>org.hamcrest</groupId>
28  
-            <artifactId>hamcrest-all</artifactId>
29  
-            <version>1.1</version>
30  
-            <scope>test</scope>
31  
-        </dependency>
32  
-    </dependencies>
33  
-
34  
-    <build>
35  
-        <plugins>
36  
-            <plugin>
37  
-                <groupId>org.apache.maven.plugins</groupId>
38  
-                <artifactId>maven-compiler-plugin</artifactId>
39  
-                <version>2.3.2</version>
40  
-                <configuration>
41  
-                    <verbose>true</verbose>
42  
-                    <fork>true</fork>
43  
-                    <source>1.7</source>
44  
-                    <target>1.7</target>
45  
-                    <encoding>UTF-8</encoding>
46  
-                    <executable>${java7.home}/bin/javac</executable>
47  
-                    <compilerVersion>1.7</compilerVersion>
48  
-                </configuration>
49  
-            </plugin>
50  
-        </plugins>
51  
-    </build>
52  
-</project>
16  metrics-java7/src/main/java/com/yammer/metrics/core/Timer.java
... ...
@@ -1,16 +0,0 @@
1  
-package com.yammer.metrics.core;
2  
-
3  
-public class Timer extends TimerContext implements AutoCloseable {
4  
-    public static Timer time(TimerMetric timer) {
5  
-        return new Timer(timer);
6  
-    }
7  
-    
8  
-    public Timer(TimerMetric timer) {
9  
-        super(timer);
10  
-    }
11  
-
12  
-    @Override
13  
-    public void close() {
14  
-        stop();
15  
-    }
16  
-}
41  metrics-java7/src/test/java/com/yammer/metrics/core/tests/TimerTest.java
... ...
@@ -1,41 +0,0 @@
1  
-package com.yammer.metrics.core.tests;
2  
-
3  
-import com.yammer.metrics.core.MetricsRegistry;
4  
-import com.yammer.metrics.core.Timer;
5  
-import com.yammer.metrics.core.TimerMetric;
6  
-import org.junit.After;
7  
-import org.junit.Test;
8  
-
9  
-import java.util.concurrent.TimeUnit;
10  
-
11  
-import static org.hamcrest.Matchers.closeTo;
12  
-import static org.hamcrest.Matchers.is;
13  
-import static org.junit.Assert.assertThat;
14  
-
15  
-public class TimerTest {
16  
-    private final MetricsRegistry registry = new MetricsRegistry();
17  
-    private final TimerMetric timer = registry.newTimer(TimerTest.class,
18  
-                                                        "example",
19  
-                                                        TimeUnit.MILLISECONDS,
20  
-                                                        TimeUnit.SECONDS);
21  
-
22  
-    @After
23  
-    public void tearDown() throws Exception {
24  
-        registry.threadPools().shutdownThreadPools();
25  
-    }
26  
-
27  
-    @Test
28  
-    public void timesAnExecutionContext() throws Exception {
29  
-        try (@SuppressWarnings("unused") Timer t = Timer.time(timer)) {
30  
-            Thread.sleep(100);
31  
-        }
32  
-
33  
-        assertThat("the timer is updated",
34  
-                   timer.count(),
35  
-                   is(1L));
36  
-
37  
-        assertThat("the context is timed",
38  
-                   timer.min(),
39  
-                   is(closeTo(100, 1)));
40  
-    }
41  
-}
1  pom.xml
@@ -14,7 +14,6 @@
14 14
         <module>metrics-ehcache</module>
15 15
         <module>metrics-graphite</module>
16 16
         <module>metrics-guice</module>
17  
-        <module>metrics-java7</module>
18 17
         <module>metrics-jetty</module>
19 18
         <module>metrics-log4j</module>
20 19
         <module>metrics-logback</module>

0 notes on commit a12c1fa

Please sign in to comment.
Something went wrong with that request. Please try again.