Skip to content

Commit

Permalink
chore: add codecov config
Browse files Browse the repository at this point in the history
  • Loading branch information
zz-jason committed Aug 23, 2024
1 parent 613e752 commit 3c9e1a4
Show file tree
Hide file tree
Showing 4 changed files with 162 additions and 137 deletions.
2 changes: 1 addition & 1 deletion benchmarks/ycsb/YcsbFlags.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ DEFINE_string(ycsb_target, "leanstore",
"Ycsb target, available: unordered_map, leanstore, rocksdb, leveldb");
DEFINE_string(ycsb_cmd, "run", "Ycsb command, available: run, load");
DEFINE_string(ycsb_workload, "a", "Ycsb workload, available: a, b, c, d, e, f");
DEFINE_uint32(ycsb_threads, 4, "WorkerContext threads");
DEFINE_uint32(ycsb_threads, 4, "Worker threads");
DEFINE_uint64(ycsb_mem_kb, 1, "Max memory in KB to use");
DEFINE_uint64(ycsb_run_for_seconds, 300, "Run the benchmark for x seconds");

Expand Down
25 changes: 25 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
coverage:
round: down
range: 30..100
precision: 2
status:
patch:
default:
target: 60%
threshold: 1%
base: auto
project:
default:
target: 57%
threshold: 1%
base: auto

