Skip to content

Instantly share code, notes, and snippets.

View FlorinAlexandru's full-sized avatar
🎉
Focusing

FlorinAlexandru

🎉
Focusing
View GitHub Profile
apiVersion: apps/v1
kind: Deployment
metadata:
name: debugger
labels:
app: debugger
spec:
replicas: 1
selector:
matchLabels:
@FlorinAlexandru
FlorinAlexandru / CpuMetricsService.java
Created June 15, 2023 20:13
Custom Micrometer metric to get the process CPU
package com.happypanda.custommetrics;
import com.sun.management.OperatingSystemMXBean;
import org.springframework.stereotype.Service;
import java.lang.management.ManagementFactory;
@Service
public class CpuMetricsService {
@FlorinAlexandru
FlorinAlexandru / ToxiproxyMongoApplicationTests.java
Created October 5, 2023 08:13
Integration test with Mongo database and Toxiproxy
@Testcontainers
@SpringBootTest(properties = {"spring.main.allow-bean-definition-overriding=true"})
class ToxiproxyMongoApplicationTests {
@Autowired
private PersonRepository personRepository;
private static final Network network = Network.newNetwork();
private static final DockerImageName dockerImageName = DockerImageName.parse("mongo:5.0.5")
@FlorinAlexandru
FlorinAlexandru / commands.txt
Last active January 1, 2024 21:04
Kafka docker compose with UI
docker-compose -f <path/to/kafkaDockerCompose.yml> up