Skip to content

Commit 52ca2b6

Browse files
committed
twin graph persistent metric retention to downsampling retention duration
1 parent f18e94d commit 52ca2b6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

twingraph/src/main/kotlin/com/cosmotech/twingraph/metrics/TwinGraphMetrics.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import org.springframework.stereotype.Service
1212
import redis.clients.jedis.JedisPool
1313

1414
private const val SERVICE_NAME = "twingraph"
15+
private const val MILLISECONDS_IN_DAY = 86400000
1516

1617
@Service
1718
internal class TwinGraphMetrics(
@@ -41,7 +42,9 @@ internal class TwinGraphMetrics(
4142
"usage" to "licensing",
4243
),
4344
type = PersitentMetricType.GAUGE,
44-
)
45+
retention =
46+
csmPlatformProperties.metrics.downSamplingRetentionDays.toLong() *
47+
MILLISECONDS_IN_DAY)
4548
eventPublisher.publishEvent(PersistentMetricEvent(this, metric))
4649
}
4750
}

0 commit comments

Comments
 (0)