remote unneceserry logs

This commit is contained in:
Martin Ptáček
2023-05-31 22:45:44 +02:00
parent a6e3c228a4
commit f7dcd87548
2 changed files with 7 additions and 18 deletions

View File

@@ -52,27 +52,17 @@ class PromWorker(
var deferred = coroutineScope { var deferred = coroutineScope {
if(config.prometheusServerEnabled){ if(config.prometheusServerEnabled){
launch{ launch{
Log.v(TAG, "1")
PrometheusServer.start( PrometheusServer.start(
PrometheusServerConfig(config.prometheusServerPort, ::performScrape), PrometheusServerConfig(config.prometheusServerPort, ::performScrape),
) )
Log.v(TAG, "7") Log.v(TAG, "Prometheus server started.")
} }
launch {
// while(true){
// Log.v(TAG, "aaaaaaaaa")
// delay(500)
// }
}
Log.v(TAG, "Prometheus server started.")
} }
if(config.pushproxEnabled){ if(config.pushproxEnabled){
launch { launch {
} }
Log.v(TAG, "Pushprox client started.")
} }
if(config.remoteWriteEnabled){ if(config.remoteWriteEnabled){

View File

@@ -16,6 +16,7 @@ import kotlinx.coroutines.NonCancellable
import kotlinx.coroutines.delay import kotlinx.coroutines.delay
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext import kotlinx.coroutines.withContext
import kotlinx.coroutines.yield
private const val TAG = "PROMETHEUS_SERVER" private const val TAG = "PROMETHEUS_SERVER"
@@ -30,14 +31,13 @@ data class PrometheusServerConfig(
class PrometheusServer() { class PrometheusServer() {
companion object { companion object {
suspend fun start(config: PrometheusServerConfig) { suspend fun start(config: PrometheusServerConfig) {
val server = configureServer(config) Log.v(TAG, "Starting prometheus server")
try{
Log.v(TAG, "Starting prometheus server")
Log.v(TAG, "2") val server = configureServer(config)
try{
server.start() server.start()
Log.v(TAG, "5") delay(Long.MAX_VALUE)
delay(10000000L)
}finally { }finally {
withContext(NonCancellable){ withContext(NonCancellable){
Log.v(TAG, "3") Log.v(TAG, "3")
@@ -45,7 +45,6 @@ class PrometheusServer() {
Log.v(TAG, "4") Log.v(TAG, "4")
} }
} }
} }
private fun getLandingPage(): String { private fun getLandingPage(): String {