mirror of
https://github.com/mii443/prometheus-android-exporter.git
synced 2025-12-03 19:18:26 +00:00
remote unneceserry logs
This commit is contained in:
@@ -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")
|
|
||||||
}
|
|
||||||
launch {
|
|
||||||
// while(true){
|
|
||||||
// Log.v(TAG, "aaaaaaaaa")
|
|
||||||
// delay(500)
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
Log.v(TAG, "Prometheus server started.")
|
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){
|
||||||
|
|||||||
@@ -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)
|
|
||||||
try{
|
|
||||||
Log.v(TAG, "Starting prometheus server")
|
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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user