Skip to content

Commit 307391d

Browse files
Fix performance tests script. (#809)
* Remove cache path from artifacts. * Remove cache folder after each disk cache test. * Add new prefetch tests. * Rename old tests heapptrack files, now has "Old" ending. * Enable only errors logs. * Decrease the number of prefetched tiles from 100 to 2. Resolves: OLPEDGE-1863 Signed-off-by: Mykhailo Kuchma <ext-mykhailo.kuchma@here.com>
1 parent 0d4a732 commit 307391d

File tree

5 files changed

+40
-13
lines changed

5 files changed

+40
-13
lines changed

.gitlab-ci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ test_performance_nv:
112112
paths:
113113
- ./*.gz
114114
- ./*.html
115-
- cache
116115
- heaptrack
117116
- reports
118117
expire_in: 1 year

scripts/linux/nv/gitlab_test_performance.sh

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,23 +40,36 @@ echo ">>> Local Server started for further performance test ... >>>"
4040
export cache_location="cache"
4141

4242
echo ">>> Start performance tests ... >>>"
43-
heaptrack ./build/tests/performance/olp-cpp-sdk-performance-tests --gtest_filter="*ReadNPartitionsFromVersionedLayer/short_test_null_cache" 2>> errors.txt || TEST_FAILURE=1
43+
heaptrack ./build/tests/performance/olp-cpp-sdk-performance-tests --gtest_filter="*MemoryTest.ReadNPartitionsFromVersionedLayer/short_test_null_cache" 2>> errors.txt || TEST_FAILURE=1
4444
mv heaptrack.olp-cpp-sdk-performance-tests.*.gz heaptrack.ReadNPartitionsFromVersionedLayer.short_test_null_cache.gz
4545

46-
heaptrack ./build/tests/performance/olp-cpp-sdk-performance-tests --gtest_filter="*ReadNPartitionsFromVersionedLayer/short_test_memory_cache" 2>> errors.txt || TEST_FAILURE=1
46+
heaptrack ./build/tests/performance/olp-cpp-sdk-performance-tests --gtest_filter="*MemoryTest.ReadNPartitionsFromVersionedLayer/short_test_memory_cache" 2>> errors.txt || TEST_FAILURE=1
4747
mv heaptrack.olp-cpp-sdk-performance-tests.*.gz heaptrack.ReadNPartitionsFromVersionedLayer.short_test_memory_cache.gz
4848

49-
heaptrack ./build/tests/performance/olp-cpp-sdk-performance-tests --gtest_filter="*ReadNPartitionsFromVersionedLayer/short_test_disk_cache" 2>> errors.txt || TEST_FAILURE=1
49+
heaptrack ./build/tests/performance/olp-cpp-sdk-performance-tests --gtest_filter="*MemoryTest.ReadNPartitionsFromVersionedLayer/short_test_disk_cache" 2>> errors.txt || TEST_FAILURE=1
5050
mv heaptrack.olp-cpp-sdk-performance-tests.*.gz heaptrack.ReadNPartitionsFromVersionedLayer.short_test_disk_cache.gz
51+
rm -rf $cache_location # Remove cache folder after disk cache test
5152

52-
heaptrack ./build/tests/performance/olp-cpp-sdk-performance-tests --gtest_filter="*PrefetchPartitionsFromVersionedLayer/short_test_null_cache" 2>> errors.txt || TEST_FAILURE=1
53+
heaptrack ./build/tests/performance/olp-cpp-sdk-performance-tests --gtest_filter="*MemoryTest.PrefetchPartitionsFromVersionedLayer/short_test_null_cache" 2>> errors.txt || TEST_FAILURE=1
54+
mv heaptrack.olp-cpp-sdk-performance-tests.*.gz heaptrack.PrefetchPartitionsFromVersionedLayerOld.short_test_null_cache.gz
55+
56+
heaptrack ./build/tests/performance/olp-cpp-sdk-performance-tests --gtest_filter="*MemoryTest.PrefetchPartitionsFromVersionedLayer/short_test_memory_cache" 2>> errors.txt || TEST_FAILURE=1
57+
mv heaptrack.olp-cpp-sdk-performance-tests.*.gz heaptrack.PrefetchPartitionsFromVersionedLayerOld.short_test_memory_cache.gz
58+
59+
heaptrack ./build/tests/performance/olp-cpp-sdk-performance-tests --gtest_filter="*MemoryTest.PrefetchPartitionsFromVersionedLayer/short_test_disk_cache" 2>> errors.txt || TEST_FAILURE=1
60+
mv heaptrack.olp-cpp-sdk-performance-tests.*.gz heaptrack.PrefetchPartitionsFromVersionedLayerOld.short_test_disk_cache.gz
61+
rm -rf $cache_location # Remove cache folder after disk cache test
62+
63+
heaptrack ./build/tests/performance/olp-cpp-sdk-performance-tests --gtest_filter="*PrefetchTest.PrefetchPartitionsFromVersionedLayer/short_test_null_cache" 2>> errors.txt || TEST_FAILURE=1
5364
mv heaptrack.olp-cpp-sdk-performance-tests.*.gz heaptrack.PrefetchPartitionsFromVersionedLayer.short_test_null_cache.gz
5465

55-
heaptrack ./build/tests/performance/olp-cpp-sdk-performance-tests --gtest_filter="*PrefetchPartitionsFromVersionedLayer/short_test_memory_cache" 2>> errors.txt || TEST_FAILURE=1
66+
heaptrack ./build/tests/performance/olp-cpp-sdk-performance-tests --gtest_filter="*PrefetchTest.PrefetchPartitionsFromVersionedLayer/short_test_memory_cache" 2>> errors.txt || TEST_FAILURE=1
5667
mv heaptrack.olp-cpp-sdk-performance-tests.*.gz heaptrack.PrefetchPartitionsFromVersionedLayer.short_test_memory_cache.gz
5768

58-
heaptrack ./build/tests/performance/olp-cpp-sdk-performance-tests --gtest_filter="*PrefetchPartitionsFromVersionedLayer/short_test_disk_cache" 2>> errors.txt || TEST_FAILURE=1
69+
heaptrack ./build/tests/performance/olp-cpp-sdk-performance-tests --gtest_filter="*PrefetchTest.PrefetchPartitionsFromVersionedLayer/short_test_disk_cache" 2>> errors.txt || TEST_FAILURE=1
5970
mv heaptrack.olp-cpp-sdk-performance-tests.*.gz heaptrack.PrefetchPartitionsFromVersionedLayer.short_test_disk_cache.gz
71+
rm -rf $cache_location # Remove cache folder after disk cache test
72+
6073
echo ">>> Finished performance tests . >>>"
6174

6275
if [[ ${TEST_FAILURE} == 1 ]]; then
@@ -92,10 +105,6 @@ cp heaptrack_report.html reports
92105
ls -la heaptrack
93106
ls -la
94107

95-
du ${cache_location}
96-
du ${cache_location}/*
97-
ls -la ${cache_location}
98-
99108
# TODO:
100109
# 1. print the total allocations done
101110
# 2. use watch command on cache directory, like: watch "du | cut -d'.' -f1 >> cache.csv" and plot a disk size graph

tests/performance/MemoryTest.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,9 @@ void MemoryTest::RandomlyCancel(olp::client::CancellationToken token) {
159159
* Valgrind, heaptrack, other tools are used to collect the output.
160160
*/
161161
TEST_P(MemoryTest, ReadNPartitionsFromVersionedLayer) {
162+
// Enable only errors to have a short output.
163+
olp::logging::Log::setLevel(olp::logging::Level::Warning);
164+
162165
const auto& parameter = GetParam();
163166

164167
auto settings = CreateCatalogClientSettings();
@@ -195,6 +198,9 @@ TEST_P(MemoryTest, ReadNPartitionsFromVersionedLayer) {
195198
}
196199

197200
TEST_P(MemoryTest, PrefetchPartitionsFromVersionedLayer) {
201+
// Enable only errors to have a short output.
202+
olp::logging::Log::setLevel(olp::logging::Level::Warning);
203+
198204
const auto& parameter = GetParam();
199205

200206
auto settings = CreateCatalogClientSettings();

tests/performance/PrefetchTest.cpp

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,12 @@ using TestFunction = std::function<void(uint8_t thread_id)>;
3232

3333
struct TestConfiguration : public TestBaseConfiguration {
3434
std::string configuration_name;
35+
36+
// One prefetch request for one tile with depth of four results in 341 tiles
37+
// to download. (1 + 4 + 16 + 64 + 256).
38+
// Five parallel prefetch requests for 2 tiles completes in ~95 sec.
3539
std::uint8_t calling_thread_count = 5;
36-
std::uint16_t number_of_tiles = 100;
40+
std::uint16_t number_of_tiles = 2;
3741
};
3842

3943
std::ostream& operator<<(std::ostream& os, const TestConfiguration& config) {
@@ -123,6 +127,9 @@ void PrefetchTest::ReportError(const olp::client::ApiError& error) {
123127
/// VersionedLayerClient
124128
///
125129
TEST_P(PrefetchTest, PrefetchPartitionsFromVersionedLayer) {
130+
// Enable only errors to have a short output.
131+
olp::logging::Log::setLevel(olp::logging::Level::Warning);
132+
126133
const auto& parameter = GetParam();
127134

128135
auto settings = CreateCatalogClientSettings();
@@ -165,6 +172,8 @@ TEST_P(PrefetchTest, PrefetchPartitionsFromVersionedLayer) {
165172
TestConfiguration ShortRunningTestWithNullCache() {
166173
TestConfiguration configuration;
167174
SetNullCacheConfiguration(configuration);
175+
configuration.task_scheduler_capacity =
176+
configuration.calling_thread_count * 3;
168177
configuration.configuration_name = "short_test_null_cache";
169178
return configuration;
170179
}
@@ -175,6 +184,8 @@ TestConfiguration ShortRunningTestWithNullCache() {
175184
TestConfiguration ShortRunningTestWithMemoryCache() {
176185
TestConfiguration configuration;
177186
SetDefaultCacheConfiguration(configuration);
187+
configuration.task_scheduler_capacity =
188+
configuration.calling_thread_count * 3;
178189
configuration.configuration_name = "short_test_memory_cache";
179190
return configuration;
180191
}
@@ -185,6 +196,8 @@ TestConfiguration ShortRunningTestWithMemoryCache() {
185196
TestConfiguration ShortRunningTestWithMutableCache() {
186197
TestConfiguration configuration;
187198
SetDiskCacheConfiguration(configuration);
199+
configuration.task_scheduler_capacity =
200+
configuration.calling_thread_count * 3;
188201
configuration.configuration_name = "short_test_disk_cache";
189202
return configuration;
190203
}

tests/utils/olp_server/server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ const requestHandler = async (request, response) => {
9090
}
9191

9292
// For debug purpose
93-
console.log(url)
93+
//console.log(url)
9494

9595
processor = handleRequest
9696

0 commit comments

Comments
 (0)