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
| package test; | |
| import static java.util.concurrent.TimeUnit.NANOSECONDS; | |
| import static org.openjdk.jmh.annotations.Mode.AverageTime; | |
| import org.openjdk.jmh.annotations.Benchmark; | |
| import org.openjdk.jmh.annotations.BenchmarkMode; | |
| import org.openjdk.jmh.annotations.Fork; | |
| import org.openjdk.jmh.annotations.Measurement; | |
| import org.openjdk.jmh.annotations.OutputTimeUnit; |
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
| init { | |
| with(containerFactory) { | |
| setAutoStartup(false) | |
| setContainerCustomizer { container: AbstractMessageListenerContainer<*, *> -> | |
| containerHolder = container | |
| } | |
| factoryHolder = consumerFactory | |
| } | |
| } |
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
| package ru.tinkoff.sme.tariffs.cucumber.test | |
| import org.openjdk.jmh.annotations.Benchmark | |
| import org.openjdk.jmh.annotations.BenchmarkMode | |
| import org.openjdk.jmh.annotations.Fork | |
| import org.openjdk.jmh.annotations.Measurement | |
| import org.openjdk.jmh.annotations.Mode.AverageTime | |
| import org.openjdk.jmh.annotations.Mode.Throughput | |
| import org.openjdk.jmh.annotations.OutputTimeUnit | |
| import org.openjdk.jmh.annotations.Scope.Thread |
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
| FROM openjdk:17.0.1-jdk-slim | |
| WORKDIR /opt/app | |
| COPY target/*.jar tictactoebot.jar | |
| ENTRYPOINT ["java","-jar","tictactoebot.jar"] |
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 static java.util.stream.Collectors.toList; | |
| import java.time.Duration; | |
| import java.util.Collections; | |
| import java.util.List; | |
| import java.util.stream.IntStream; | |
| class Scratch { | |
| public static void main(String[] args) { |
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
| // package my.code.cache.dao | |
| public class CacheEntity { | |
| String id; | |
| String jsonData; | |
| } | |
| public interface CacheEntityRepository { | |
| Optional<CacheEntity> findById(String id); |
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
| CREATE TABLE stats ( | |
| app varchar, | |
| event_timestamp timestamp | |
| additional_props jsonb | |
| ); |
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
| class Scratch { | |
| public static void main(String[] args) { | |
| System.out.println("Counter based rate limiter"); | |
| testLimiter(new CounterBasedSlidingWindowRateLimiter( | |
| 3L, | |
| 60L | |
| )); | |
| System.out.println("=============================="); | |
| System.out.println("Queue based rate limiter"); |
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
| openapi: '3.0.3' | |
| info: | |
| title: Rest kitty split | |
| version: 0.0.2 | |
| tags: | |
| - name: parties | |
| description: Методы для работы с коллекциями трат, объединенных в parties | |
| - name: participants | |
| description: Методы для работы с участниками | |
| - name: spendings |
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
| package com.example; | |
| import com.fasterxml.jackson.databind.ObjectMapper; | |
| import com.google.gson.Gson; | |
| import com.google.gson.GsonBuilder; | |
| import com.google.gson.TypeAdapter; | |
| import com.google.gson.annotations.SerializedName; | |
| import com.google.gson.stream.JsonReader; | |
| import com.google.gson.stream.JsonWriter; | |
| import com.sun.net.httpserver.HttpExchange; |
NewerOlder