ignore:
- "benchmarks"
- "build"
- "dist"
- "docker"
- "docs"
- "examples"
- "scripts"
- "tests"
268 changes: 134 additions & 134 deletions include/leanstore-c/StoreOption.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,194 +8,194 @@
extern "C" {
#endif
//! The log level
typedef enum LogLevel {
kDebug = 0,
kInfo,
kWarn,
kError,
} LogLevel;
//! The log level
typedef enum LogLevel {
kDebug = 0,
kInfo,
kWarn,
kError,
} LogLevel;

//! The options for creating a new store.
typedef struct StoreOption {
// ---------------------------------------------------------------------------
// Store related options
// ---------------------------------------------------------------------------
//! The options for creating a new store.
typedef struct StoreOption {
// ---------------------------------------------------------------------------
// Store related options
// ---------------------------------------------------------------------------

//! Whether to create store from scratch.
bool mCreateFromScratch;
//! Whether to create store from scratch.
bool mCreateFromScratch;

//! The directory for all the database files.
const char* mStoreDir;
//! The directory for all the database files.
const char* mStoreDir;

// ---------------------------------------------------------------------------
// log related options
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
// log related options
// ---------------------------------------------------------------------------

//! The log level
LogLevel mLogLevel;
//! The log level
LogLevel mLogLevel;

// ---------------------------------------------------------------------------
// WorkerContext thread related options
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
// Worker thread related options
// ---------------------------------------------------------------------------

//! The number of worker threads.
uint64_t mWorkerThreads;
//! The number of worker threads.
uint64_t mWorkerThreads;

//! The WAL buffer size for each worker (bytes).
uint64_t mWalBufferSize;
//! The WAL buffer size for each worker (bytes).
uint64_t mWalBufferSize;

// ---------------------------------------------------------------------------
// Buffer pool related options
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
// Buffer pool related options
// ---------------------------------------------------------------------------

//! The page size (bytes). For buffer manager.
uint64_t mPageSize;
//! The page size (bytes). For buffer manager.
uint64_t mPageSize;

uint64_t mBufferFrameSize;
uint64_t mBufferFrameSize;

//! The number of partitions. For buffer manager.
uint32_t mNumPartitions;
//! The number of partitions. For buffer manager.
uint32_t mNumPartitions;

//! The buffer pool size (bytes). For buffer manager.
uint64_t mBufferPoolSize;
//! The buffer pool size (bytes). For buffer manager.
uint64_t mBufferPoolSize;

//! The free percentage of the buffer pool. In the range of [0, 100].
uint32_t mFreePct;
//! The free percentage of the buffer pool. In the range of [0, 100].
uint32_t mFreePct;

//! The number of page evictor threads.
uint32_t mNumBufferProviders;
//! The number of page evictor threads.
uint32_t mNumBufferProviders;

//! The async buffer
uint32_t mBufferWriteBatchSize;
//! The async buffer
uint32_t mBufferWriteBatchSize;

//! Whether to perform crc check for buffer frames.
bool mEnableBufferCrcCheck;
//! Whether to perform crc check for buffer frames.
bool mEnableBufferCrcCheck;

//! BufferFrame recycle batch size. Everytime a batch of buffer frames is
//! randomly picked and verified by page evictors, some of them are COOLed,
//! some of them are EVICted.
uint64_t mBufferFrameRecycleBatchSize;
//! BufferFrame recycle batch size. Everytime a batch of buffer frames is
//! randomly picked and verified by page evictors, some of them are COOLed,
//! some of them are EVICted.
uint64_t mBufferFrameRecycleBatchSize;

//! Whether to reclaim unused free page ids
bool mEnableReclaimPageIds;
//! Whether to reclaim unused free page ids
bool mEnableReclaimPageIds;

// ---------------------------------------------------------------------------
// Logging and recovery related options
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
// Logging and recovery related options
// ---------------------------------------------------------------------------

//! Whether to enable write-ahead log.
bool mEnableWal;
//! Whether to enable write-ahead log.
bool mEnableWal;

//! Whether to execute fsync after each WAL write.
bool mEnableWalFsync;
//! Whether to execute fsync after each WAL write.
bool mEnableWalFsync;

// ---------------------------------------------------------------------------
// Generic BTree related options
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
// Generic BTree related options
// ---------------------------------------------------------------------------

//! Whether to enable bulk insert.
bool mEnableBulkInsert;
//! Whether to enable bulk insert.
bool mEnableBulkInsert;

//! Whether to enable X-Merge
bool mEnableXMerge;
//! Whether to enable X-Merge
bool mEnableXMerge;

//! The number of children to merge in X-Merge
uint64_t mXMergeK;
//! The number of children to merge in X-Merge
uint64_t mXMergeK;

//! The target percentage of the number of children to merge in X-Merge
double mXMergeTargetPct;
//! The target percentage of the number of children to merge in X-Merge
double mXMergeTargetPct;

//! Whether to enable contention split.
bool mEnableContentionSplit;
//! Whether to enable contention split.
bool mEnableContentionSplit;

//! Contention split probability, as exponent of 2
uint64_t mContentionSplitProbility;
//! Contention split probability, as exponent of 2
uint64_t mContentionSplitProbility;

//! Contention stats sample probability, as exponent of 2
uint64_t mContentionSplitSampleProbability;
//! Contention stats sample probability, as exponent of 2
uint64_t mContentionSplitSampleProbability;

//! Contention percentage to trigger the split, in the range of [0, 100].
uint64_t mContentionSplitThresholdPct;
//! Contention percentage to trigger the split, in the range of [0, 100].
uint64_t mContentionSplitThresholdPct;

//! Whether to enable btree hints optimization. Available options:
//! 0: disabled
//! 1: serial
//! 2: AVX512
int64_t mBTreeHints;
//! Whether to enable btree hints optimization. Available options:
//! 0: disabled
//! 1: serial
//! 2: AVX512
int64_t mBTreeHints;

//! Whether to enable heads optimization in LowerBound search.
bool mEnableHeadOptimization;
//! Whether to enable heads optimization in LowerBound search.
bool mEnableHeadOptimization;

//! Whether to enable optimistic scan. Jump to next leaf directly if the
//! pointer in the parent has not changed
bool mEnableOptimisticScan;
//! Whether to enable optimistic scan. Jump to next leaf directly if the
//! pointer in the parent has not changed
bool mEnableOptimisticScan;

// ---------------------------------------------------------------------------
// Transaction related options
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
// Transaction related options
// ---------------------------------------------------------------------------

//! Whether to enable long running transaction.
bool mEnableLongRunningTx;
//! Whether to enable long running transaction.
bool mEnableLongRunningTx;

//! Whether to enable fat tuple.
bool mEnableFatTuple;
//! Whether to enable fat tuple.
bool mEnableFatTuple;

//! Whether to enable garbage collection.
bool mEnableGc;
//! Whether to enable garbage collection.
bool mEnableGc;

//! Whether to enable eager garbage collection. To enable eager garbage
//! collection, the garbage collection must be enabled first. Once enabled,
//! the garbage collection will be triggered after each transaction commit and
//! abort.
bool mEnableEagerGc;
//! Whether to enable eager garbage collection. To enable eager garbage
//! collection, the garbage collection must be enabled first. Once enabled,
//! the garbage collection will be triggered after each transaction commit and
//! abort.
bool mEnableEagerGc;

// ---------------------------------------------------------------------------
// Metrics related options
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
// Metrics related options
// ---------------------------------------------------------------------------

//! Whether to enable metrics.
bool mEnableMetrics;
//! Whether to enable metrics.
bool mEnableMetrics;

//! The metrics port.
int32_t mMetricsPort;
//! The metrics port.
int32_t mMetricsPort;

//! Whether to enable cpu counters.
bool mEnableCpuCounters;
//! Whether to enable cpu counters.
bool mEnableCpuCounters;

//! Whether to enable time measure.
bool mEnableTimeMeasure;
//! Whether to enable time measure.
bool mEnableTimeMeasure;

//! Whether to enable perf events.
bool mEnablePerfEvents;
//! Whether to enable perf events.
bool mEnablePerfEvents;

} StoreOption;
} StoreOption;

//! Create a new store option.
//! @param storeDir the directory for all the database files. The string content is deep copied to
//! the created store option.
StoreOption* CreateStoreOption(const char* storeDir);
//! Create a new store option.
//! @param storeDir the directory for all the database files. The string content is deep copied to
//! the created store option.
StoreOption* CreateStoreOption(const char* storeDir);

//! Create a new store option from an existing store option.
//! @param storeDir the existing store option.
StoreOption* CreateStoreOptionFrom(const StoreOption* storeDir);
//! Create a new store option from an existing store option.
//! @param storeDir the existing store option.
StoreOption* CreateStoreOptionFrom(const StoreOption* storeDir);

//! Destroy a store option.
//! @param option the store option to destroy.
void DestroyStoreOption(const StoreOption* option);
//! Destroy a store option.
//! @param option the store option to destroy.
void DestroyStoreOption(const StoreOption* option);

//! The options for creating a new BTree.
typedef struct BTreeConfig {
//! Whether to enable write-ahead log.
bool mEnableWal;
//! The options for creating a new BTree.
typedef struct BTreeConfig {
//! Whether to enable write-ahead log.
bool mEnableWal;

//! Whether to enable bulk insert.
bool mUseBulkInsert;
//! Whether to enable bulk insert.
bool mUseBulkInsert;

} BTreeConfig;
} BTreeConfig;

#ifdef __cplusplus
}
#endif

#endif // LEANSTORE_STORE_OPTION_H
#endif // LEANSTORE_STORE_OPTION_H
4 changes: 2 additions & 2 deletions src/leanstore-c/StoreOption.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ static const StoreOption kDefaultStoreOption = {
// log related options
.mLogLevel = LogLevel::kInfo,

// WorkerContext thread related options
// Worker thread related options
.mWorkerThreads = 4,
.mWalBufferSize = 10 * 1024 * 1024,

Expand Down Expand Up @@ -96,4 +96,4 @@ void DestroyStoreOption(const StoreOption* option) {
}
delete option;
}
}
}

0 comments on commit 3c9e1a4

Please sign in to comment.