Conversation
this behavior is coming from a real station in the field
Review Summary by QodoApply operational delta tolerance to stop timestamp validation
WalkthroughsDescription• Apply operational delta tolerance to stop timestamp validation - Allows meter values up to 5 minutes after stop timestamp - Accounts for real-world clock drift and sampling delays • Add test case for meter value 1 second after stop • Refactor timestamp validation logic for consistency - Extract deltaMillis calculation for reuse - Improve code comments explaining tolerance rationale Diagramflowchart LR
A["Meter Value Timestamp"] -->|"Check against Stop Timestamp"| B["Add Operational Delta Tolerance"]
B -->|"Within tolerance"| C["Validation Passes"]
B -->|"Exceeds tolerance"| D["Validation Fails"]
E["Real-world Clock Drift"] -.->|"Justifies tolerance"| B
File Changes1. src/main/java/de/rwth/idsg/steve/service/CentralSystemService16_ServiceValidator.java
|
Code Review by Qodo
1. Missing delta boundary test
|
|
@goekay This is an interesting use case. I couldn’t find a clearly defined or recommended behavior for this scenario in the spec. I have a couple of questions and thoughts regarding the current approach:
Curious to hear your thoughts on this. |
now... the validation/strictness suggestions opened a can of worms, and now we have a cat-and-mouse game with the stations ;). steve's behaviour will need multiple iterations, i fear, until becoming somewhat stable. we are experiencing the old "real-world vs theory (or spec)" conflict now. this is the reason i was hesitant to introduce these kinds of things so far in the life of steve. but also luckily with Powerfill, i have direct and immediate operational feedback and can adjust. this was not possible before Powerfill.
a somewhat general assumption, but also backed by observed behavior within our Powefill operations. most stations behave correctly. so, we are dealing with a small percentage of potential issues here. and there, 5 minute is generous enough while also being small enough to catch systematic issues.
dont want to right now. if more people want, sure, later but not right now.
i considered and discarded. see my previous answer. |
reason: we started using it as a general tolerance in more use cases than the initial use case for "now"
this behavior is coming from a real station in the field: the latest of meterValues is 1 second after stopTimestamp, because the station sampled stop timestamp first, and then later the timestamp for this meterValue entry.
a redacted version of the real station message can be found in #1992