summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt2
-rw-r--r--common/CMakeLists.txt4
-rw-r--r--common/commands.h5
-rw-r--r--common/console.h4
-rw-r--r--common/storage.h3
-rw-r--r--common/storage_unqlite.cpp4
-rw-r--r--common/unqlite/unqlite.h2
-rw-r--r--tests/storagebenchmark.cpp11
8 files changed, 18 insertions, 17 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3f86163..0373671 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -36,7 +36,7 @@ endfunction(generate_flatbuffers)
36 36
37set(CMAKE_AUTOMOC ON) 37set(CMAKE_AUTOMOC ON)
38add_definitions("-Wall -std=c++0x") 38add_definitions("-Wall -std=c++0x")
39include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${FLATBUFFERS_INCLUDE_DIR}) 39include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/common ${FLATBUFFERS_INCLUDE_DIR})
40 40
41configure_file(hawd.conf hawd.conf) 41configure_file(hawd.conf hawd.conf)
42 42
diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt
index dc9a670..c0cc7d9 100644
--- a/common/CMakeLists.txt
+++ b/common/CMakeLists.txt
@@ -16,8 +16,8 @@ set(command_SRCS
16 storage_common.cpp 16 storage_common.cpp
17 ${storage_SRCS}) 17 ${storage_SRCS})
18 18
19message("We have: ${storage_SRCS}") 19add_library(${PROJECT_NAME} SHARED ${command_SRCS})
20add_library(${PROJECT_NAME} ${command_SRCS}) 20generate_export_header(${PROJECT_NAME} BASE_NAME Akonadi2Common EXPORT_FILE_NAME akonadi2common_export.h)
21SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES LINKER_LANGUAGE CXX) 21SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES LINKER_LANGUAGE CXX)
22qt5_use_modules(${PROJECT_NAME} Widgets) 22qt5_use_modules(${PROJECT_NAME} Widgets)
23target_link_libraries(${PROJECT_NAME} ${storage_LIBS}) 23target_link_libraries(${PROJECT_NAME} ${storage_LIBS})
diff --git a/common/commands.h b/common/commands.h
index 534308d..5f2b006 100644
--- a/common/commands.h
+++ b/common/commands.h
@@ -1,5 +1,6 @@
1#pragma once 1#pragma once
2 2
3#include <akonadi2common_export.h>
3#include <flatbuffers/flatbuffers.h> 4#include <flatbuffers/flatbuffers.h>
4 5
5class QIODevice; 6class QIODevice;
@@ -14,6 +15,6 @@ enum CommandIds {
14 CustomCommand = 0xffff 15 CustomCommand = 0xffff
15}; 16};
16 17
17void write(QIODevice *device, int commandId, flatbuffers::FlatBufferBuilder &fbb); 18void AKONADI2COMMON_EXPORT write(QIODevice *device, int commandId, flatbuffers::FlatBufferBuilder &fbb);
18 19
19} \ No newline at end of file 20}
diff --git a/common/console.h b/common/console.h
index d36ce05..0df5c38 100644
--- a/common/console.h
+++ b/common/console.h
@@ -1,11 +1,13 @@
1#pragma once 1#pragma once
2 2
3#include <akonadi2common_export.h>
4
3#include <QTime> 5#include <QTime>
4#include <QWidget> 6#include <QWidget>
5 7
6class QTextBrowser; 8class QTextBrowser;
7 9
8class Console : public QWidget 10class AKONADI2COMMON_EXPORT Console : public QWidget
9{ 11{
10 Q_OBJECT 12 Q_OBJECT
11public: 13public:
diff --git a/common/storage.h b/common/storage.h
index 3f14e83..2fac068 100644
--- a/common/storage.h
+++ b/common/storage.h
@@ -1,10 +1,11 @@
1#pragma once 1#pragma once
2 2
3#include <akonadi2common_export.h>
3#include <string> 4#include <string>
4#include <functional> 5#include <functional>
5#include <QString> 6#include <QString>
6 7
7class Storage { 8class AKONADI2COMMON_EXPORT Storage {
8public: 9public:
9 enum AccessMode { ReadOnly, ReadWrite }; 10 enum AccessMode { ReadOnly, ReadWrite };
10 11
diff --git a/common/storage_unqlite.cpp b/common/storage_unqlite.cpp
index f94643f..2bdfc2c 100644
--- a/common/storage_unqlite.cpp
+++ b/common/storage_unqlite.cpp
@@ -9,7 +9,9 @@
9#include <QString> 9#include <QString>
10#include <QTime> 10#include <QTime>
11 11
12#include "unqlite/unqlite.h" 12extern "C" {
13 #include "unqlite/unqlite.h"
14}
13 15
14static const char *s_unqliteDir = "/unqlite/"; 16static const char *s_unqliteDir = "/unqlite/";
15 17
diff --git a/common/unqlite/unqlite.h b/common/unqlite/unqlite.h
index 2a2b1ad..bf7ee50 100644
--- a/common/unqlite/unqlite.h
+++ b/common/unqlite/unqlite.h
@@ -946,4 +946,4 @@ UNQLITE_APIEXPORT const char * unqlite_lib_signature(void);
946UNQLITE_APIEXPORT const char * unqlite_lib_ident(void); 946UNQLITE_APIEXPORT const char * unqlite_lib_ident(void);
947UNQLITE_APIEXPORT const char * unqlite_lib_copyright(void); 947UNQLITE_APIEXPORT const char * unqlite_lib_copyright(void);
948 948
949#endif /* _UNQLITE_H_ */ \ No newline at end of file 949#endif /* _UNQLITE_H_ */
diff --git a/tests/storagebenchmark.cpp b/tests/storagebenchmark.cpp
index 130753f..33898d3 100644
--- a/tests/storagebenchmark.cpp
+++ b/tests/storagebenchmark.cpp
@@ -93,16 +93,11 @@ private Q_SLOTS:
93 93
94 time.start(); 94 time.start();
95 { 95 {
96 auto event = createEvent(); 96 auto event = std::string(500, '1');//createEvent();
97
98 if (store) store->startTransaction();
97 for (int i = 0; i < count; i++) { 99 for (int i = 0; i < count; i++) {
98 if (store) { 100 if (store) {
99 if (i % 10000 == 0) {
100 if (i > 0) {
101 store->commitTransaction();
102 }
103 store->startTransaction();
104 }
105
106 store->write(keyPrefix + std::to_string(i), event); 101 store->write(keyPrefix + std::to_string(i), event);
107 } else { 102 } else {
108 myfile << event; 103 myfile << event;