-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbench_common.h
More file actions
executable file
·54 lines (48 loc) · 1.49 KB
/
bench_common.h
File metadata and controls
executable file
·54 lines (48 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//
// @file : bench_common.h
// @purpose : A header file containing the common structures of benchmark
// @author : Prof. Phuong Hoai Ha & Ibrahim Umar & Koen van Greevenbroek & Hung Ngoc Phan
// @project : [INF-3210 Green Computing] Coursework Assignment
// @licensed: Copyright (C) 2021 Green Computing Group. Subject to the GNU General Public License 3.0
// @created : someday in 2016
// @modified: 23/08/2021
//
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
#ifndef _BENCH_COMMON_H_
#define _BENCH_COMMON_H_
//
// @brief: The size of key, value in bytes
//
#define NKEY 64
#define NVAL 256
//
// @brief: A dictionary of query types
//
enum query_types{
query_put=0,
query_get,
query_del,
};
//
// @brief: A defined format of each query. Each query contains a key and a type.
//
typedef struct __attribute__((__packed__)) {
char hashed_key[NKEY];
char type;
} query;
//
// @brief: A placeholder to store the output statistics from the benchmark
//
typedef struct __attribute__((__packed__)) {
double grand_total_time;
double total_tput;
double total_time;
size_t total_hits;
size_t total_miss;
size_t total_gets;
size_t total_puts;
size_t num_threads;
} result_t;
#endif