Skip to content

Commit dbcb6d7

Browse files
feat: SLO Hibernate
1 parent 0aec7ae commit dbcb6d7

File tree

2 files changed

+60
-3
lines changed

2 files changed

+60
-3
lines changed

slo/docker-compose.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,62 @@ services:
4646
- "3000:3000"
4747
networks:
4848
- monitor-net
49+
ydb:
50+
image: cr.yandex/yc/yandex-docker-local-ydb:latest
51+
container_name: ydb
52+
environment:
53+
- GRPC_TLS_PORT=2135
54+
- GRPC_PORT=2136
55+
- MON_PORT=8765
56+
- YDB_USE_IN_MEMORY_PDISKS=true
57+
- YDB_DEFAULT_LOG_LEVEL=NOTICE
58+
ports:
59+
- "2135:2135"
60+
- "2136:2136"
61+
- "8765:8765"
62+
volumes:
63+
- ../data/ydb_certs:/ydb_certs
64+
networks:
65+
- monitor-net
66+
67+
slo-create:
68+
build:
69+
dockerfile: ./Dockerfile
70+
args:
71+
- SRC_PATH=hibernate
72+
command:
73+
- 'create'
74+
- 'http://ydb:2136'
75+
- '/local'
76+
- '--table-name'
77+
- 'slo-dotnet'
78+
- '--min-partitions-count'
79+
- '6'
80+
- '--max-partitions-count'
81+
- '1000'
82+
- '--partition-size'
83+
- '1'
84+
- '--initial-data-count'
85+
- '1000'
86+
networks:
87+
- monitor-net
88+
depends_on:
89+
ydb:
90+
condition: service_healthy
91+
92+
slo-run:
93+
build:
94+
dockerfile: ./Dockerfile
95+
command:
96+
- 'run'
97+
- 'http://ydb:2136'
98+
- '/local'
99+
- '--prom-pgw'
100+
- 'http://prometheus-pushgateway:9091'
101+
- '--table-name'
102+
- 'slo-dotnet'
103+
networks:
104+
- monitor-net
105+
depends_on:
106+
slo-create:
107+
condition: service_completed_successfully

slo/hibernate/src/main/kotlin/tech/ydb/slo/hibernate/HibernateApplication.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class HibernateApplication : CommandLineRunner {
2020

2121
override fun run(vararg args: String) {
2222
val pushGateway = PushGateway.builder()
23-
.job("hibernate-slo")
23+
.job("slo")
2424
.address("prometheus-pushgateway:9091")
2525
.build()
2626

@@ -45,7 +45,6 @@ class HibernateApplication : CommandLineRunner {
4545
okCount.labelValues("read", "TODO", "hibernate").inc()
4646
} catch (e: Exception) {
4747
notOkCount.labelValues("read", "TODO", "hibernate").inc()
48-
println(e)
4948
}
5049
pushGateway.push()
5150
}
@@ -56,7 +55,6 @@ class HibernateApplication : CommandLineRunner {
5655
okCount.labelValues("write", "TODO", "hibernate").inc()
5756
} catch (e: Exception) {
5857
notOkCount.labelValues("write", "TODO", "hibernate").inc()
59-
println(e)
6058
}
6159
pushGateway.push()
6260
}

0 commit comments

Comments
 (0)