improve logging

- log merged head stop
- add network name to label
- log only non-empty deltas of grpc upstreams changes
This commit is contained in:
a10zn8
2023-01-19 17:59:49 +04:00
parent 16f8121a46
commit a46b456a25
4 changed files with 6 additions and 3 deletions

View File

@@ -34,6 +34,7 @@ open class DynamicMergedHead(
override fun stop() {
super.stop()
log.info("Stop dynamic merged head for [$label]")
dynamicFlux.stop()
subscription?.dispose()
subscription = null

View File

@@ -48,7 +48,7 @@ open class EthereumMultistream(
private var head: DynamicMergedHead = DynamicMergedHead(
PriorityForkChoice(),
"ETH Multistream",
"ETH Multistream of ${chain.chainCode}",
headScheduler
)

View File

@@ -47,7 +47,7 @@ open class EthereumPosMultiStream(
private var head: DynamicMergedHead = DynamicMergedHead(
PriorityForkChoice(),
"ETH Pos Multistream",
"ETH Pos Multistream of ${chain.chainCode}",
headScheduler
)

View File

@@ -155,7 +155,9 @@ class GrpcUpstreams(
}.map {
UpstreamChangeEvent(it.key, known.remove(it.key)!!, UpstreamChangeEvent.ChangeType.REMOVED)
}
log.info("Finished processing of grpc upstream description for $id with content delta added [${added.map { it.chain }}] and removed [${removed.map { it.chain }}]")
if (removed.isNotEmpty() || added.isNotEmpty()) {
log.info("Finished processing of grpc upstream description for $id with content delta added ${added.map { it.chain }} and removed ${removed.map { it.chain }}")
}
return Flux.fromIterable(removed + added)
}