refactor: get rid of redundant SchemaCacheSummaryObs
There is unnecessary coupling between observation messages and emited log entries. This causes schema loading logic to emit redundant events: SchemaCacheSummaryObs and SchemaCacheLoadedObs. Logically - we want to emit a single event containing both summary and timing information. How it is logged is a different matter and should be decoupled. This commit * changes observationMessage function returning Text to observationMessages returning [Text] so that it is possible to return multiple (or zero) messages to log based on an observation event * Removes SchemaCacheSummaryObs constructor from Observation type and adds summary text to SchemaCacheLoadedObs
This commit is contained in:
committed by
Steve Chavez
parent
58a973e664
commit
2408cd332d
@@ -34,7 +34,9 @@ def test_schema_cache_load_max_duration(defaultenv):
|
||||
assert match, f"unexpected log format: {schema_cache_lines[-1]}"
|
||||
duration_ms = float(match.group(1))
|
||||
|
||||
assert duration_ms < max_duration
|
||||
# check that loading takes long enough
|
||||
# to make sure we measure the time correctly
|
||||
assert 100 < duration_ms < max_duration
|
||||
|
||||
|
||||
# TODO: This test fails now because of https://github.com/PostgREST/postgrest/pull/2122
|
||||
|
||||
Reference in New Issue
Block a user