Emit "time" measure and millisecond values for freshness check diagnostics#2760
Open
m1n0 wants to merge 1 commit into
Open
Emit "time" measure and millisecond values for freshness check diagnostics#2760m1n0 wants to merge 1 commit into
m1n0 wants to merge 1 commit into
Conversation
V4 contract-scan freshness checks sent their value in the configured unit (hours/days) with no measure marker, so Soda Cloud rendered a raw float instead of a human-readable duration. Align the freshness wire payload with the V3 soda-library contract: emit diagnostics.measure = "time" and express the value plus fail thresholds in milliseconds. - Add CheckResult.get_soda_cloud_measure() / to_soda_cloud_measure_value() hooks (identity by default, so non-time check payloads are unchanged). - FreshnessCheckResult returns "time" and scales its configured unit to ms. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Problem
V4 contract-scan freshness checks render as raw floats (e.g.
11.155277…) in Soda Cloud's check charts instead of a human-readable duration — V3 showed clean unit-bearing values like "X days and Y hours". Two gaps in the freshness diagnostics soda-core sends:Fix
Align the freshness diagnostics wire payload with the proven V3
soda-libraryFreshnessCheckcontract:diagnostics.measure = "time"so the value is formatted as a durationdiagnostics.valueand thefailthreshold bounds in milliseconds (scaled from the configured unit)Implemented via two hooks on
CheckResult:get_soda_cloud_measure()—Noneby default,"time"for freshnessto_soda_cloud_measure_value()— identity by default, unit → ms for freshnessBoth default to no-ops, so non-time check payloads are byte-for-byte unchanged.
Tests (written test-first, red → green)
test_soda_cloud.py): freshness diagnostics carrymeasure == "time"and value3_600_000ms; non-time checks omitmeasure.test_freshness_check.py): end-to-end upload payload assertsmeasure, value in ms, andfail.greaterThanOrEqualin ms.Formatted with black 23.3.0 (repo-pinned).
Notes
freshness_in_seconds) before scaling to ms; V3 kept sub-second precision. Negligible for freshness.warnthreshold in ms; V4's diagnostics builder has nowarnblock today — out of scope here.🤖 Generated with Claude Code