Skip to content

feat(proto): Add GetLocationAsTimeseries route#165

Merged
devsjc merged 2 commits into
mainfrom
devsjc/location-as-timeseries
May 27, 2026
Merged

feat(proto): Add GetLocationAsTimeseries route#165
devsjc merged 2 commits into
mainfrom
devsjc/location-as-timeseries

Conversation

@devsjc
Copy link
Copy Markdown
Contributor

@devsjc devsjc commented May 27, 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 GetLocationAsTimeseries route which returns the capacity values for a given time window.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 27, 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-05-27T12:11:49Z","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         	      66	  16647527 ns/op
BenchmarkPostgresClient/small/GetForecastAtTimestamp-4          	     271	   4256614 ns/op
BenchmarkPostgresClient/small/GetObservationsAsTimeseries-4     	     912	   1266903 ns/op
BenchmarkPostgresClient/small/CreateForecast-4                  	      90	  12981141 ns/op
BenchmarkPostgresClient/small/StreamForecastData-4              	      10	 104621804 ns/op
PASS
ok  	github.com/openclimatefix/data-platform/internal/server/postgres	71.762s
?   	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 │ bench-devsjc-location-as-timeseries.txt │
                                                   │     sec/op     │     sec/op       vs base                │
PostgresClient/small/GetForecastAsTimeseries-4         15.52m ± ∞ ¹      16.65m ± ∞ ¹       ~ (p=1.000 n=1) ²
PostgresClient/small/GetForecastAtTimestamp-4          4.133m ± ∞ ¹      4.257m ± ∞ ¹       ~ (p=1.000 n=1) ²
PostgresClient/small/GetObservationsAsTimeseries-4     1.267m ± ∞ ¹      1.267m ± ∞ ¹       ~ (p=1.000 n=1) ²
PostgresClient/small/CreateForecast-4                  12.92m ± ∞ ¹      12.98m ± ∞ ¹       ~ (p=1.000 n=1) ²
PostgresClient/small/StreamForecastData-4              103.0m ± ∞ ¹      104.6m ± ∞ ¹       ~ (p=1.000 n=1) ²
geomean                                                10.16m            10.40m        +2.43%
¹ need >= 6 samples for confidence interval at level 0.95
² need >= 4 samples to detect a difference at alpha level 0.05

@devsjc devsjc merged commit 5ea304e into main May 27, 2026
4 checks passed
@devsjc devsjc deleted the devsjc/location-as-timeseries branch May 27, 2026 12: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.

1 participant