This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT user, pid, client_addr, waiting, query, query_start, NOW() - query_start AS elapsed | |
| FROM pg_stat_activity | |
| WHERE query != '<IDLE>' | |
| -- AND EXTRACT(EPOCH FROM (NOW() - query_start)) > 1 | |
| ORDER BY elapsed DESC; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| data class GetBookQuery(val page: Int = 1, val limit: Int = 10): Query<BookDto?> | |
| class GetBookQueryHandler: QueryHandler<BookDto?, GetBookQuery> { | |
| override fun handle(query: GetBookQuery): BookDto { | |
| return BookDto("Dune") | |
| } | |
| override fun listenTo(): String = GetBookQuery::class.toString() | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import org.apache.avro.Schema; | |
| import org.apache.avro.generic.GenericData; | |
| import org.apache.avro.generic.GenericRecord; | |
| import org.apache.avro.reflect.ReflectData; | |
| import java.util.Arrays; | |
| public class GenericRecordFixtureFactory { | |
| public static GenericRecord createFromEvent(String siteId, String visitorId, String timestampMs) { | |
| EventMock eventMock = new EventMock(); |