Skip to content

feat(proto): InitTime filter; Speedier stream#159

Merged
devsjc merged 1 commit intomainfrom
devjsc/init-filter
Apr 28, 2026
Merged

feat(proto): InitTime filter; Speedier stream#159
devsjc merged 1 commit intomainfrom
devjsc/init-filter

Conversation

@devsjc
Copy link
Copy Markdown
Contributor

@devsjc devsjc commented Apr 28, 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 an init_time filter to the GetForecastAsTimeseries request. This enables it to fetch all the values for a specific forecast, if desired. Also modifies the underlying query mechanism behind the StreamForecastData RPC, in order to make it somewhat quicker.

Closes #158.

Adds an init_time filter to the GetForecastAsTimeseries request. This
enables it to fetch all the values for a specific forecast, if desired.
Also modifies the underlying query mechanism behind the
StreamForecastData RPC, in order to make it somewhat quicker.
@github-actions
Copy link
Copy Markdown

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-04-28T10:33:13Z","message":"Completed migrations"}
goos: linux
goarch: amd64
pkg: github.com/openclimatefix/data-platform/internal/server/postgres
cpu: AMD EPYC 7763 64-Core Processor                
BenchmarkPostgresClient/small/GetForecastAsTimeseries-4         	      72	  15536725 ns/op
BenchmarkPostgresClient/small/GetForecastAtTimestamp-4          	     282	   4125260 ns/op
BenchmarkPostgresClient/small/GetObservationsAsTimeseries-4     	     909	   1249224 ns/op
BenchmarkPostgresClient/small/CreateForecast-4                  	      90	  12941766 ns/op
PASS
ok  	github.com/openclimatefix/data-platform/internal/server/postgres	71.918s
?   	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-devjsc-init-filter.txt │
                                                   │            sec/op            │
PostgresClient/small/GetForecastAsTimeseries-4                       15.54m ± ∞ ¹
PostgresClient/small/GetForecastAtTimestamp-4                        4.125m ± ∞ ¹
PostgresClient/small/GetObservationsAsTimeseries-4                   1.249m ± ∞ ¹
PostgresClient/small/CreateForecast-4                                12.94m ± ∞ ¹
geomean                                                              5.674m
¹ need >= 6 samples for confidence interval at level 0.95

cpu: AMD EPYC 9V74 80-Core Processor                
                                                   │ bench-main.txt │
                                                   │     sec/op     │
PostgresClient/small/GetForecastAsTimeseries-4         18.80m ± ∞ ¹
PostgresClient/small/GetForecastAtTimestamp-4          4.278m ± ∞ ¹
PostgresClient/small/GetObservationsAsTimeseries-4     1.180m ± ∞ ¹
PostgresClient/small/CreateForecast-4                  11.79m ± ∞ ¹
geomean                                                5.783m
¹ need >= 6 samples for confidence interval at level 0.95

@devsjc devsjc merged commit 621763d into main Apr 28, 2026
4 checks passed
@devsjc devsjc deleted the devjsc/init-filter branch April 28, 2026 10:35
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.

Add optional init_time parameter in GetForecastAsTimeseries request

1 participant