adoptopenjdk:11-jre-hotspot
java.runtime.name: OpenJDK Runtime Environment
java.runtime.version: 11.0.11+9
java.vendor: AdoptOpenJDK
java.version: 11.0.11
java.vm.name: OpenJDK 64-Bit Server VM
java.vm.vendor: AdoptOpenJDK
java.vm.version: 11.0.11+9
This file contains 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 java.time.Duration; | |
import java.util.ArrayList; | |
import java.util.List; | |
import java.util.concurrent.*; | |
import java.util.concurrent.atomic.AtomicInteger; | |
public class ForkJoinPoolDemo { | |
private static final int SUBMISSIONS = 10; | |
private static final int FORKS = 24; | |
private static final int PARALLELISM = 5; |
This file contains 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 Jon Schneider | |
public class GaugeUpdateTrick { | |
public static void main(String[] args) { | |
AtomicLong lastCalculatedTime = new AtomicLong(0); | |
AtomicLong gaugeValue = new AtomicLong(0); | |
Gauge.builder("expensive", () -> { | |
long curr = System.nanoTime(); | |
return gaugeValue.updateAndGet(old -> | |
lastCalculatedTime.updateAndGet(ts -> curr - ts > 10_000 ? curr : ts) == curr ? 0L /* new */ : old); | |
}); |
This file contains 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 org.example; | |
import java.lang.management.ManagementFactory; | |
import java.lang.management.OperatingSystemMXBean; | |
import java.time.Instant; | |
import java.util.HashMap; | |
import java.util.Map; | |
import java.util.concurrent.ArrayBlockingQueue; | |
import java.util.concurrent.ExecutorService; | |
import java.util.concurrent.ForkJoinPool; |
- As a user, it is somewhat complex and quite puzzling using the API
- There are a lot of components
- The components are doing different things as I would expect based on their names
- I think it would worth a review and refactor to make it more usable.
GlobalMetricsProvider
- Based on its name, it should provide
Metrics
instances
- Based on its name, it should provide
- In fact, it provides two things neither of them are
Metrics
This file contains 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
{ | |
"status": "UP", | |
"components": { | |
"discoveryComposite": { | |
"status": "UP", | |
"components": { | |
"discoveryClient": { | |
"status": "UP", | |
"details": { | |
"services": [ |
4.0.0 org.springframework.boot spring-boot-starter-parent 2.4.2-SNAPSHOT
- Thinking Architecturally (book)
- Building Evolutionary Architectures (book)
- Should that be a Microservice? Keep These Six Factors in Mind (article)
- Distributed big balls of mud (article)
- Modular monoliths by Simon Brown (talk)
- git heatmap:
git log --pretty=format: --name-only | sort | uniq -c | sort -rg | head -10
- Getting Empirical about Refactoring (article)
- Turbulence (tool)
- CodeScene (tool)
This file contains 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
@Configuration | |
@EnableScheduling | |
@EnableBatchProcessing | |
public class BatchConfiguration { | |
@Bean | |
@StepScope | |
public ResourceReader reader( | |
@Value("...") String url, | |
@Value("...") int pageSize, | |
@Value("#{jobParameters['ResourceReader.index']}") int index) { |
NewerOlder