Skip to content

Commit

Permalink
add extra context for cached value returns
Browse files Browse the repository at this point in the history
  • Loading branch information
adamkorynta committed Nov 9, 2023
1 parent 6121198 commit 55a4be6
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 18 deletions.
Binary file modified docs/plantuml/paging/paging_endpoint.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 5 additions & 3 deletions docs/plantuml/paging/paging_endpoint.puml
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,19 @@ else Session 2
Client -> ReverseProxy: /catalog/timeseries?office=SWT&tsid_start=<1>&tsid_end=<2>
ReverseProxy -> CDA: cache current?
CDA -> ReverseProxy: yes
ReverseProxy -> Client: time series ids
ReverseProxy -[#green]> Client: time series ids
else thread 2
Client -> ReverseProxy: /catalog/timeseries?office=SWT&tsid_start=<3>&tsid_end=<4>
ReverseProxy -> CDA: cache current?
CDA -> ReverseProxy: yes
ReverseProxy -> Client: time series ids
ReverseProxy -[#green]> Client: time series ids
else thread 3
Client -> ReverseProxy: /catalog/timeseries?office=SWT&tsid_start=<5>&tsid_end=<6>
ReverseProxy -> CDA: cache current?
CDA -> ReverseProxy: yes
ReverseProxy -> Client: time series ids
ReverseProxy -[#green]> Client: time series ids
end
end

footer Green arrow indicates performance improvement due to caching
@enduml
Binary file modified docs/plantuml/paging/smart_paging.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 10 additions & 15 deletions docs/plantuml/paging/smart_paging.puml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@
actor Client as "Client"
control ReverseProxy as "Server Cache"
group Session [Client 1]
Client -> CDA: /timeseries/<ACTT2.Elev.Inst.1Hour.0.Ccp-Rev>/pages?begin=2023-11-01T00:00:00-0700[UTC]&end=current
Client -> CDA: /timeseries/<ACTT2.Elev.Inst.1Hour.0.Ccp-Rev>/pages?begin=2023-11-05T00:00:00-0700[UTC]&end=current
CDA -> CDA: calculate pages based on interval
CDA -> Client: \n \
/timeseries/<ACTT2.Elev.Inst.1Hour.0.Ccp-Rev>?office=SWT&begin=2023-11-10T12:00:00-0700[UTC]&end=2023-11-10T13:53:00-0700[UTC]\n \
/timeseries/<ACTT2.Elev.Inst.1Hour.0.Ccp-Rev>?office=SWT&begin=2023-11-10T00:00:00-0700[UTC]&end=2023-11-10T12:00:00-0700[UTC]\n \
/timeseries/<ACTT2.Elev.Inst.1Hour.0.Ccp-Rev>?office=SWT&begin=2023-11-05T00:00:00-0700[UTC]&end=2023-11-10T00:00:00-0700[UTC]\n \
/timeseries/<ACTT2.Elev.Inst.1Hour.0.Ccp-Rev>?office=SWT&begin=2023-11-01T00:00:00-0700[UTC]&end=2023-11-05T00:00:00-0700[UTC]\n
/timeseries/<ACTT2.Elev.Inst.1Hour.0.Ccp-Rev>?office=SWT&begin=2023-11-05T00:00:00-0700[UTC]&end=2023-11-10T00:00:00-0700[UTC]\n
par thread 1
Client -> ReverseProxy: /timeseries/<ACTT2.Elev.Inst.1Hour.0.Ccp-Rev>?office=SWT&begin=2023-11-10T12:00:00-0700[UTC]&end=2023-11-10T13:53:00-0700[UTC]
ReverseProxy -> CDA: cache current?
Expand All @@ -32,13 +31,6 @@ group Session [Client 1]
ReverseProxy -> CDA: /timeseries/<ACTT2.Elev.Inst.1Hour.0.Ccp-Rev>?office=SWT&begin=2023-11-05T00:00:00-0700[UTC]&end=2023-11-10T00:00:00-0700[UTC]
CDA -> Database: query time series for SWT ACTT2.Elev.Inst.1Hour.0.Ccp-Rev\nstarting with 2023-11-05T00:00:00-0700[UTC] \n ending with 2023-11-10T00:00:00-0700[UTC]
CDA -> Client: time series data
else thread 4
Client -> ReverseProxy: /timeseries/<ACTT2.Elev.Inst.1Hour.0.Ccp-Rev>?office=SWT&begin=2023-11-01T00:00:00-0700[UTC]&end=2023-11-05T00:00:00-0700[UTC]
ReverseProxy -> CDA: cache current?
CDA -> ReverseProxy: no
ReverseProxy -> CDA: /timeseries/<ACTT2.Elev.Inst.1Hour.0.Ccp-Rev>?office=SWT&begin=2023-11-01T00:00:00-0700[UTC]&end=2023-11-05T00:00:00-0700[UTC]
CDA -> Database: query time series for SWT ACTT2.Elev.Inst.1Hour.0.Ccp-Rev\nstarting with 2023-11-01T00:00:00-0700[UTC] \n ending with 2023-11-05T00:00:00-0700[UTC]
CDA -> Client: time series data
end
else Session 2
Client -> Database: data stored event for SWT ACTT2.Elev.Inst.1Hour.0.Ccp-Rev at 2023-11-10T13:00:00-0700[UTC]
Expand All @@ -61,19 +53,22 @@ else Session 3
Client -> ReverseProxy: /timeseries/<ACTT2.Elev.Inst.1Hour.0.Ccp-Rev>?office=SWT&begin=2023-11-10T00:00:00-0700[UTC]&end=2023-11-10T12:00:00-0700[UTC]
ReverseProxy -> CDA: cache current?
CDA -> ReverseProxy: yes
ReverseProxy -> Client: time series data
ReverseProxy -[#green]> Client: time series data
else thread 3
Client -> ReverseProxy: /timeseries/<ACTT2.Elev.Inst.1Hour.0.Ccp-Rev>?office=SWT&begin=2023-11-05T00:00:00-0700[UTC]&end=2023-11-10T00:00:00-0700[UTC]
ReverseProxy -> CDA: cache current?
CDA -> ReverseProxy: yes
ReverseProxy -> Client: time series data
ReverseProxy -[#green]> Client: time series data
else thread 4
Client -> ReverseProxy: /timeseries/<ACTT2.Elev.Inst.1Hour.0.Ccp-Rev>?office=SWT&begin=2023-11-01T00:00:00-0700[UTC]&end=2023-11-05T00:00:00-0700[UTC]
ReverseProxy -> CDA: cache current?
CDA -> ReverseProxy: yes
ReverseProxy -> Client: time series data
CDA -> ReverseProxy: no
ReverseProxy -> CDA: /timeseries/<ACTT2.Elev.Inst.1Hour.0.Ccp-Rev>?office=SWT&begin=2023-11-01T00:00:00-0700[UTC]&end=2023-11-05T00:00:00-0700[UTC]
CDA -> Database: query time series for SWT ACTT2.Elev.Inst.1Hour.0.Ccp-Rev\nstarting with 2023-11-01T00:00:00-0700[UTC] \n ending with 2023-11-05T00:00:00-0700[UTC]
CDA -> Client: time series data
end
end

footer For this example "current" time is 2023-11-10T13:53:00-0700[UTC]
footer For this example "current" time is 2023-11-10T13:53:00-0700[UTC] \n\n \
Green arrow indicates performance improvement due to caching
@enduml

0 comments on commit 55a4be6

Please sign in to comment.