mirror of
https://github.com/aljazceru/lnd-manageJ.git
synced 2026-01-21 15:04:22 +01:00
use metrics library for spring integration
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package de.cotto.lndmanagej.controller;
|
||||
|
||||
import com.codahale.metrics.MetricRegistry;
|
||||
import de.cotto.lndmanagej.metrics.Metrics;
|
||||
import com.codahale.metrics.annotation.Timed;
|
||||
import de.cotto.lndmanagej.model.LocalOpenChannel;
|
||||
import de.cotto.lndmanagej.model.Pubkey;
|
||||
import de.cotto.lndmanagej.service.ChannelService;
|
||||
@@ -19,21 +18,18 @@ public class LegacyController {
|
||||
private static final String NEWLINE = "\n";
|
||||
private final NodeService nodeService;
|
||||
private final ChannelService channelService;
|
||||
private final Metrics metrics;
|
||||
|
||||
public LegacyController(
|
||||
NodeService nodeService,
|
||||
ChannelService channelService,
|
||||
Metrics metrics
|
||||
ChannelService channelService
|
||||
) {
|
||||
this.nodeService = nodeService;
|
||||
this.channelService = channelService;
|
||||
this.metrics = metrics;
|
||||
}
|
||||
|
||||
@Timed
|
||||
@GetMapping("/open-channels/pretty")
|
||||
public String getOpenChannelIdsPretty() {
|
||||
metrics.mark(MetricRegistry.name(getClass(), "getOpenChannelIdsPretty"));
|
||||
return channelService.getOpenChannels().stream()
|
||||
.sorted(Comparator.comparing(LocalOpenChannel::getId))
|
||||
.map(localOpenChannel -> {
|
||||
|
||||
Reference in New Issue
Block a user