Commit graph

15486 commits

Author SHA1 Message Date
Christoph Atteneder
60526cc321
Merge pull request #5795 from chimp1984/optimize-dao-charts-7
Optimize DAO charts [7]
2021-11-09 20:41:36 +01:00
Christoph Atteneder
2eae94e22a
Add missing space 2021-11-09 20:30:14 +01:00
chimp1984
8a4d1cb6db
Return CompletableFuture once applyData is completed with all
calls.
2021-11-09 20:00:34 +01:00
chimp1984
a00667bbc2
Clean up log 2021-11-09 20:00:34 +01:00
chimp1984
67741f0d0e
Add DEFAULT_LOG_LEVEL field 2021-11-09 20:00:34 +01:00
chimp1984
cf9e49134a
Add shutDown method to ClockWatcher and shut it down at shutdown 2021-11-09 20:00:34 +01:00
chimp1984
b61d64e1ea
Add mapToUserThread method to ChartView
For initial rendering we need to delay a bit and wait
until async calls are completed.
2021-11-09 20:00:34 +01:00
chimp1984
a4b106cd4a
Apply async handling to DaoChartView as well 2021-11-09 20:00:34 +01:00
chimp1984
6b89bf0da9
Use async methods with CompletableFuture in viewmodel to
avoid that slow operations in data model are running on UI thread
2021-11-09 20:00:34 +01:00
Christoph Atteneder
07f4074d0c
Merge pull request #5794 from chimp1984/optimize-trade-chart-view-6
Optimize trade chart view [6]
2021-11-09 19:46:25 +01:00
chimp1984
c209da7c66
Fix package statement 2021-11-09 19:32:44 +01:00
chimp1984
a659a78db6
Do sorting on non UI thread as its slow and only attach
it to table in UI thread afterwards.

Chain updateSelectedTradeStatistics and updateChartData calls.
2021-11-09 19:20:35 +01:00
chimp1984
ce8a91fdb3
Make getUpdateChartResult ansync 2021-11-09 19:20:35 +01:00
chimp1984
041b07e2e1
Move getUpdateChartResult, getCandleData, getTimeFromTickIndex to ChartCalculations
Make maxTicks static and rename to MAX_TICKS
2021-11-09 19:20:35 +01:00
chimp1984
7ad5993aad
Run getUsdAveragePriceMapsPerTickUnit and getTradeStatisticsForCurrency
in parallel and once both are done we call asyncUpdateChartData (not yet refactored).

Clear all data at deactivate
This cause a bit of costs when we activate again but as we delegate
now all work to threads it should be OK. It decreases the memory usage
if we do not keep those data in the fields. The View classes are cached
in the view loader so all data in fields stays in memory once it was
activated once and not manually cleared in deactivate.

Move getTradeStatisticsForCurrency to ChartCalculations
Rename buildUsdPricesPerTickUnit to getUsdAveragePriceMapsPerTickUnit
Rename selectedTradeStatistics to tradeStatisticsByCurrency
Make itemsPerInterval final
Remove modelReady
Add deactivateCalled flag
2021-11-09 19:20:35 +01:00
chimp1984
65706e7c14
Add async handling with CompletableFuture to fillList
The creation of TradeStatistics3ListItem is rather fast but the
applying to the list is due sorting pretty slow (300 ms) as
its > 100k items. We do the applying on the callback thread.
Seems JavaFx permits that. So we can keep the UI thread unblocked.

Remove modelReadyListener

Renamed model.selectedTradeStatistics to model.tradeStatisticsByCurrency
2021-11-09 19:20:35 +01:00
chimp1984
603e9fde17
Add CompletableFutureUtils
Convenience util for CompletableFuture.allOf method
2021-11-09 19:20:34 +01:00
chimp1984
ca145b0eb3
Add static method getTradeStatisticsForCurrency and
use it instead of updateSelectedTradeStatistics
(preparation for follow up commit)
2021-11-09 19:20:34 +01:00
chimp1984
0271af995b
Add modelReady property and let view fill list once model is ready 2021-11-09 19:20:34 +01:00
chimp1984
ea66a510dc
Make buildUsdPricesPerTickUnit async using CompletableFuture 2021-11-09 19:20:34 +01:00
chimp1984
deeb912f9b
Move buildUsdPricesPerTickUnit to ChartCalculations 2021-11-09 19:20:34 +01:00
chimp1984
c51060a6d4
Move getAveragePrice and roundToTick to ChartCalculations
Make buildUsdPricesPerTickUnit static and pass params
Rename usdPriceMapsPerTickUnit to usdAveragePriceMapsPerTickUnit
Rename local variable map to usdAveragePriceMap

