Skip to content

feat(forecast-timestamp): add init and creation to GetForecastAtTimes…#136

Merged
peterdudfield merged 2 commits intomainfrom
add-to-forecast-snapshot
Mar 23, 2026
Merged

feat(forecast-timestamp): add init and creation to GetForecastAtTimes…#136
peterdudfield merged 2 commits intomainfrom
add-to-forecast-snapshot

Conversation

@peterdudfield
Copy link
Copy Markdown
Contributor

@peterdudfield peterdudfield commented Mar 23, 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

Add inti and creation time to theGetForecastAtTimestamp route

I ran it locally with the development database. It worked

Screenshot 2026-03-23 at 19 03 24

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 23, 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-23T19:11:30Z","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         	      55	  20878736 ns/op
BenchmarkPostgresClient/small/GetForecastAtTimestamp-4          	      64	  15666410 ns/op
BenchmarkPostgresClient/small/GetObservationsAsTimeseries-4     	    1123	   1061220 ns/op
BenchmarkPostgresClient/small/CreateForecast-4                  	      86	  13758973 ns/op
PASS
ok  	github.com/openclimatefix/data-platform/internal/server/postgres	64.126s
?   	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 7763 64-Core Processor                
                                                   │ bench-main.txt │
                                                   │     sec/op     │
PostgresClient/small/GetForecastAsTimeseries-4         18.65m ± ∞ ¹
PostgresClient/small/GetForecastAtTimestamp-4          14.74m ± ∞ ¹
PostgresClient/small/GetObservationsAsTimeseries-4     1.270m ± ∞ ¹
PostgresClient/small/CreateForecast-4                  14.79m ± ∞ ¹
geomean                                                8.476m
¹ need >= 6 samples for confidence interval at level 0.95

cpu: Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz
                                                   │ bench-add-to-forecast-snapshot.txt │
                                                   │               sec/op               │
PostgresClient/small/GetForecastAsTimeseries-4                             20.88m ± ∞ ¹
PostgresClient/small/GetForecastAtTimestamp-4                              15.67m ± ∞ ¹
PostgresClient/small/GetObservationsAsTimeseries-4                         1.061m ± ∞ ¹
PostgresClient/small/CreateForecast-4                                      13.76m ± ∞ ¹
geomean                                                                    8.313m
¹ need >= 6 samples for confidence interval at level 0.95

@peterdudfield peterdudfield requested a review from devsjc March 23, 2026 19:04
devsjc
devsjc previously approved these changes Mar 23, 2026
@peterdudfield peterdudfield merged commit efbb3b0 into main Mar 23, 2026
4 checks passed
@peterdudfield peterdudfield deleted the add-to-forecast-snapshot branch March 23, 2026 19:18
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.

2 participants