Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix typos in CompactionService #1980

Merged
merged 1 commit into from
Jun 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,20 @@ class AtCompactionService {
Future<AtCompactionStats> executeCompaction(AtLogType atLogType) async {
// Pre-compaction metrics
int numberOfKeysBeforeCompaction = atLogType.entriesCount();
int dataTimeBeforeCompactionInMills =
int dateTimeBeforeCompactionInMills =
DateTime.now().toUtc().millisecondsSinceEpoch;
// Run compaction
await executeCompactionInternal(atLogType);
// Post-compaction metrics
int dataTimeAfterCompactionInMills =
int dateTimeAfterCompactionInMills =
DateTime.now().toUtc().millisecondsSinceEpoch;
int numberOfKeysAfterCompaction = atLogType.entriesCount();
// Sets the metrics to AtCompactionStats
AtCompactionStats atCompactionStats = _generateStats(
atLogType,
dataTimeBeforeCompactionInMills,
dateTimeBeforeCompactionInMills,
numberOfKeysBeforeCompaction,
dataTimeAfterCompactionInMills,
dateTimeAfterCompactionInMills,
numberOfKeysAfterCompaction);
return atCompactionStats;
}
Expand All @@ -54,9 +54,9 @@ class AtCompactionService {

AtCompactionStats _generateStats(
AtLogType atLogType,
int dataTimeBeforeCompactionInMills,
int dateTimeBeforeCompactionInMills,
int numberOfKeysBeforeCompaction,
int dataTimeAfterCompactionInMills,
int dateTimeAfterCompactionInMills,
int numberOfKeysAfterCompaction) {
// Reset the compaction stats to clear the earlier stats metrics
_resetAtCompactionStats();
Expand All @@ -65,9 +65,9 @@ class AtCompactionService {
..preCompactionEntriesCount = numberOfKeysBeforeCompaction
..postCompactionEntriesCount = numberOfKeysAfterCompaction
..compactionDurationInMills =
DateTime.fromMillisecondsSinceEpoch(dataTimeAfterCompactionInMills)
DateTime.fromMillisecondsSinceEpoch(dateTimeAfterCompactionInMills)
.difference(DateTime.fromMillisecondsSinceEpoch(
dataTimeBeforeCompactionInMills))
dateTimeBeforeCompactionInMills))
.inMilliseconds
..deletedKeysCount =
(numberOfKeysBeforeCompaction - numberOfKeysAfterCompaction)
Expand Down