Move method calls syncPriceFeedCurrency() and
setMarketPriceFeedCurrency() before other calls (those will become async later)
2021-11-09 19:20:33 +01:00
Christoph Atteneder
dc0c1771f7
Merge pull request #5815 from ripcurlx/fix-git-ls-pointers
Fix Git LFS pointers
2021-11-09 19:13:00 +01:00
Christoph Atteneder
c3bb0162d6
Fix Git LFS pointers 2021-11-09 19:03:01 +01:00
Christoph Atteneder
7b6f971acd
Merge pull request #5790 from chimp1984/extract-persistence-of-blocks
Extract persistence of BSQ blocks out of DaoStateStore [5]
2021-11-09 18:31:07 +01:00
chimp1984
87f4444210
Add git lfs support for BsqBlocks in resources
Fix typo
2021-11-09 17:22:35 +01:00
chimp1984
1108e98164
Add isEmpty check 2021-11-09 13:01:21 +01:00
chimp1984
c600259267
Fix typo 2021-11-09 13:01:21 +01:00
chimp1984
97e356c79f
Add check that height of last block matches chainHeight from daoState 2021-11-09 13:01:21 +01:00
chimp1984
80e7c452ca
Add BsqBlocks resources and update DaoState
Add BsqBlocks resources
2021-11-09 13:01:20 +01:00
chimp1984
62b3e51b22
Cleanups, change log levels 2021-11-09 13:01:19 +01:00
chimp1984
3487932f6e
Remove unnecessary sorting
Blocks are always sorted by block height
2021-11-09 13:01:19 +01:00
chimp1984
a3fbdf48d2
Improve log 2021-11-09 13:01:19 +01:00
chimp1984
7c32587453
Persist bsq blocks as buckets of 1000 blocks
Improve logging

Add BsqBlockStore to protobuf

Remove DaoStateMonitoringService field

Do not persist the blocks in daoState anymore.

This improves persistence performance and reduces memory
requirements for snapshots.
2021-11-09 13:01:19 +01:00
chimp1984
699048634b
Avoid unnecessary serialisation/deserialisation cycle
For the snapshot we create a deep clone by protobuf serialisation.
We do not need the deserialisation back to the java object as it is
only kept in memory for later persistence where we need to do protobuf
serialisation again. So we can skip that cycle and safe a bit of
time at creating and persisting snapshots.
2021-11-09 13:01:19 +01:00
chimp1984
b619afa83d
Remove unused field 2021-11-09 13:01:18 +01:00
chimp1984
4d2d0717b5
Add getBlockTimeAtBlockHeight method
Improve getBlockStartDateByCycleIndex method
2021-11-09 13:01:18 +01:00
chimp1984
779bd0cf1e
Remove blockHashes set from daoState
Was only used from one use case which can be done differently.
2021-11-09 13:01:18 +01:00
Christoph Atteneder
65c308f5ed
Merge pull request #5782 from chimp1984/redesign-dao-state-monitoring
Redesign dao state monitoring [4]
2021-11-09 12:12:22 +01:00
chimp1984
7e1696b095
Fix typos, cleanups 2021-11-08 21:49:08 +01:00
Christoph Atteneder
00d7913bc6
Merge pull request #5055 from Jakub-CZ/button-buy-bsq
Add "Buy BSQ" button next to trade fee selector
2021-11-08 11:13:52 +01:00
Christoph Atteneder
07e224e40a
Simplify containers and improve truncation behavior 2021-11-08 11:06:00 +01:00
Christoph Atteneder
2b90633263
Improve naming of helper method 2021-11-08 11:05:27 +01:00
Christoph Atteneder
12cd88ce32
Fix translations 2021-11-04 13:23:00 +01:00
Christoph Atteneder
fac4b3c5c3
Fix combobox BSQ selection error 2021-11-04 13:22:32 +01:00
chimp1984
84ff332aeb
Implement new behaviour for dao state monitoring and snapshotting
See https://github.com/bisq-network/bisq/issues/5779 for spec
2021-11-04 12:48:10 +01:00
chimp1984
5ccef962d0
Add pruneStore method
We set both data to null and call GC after persistence is done.
2021-11-04 12:48:09 +01:00
chimp1984
5a8a9e9be8
Delete DaoEventCoordinator (we will handle coordination in
DaoStateSnapshotService instead in next commits)

Let DaoStateSnapshotService implement DaoSetupService (impl in next commits)
2021-11-04 12:48:09 +01:00
chimp1984
8e3f95383e
Add daoStateBlockChainNotConnecting property (impl. will come in other commits)
Add Preferences to service classes
2021-11-04 12:48:09 +01:00
chimp1984
1f929926cc
Remove prevHash from StateHash classes (the prevHash was only used for display.
For creating the hash we take the hash from the previous element. By removing it
we safe about 3 MB on data)

Add isSelfCreated field to DaoStateHash (indicates if we have created
the hash by ourself or if we have received it from a peer -> will be
part of later commits)
2021-11-04 12:48:09 +01:00