Skip to content

Instantly share code, notes, and snippets.

View qyf404's full-sized avatar

QiYifei qyf404

View GitHub Profile
@qyf404
qyf404 / Application.java
Last active January 22, 2020 10:04
给spring-boot 2.0的项目增加datadog监控
/**
* 这是个可选项, 用来添加一些自定义tag
*/
@Bean
public MeterRegistryCustomizer<MeterRegistry> metricsCommonTags(RcConfig rcConfig) {
return registry -> registry.config()
.commonTags("appname", "myapp",
"nodename", "007");
}
@qyf404
qyf404 / KafkaProducerTest.java
Created January 21, 2020 12:17 — forked from itzg/KafkaProducerTest.java
Using embedded Kafka in Spring Boot unit test
import static org.junit.Assert.assertThat;
import static org.springframework.kafka.test.hamcrest.KafkaMatchers.hasKey;
import static org.springframework.kafka.test.hamcrest.KafkaMatchers.hasValue;
import static org.springframework.kafka.test.utils.KafkaTestUtils.getSingleRecord;
import java.util.Map;
import org.apache.kafka.clients.consumer.Consumer;
import org.apache.kafka.clients.consumer.ConsumerConfig;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.apache.kafka.common.serialization.Deserializer;
@qyf404
qyf404 / KafkaProducerTest.java
Created January 21, 2020 12:17 — forked from itzg/KafkaProducerTest.java
Using embedded Kafka in Spring Boot unit test
import static org.junit.Assert.assertThat;
import static org.springframework.kafka.test.hamcrest.KafkaMatchers.hasKey;
import static org.springframework.kafka.test.hamcrest.KafkaMatchers.hasValue;
import static org.springframework.kafka.test.utils.KafkaTestUtils.getSingleRecord;
import java.util.Map;
import org.apache.kafka.clients.consumer.Consumer;
import org.apache.kafka.clients.consumer.ConsumerConfig;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.apache.kafka.common.serialization.Deserializer;
@qyf404
qyf404 / gitlab-ci.yml
Created March 3, 2018 14:09
Build the docker image by the gitlab ci
build_images:
stage: build_images
image: docker
services:
- docker:dind
variables:
DOCKER_DRIVER: overlay2
before_script:
- docker info
script:
@qyf404
qyf404 / docker-compose.yml
Last active March 1, 2018 03:41
up hadoop by docker
version: '2'
services:
namenode:
image: uhopper/hadoop-namenode:2.7.2
hostname: namenode
container_name: namenode
domainname: hadoop
ports:
- 50070:50070
volumes: