szaszm commented on a change in pull request #716: MINIFICPP-1127 - Provenance repo performance should be improved URL: https://github.com/apache/nifi-minifi-cpp/pull/716#discussion_r375217100
########## File path: libminifi/test/rocksdb-tests/DBProvenanceRepositoryTests.cpp ########## @@ -0,0 +1,122 @@ +/** + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "ProvenanceRepository.h" +#include "../TestBase.h" +#include <array> +#include <chrono> +#include <vector> +#include <random> + +#define TEST_PROVENANCE_STORAGE_SIZE (1024*100) // 100 KB +#define TEST_MAX_PROVENANCE_STORAGE_SIZE (100*1024*1024) // 100 MB + +#define TEST_PROVENANCE_ENTRY_LIFE_TIME (1000) // 1 sec + +void generateData(std::vector<char>& data) { Review comment: I prefer using return values over out params for returning values. They do it differently in C because C folks don't have exceptions to signal errors. My suggestion: `std::vector<char> generate_random_bytes(const size_t n)` I like the implementation, clean and beautiful. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
