Skip to content

Commit

Permalink
Merge pull request #4685 from chimp1984/update-monitor-with-last-vers…
Browse files Browse the repository at this point in the history
…ion-from-freimairs-repo

Update monitor with last version from freimairs repo
  • Loading branch information
sqrrm authored Oct 22, 2020
2 parents 0e7070a + 9a018cc commit 380a57a
Show file tree
Hide file tree
Showing 19 changed files with 262 additions and 229 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
@Slf4j
public class AccountAgeWitnessStore extends PersistableNetworkPayloadStore<AccountAgeWitness> {

AccountAgeWitnessStore() {
public AccountAgeWitnessStore() {
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
@Slf4j
public class TradeStatistics3Store extends PersistableNetworkPayloadStore<TradeStatistics3> {

TradeStatistics3Store() {
public TradeStatistics3Store() {
}


Expand Down
8 changes: 5 additions & 3 deletions monitor/src/main/java/bisq/monitor/AvailableTor.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@

package bisq.monitor;

import java.io.File;
import org.berndpruenster.netlayer.tor.Tor;
import bisq.network.p2p.network.TorMode;

import org.berndpruenster.netlayer.tor.Tor;

import java.io.File;

/**
* This class uses an already defined Tor via <code>Tor.getDefault()</code>
*
*
* @author Florian Reimair
*
*/
Expand Down
8 changes: 4 additions & 4 deletions monitor/src/main/java/bisq/monitor/Metric.java
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,11 @@ public void run() {

// execute all the things
synchronized (this) {
log.info("{} started", getName());
execute();
log.info("{} done", getName());
log.info("{} started", getName());
execute();
log.info("{} done", getName());
}
} catch(Throwable e) {
} catch (Throwable e) {
log.error("A metric misbehaved!", e);
}
}
Expand Down
4 changes: 2 additions & 2 deletions monitor/src/main/java/bisq/monitor/OnionParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@

package bisq.monitor;

import bisq.network.p2p.NodeAddress;

import java.net.MalformedURLException;
import java.net.URL;

import bisq.network.p2p.NodeAddress;

/**
* Helper for parsing and pretty printing onion addresses.
*
Expand Down
6 changes: 5 additions & 1 deletion monitor/src/main/java/bisq/monitor/StatisticsHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@

package bisq.monitor;

import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.LongSummaryStatistics;
import java.util.Map;
import java.util.stream.Collectors;

/**
* Calculates average, max, min, p25, p50, p75 off of a list of samples and
Expand All @@ -31,7 +33,9 @@
*/
public class StatisticsHelper {

public static Map<String, String> process(List<Long> samples) {
public static Map<String, String> process(Collection<Long> input) {

List<Long> samples = input.stream().collect(Collectors.toList());

// aftermath
Collections.sort(samples);
Expand Down
2 changes: 1 addition & 1 deletion monitor/src/main/java/bisq/monitor/ThreadGate.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public void engage() {

/**
* Make everyone wait until the gate is open again.
*
*
* @param numberOfLocks how often the gate has to be unlocked until the gate
* opens.
*/
Expand Down
Loading

0 comments on commit 380a57a

Please sign in to comment.