Skip to content

feat(proto): GetObservationsAtTimestamp route#134

Merged
devsjc merged 6 commits intomainfrom
devsjc/observations-snapshot
Mar 20, 2026
Merged

feat(proto): GetObservationsAtTimestamp route#134
devsjc merged 6 commits intomainfrom
devsjc/observations-snapshot

Conversation

@devsjc
Copy link
Copy Markdown
Contributor

@devsjc devsjc commented Mar 20, 2026

Contribution Checklist

  • Have you followed the Open Climate Fix Contribution Guidelines?
  • Have you referenced the Issue this PR addresses, where applicable?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added a summary of the changes?
  • Have you written new tests for your changes, where applicable?
  • Have you successfully run make lint with your changes locally?
  • Have you successfully run make test with your changes locally?

Warning

PRs may be closed if all the above boxes are not checked.

Changes in this Pull Request

Adds a GetObservationsAtTimestamp route. This will speed up pvlive/all, which currently takes around 11 seconds.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 20, 2026

Benchmark Results

Benchmark results
?   	github.com/openclimatefix/data-platform/cmd	[no test files]
?   	github.com/openclimatefix/data-platform/internal/gen/ocf/dp	[no test files]
?   	github.com/openclimatefix/data-platform/internal/interceptors	[no test files]
PASS
ok  	github.com/openclimatefix/data-platform/internal/server/dummy	0.005s
{"level":"debug","time":"2026-03-20T15:58:39Z","message":"Completed migrations"}
goos: linux
goarch: amd64
pkg: github.com/openclimatefix/data-platform/internal/server/postgres
cpu: Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz
BenchmarkPostgresClient/small/GetForecastAsTimeseries-4         	      57	  21092857 ns/op
BenchmarkPostgresClient/small/GetForecastAtTimestamp-4          	      75	  15726027 ns/op
BenchmarkPostgresClient/small/GetObservationsAsTimeseries-4     	    1050	   1131173 ns/op
BenchmarkPostgresClient/small/CreateForecast-4                  	      84	  13871288 ns/op
PASS
ok  	github.com/openclimatefix/data-platform/internal/server/postgres	65.520s
?   	github.com/openclimatefix/data-platform/internal/server/postgres/gen	[no test files]
Benchmark vs base branch
goos: linux
goarch: amd64
pkg: github.com/openclimatefix/data-platform/internal/server/postgres
cpu: AMD EPYC 9V74 80-Core Processor                
                                                   │ bench-main.txt │
                                                   │     sec/op     │
PostgresClient/small/GetForecastAsTimeseries-4         23.09m ± ∞ ¹
PostgresClient/small/GetForecastAtTimestamp-4          16.30m ± ∞ ¹
PostgresClient/small/GetObservationsAsTimeseries-4     1.225m ± ∞ ¹
PostgresClient/small/CreateForecast-4                  14.10m ± ∞ ¹
geomean                                                8.980m
¹ need >= 6 samples for confidence interval at level 0.95

cpu: Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz
                                                   │ bench-devsjc-observations-snapshot.txt │
                                                   │                 sec/op                 │
PostgresClient/small/GetForecastAsTimeseries-4                                 21.09m ± ∞ ¹
PostgresClient/small/GetForecastAtTimestamp-4                                  15.73m ± ∞ ¹
PostgresClient/small/GetObservationsAsTimeseries-4                             1.131m ± ∞ ¹
PostgresClient/small/CreateForecast-4                                          13.87m ± ∞ ¹
geomean                                                                        8.494m
¹ need >= 6 samples for confidence interval at level 0.95

@devsjc devsjc changed the title fix(sql): Ignore meaningless source updates feat(proto): GetObservationsAtTimestamp route Mar 20, 2026
@devsjc devsjc merged commit 209af71 into main Mar 20, 2026
4 checks passed
@devsjc devsjc deleted the devsjc/observations-snapshot branch March 20, 2026 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant