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

Fix code formatting #397

Merged
merged 1 commit into from
Nov 9, 2023
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
16 changes: 8 additions & 8 deletions _posts/2023-11-08-device-reliability-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,28 +235,28 @@ static uint32_t crash_free_hours = 0
static uint32_t operational_seconds = 0

void metrics_on_second__callback(void) {
time_without_crash++;
time_without_crash++;
if (time_without_crash >= 3600) {
crashfree_hours++
time_without_crash = 0
crashfree_hours++
time_without_crash = 0
}
}

void metrics_on_crash__callback(void) {
time_without_crash = 0;
time_without_crash = 0;
}

void metrics_on_shutdown__callback(void) {
// Since it's not a crash, we'll save
// the value for the next boot
persisted_time_without_crash = time_without_crash;
persisted_time_without_crash = time_without_crash;
}

void metrics_on_heartbeat__callback(void) {
heartbeat.operational_hours = floor(operational_seconds / 3600);
operational_seconds = operational_seconds % 3600;
heartbeat.operational_hours = floor(operational_seconds / 3600);
operational_seconds = operational_seconds % 3600;
heartbeat.crash_free_hours = crash_free_hours;
crash_free_hours = 0;
crash_free_hours = 0;

// serialize and send metrics
})
Expand Down