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 {
if(config.prometheusServerEnabled){
launch{
Log.v(TAG, "1")
PrometheusServer.start(
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){
launch {
}
Log.v(TAG, "Pushprox client started.")
}
if(config.remoteWriteEnabled){

View File

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