package com.github.arteam.jdbi3;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import org.jdbi.v3.sqlobject.customizer.Bind;
import org.jdbi.v3.sqlobject.locator.UseClasspathSqlLocator;
import org.jdbi.v3.sqlobject.statement.SqlQuery;
import org.jdbi.v3.stringtemplate4.UseStringTemplateSqlLocator;

import java.time.LocalDate;
import java.util.Optional;

@UseStringTemplateSqlLocator
public interface GameDao {

    @SqlQuery
    ImmutableList<Integer> findGameIds();

    @SqlQuery
    ImmutableSet<String> findAllUniqueHomeTeams();

    @SqlQuery
    Optional<Integer> findIdByTeamsAndDate(@Bind("home_team") String homeTeam,
                                           @Bind("visitor_team") String visitorTeam,
                                           @Bind("played_at") LocalDate date);

    @SqlQuery
    LocalDate getFirstPlayedSince(@Bind("up") LocalDate up);

    @SqlQuery
    Optional<LocalDate> getLastPlayedDateByTeams(@Bind("home_team") String homeTeam,
                                             @Bind("visitor_team") String visitorTeam);

    @SqlQuery
    Optional<String> findHomeTeamByGameId(@Bind("id") Optional<Integer> id);
}

@@ -27,16 +27,62 @@
 jdbi3;%0A%0A
+import com.codahale.metrics.annotation.Timed;%0A
 import c
@@ -218,69 +218,8 @@
 nd;%0A
-import org.jdbi.v3.sqlobject.locator.UseClasspathSqlLocator;%0A
 impo
@@ -904,32 +904,69 @@
 %0A%0A    @SqlQuery%0A
+    @Timed(name = %22get-last-played%22)%0A
     Optional%3CLoc
@@ -1026,32 +1026,36 @@
 tring homeTeam,%0A
+    
                 

Add some `@Timed` annotations