diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-01-20 19:07:07 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-01-20 19:07:07 +0100 |
commit | bdb01c2c068df326f5a8328ed1492ab1bea388c5 (patch) | |
tree | 25c2ee1b29bc481b6914c244ed9ca194b1415d16 /tests/dummyresourcewritebenchmark.cpp | |
parent | 17e7ee40c9185c0505883853345fd6024c675b1a (diff) | |
download | sink-bdb01c2c068df326f5a8328ed1492ab1bea388c5.tar.gz sink-bdb01c2c068df326f5a8328ed1492ab1bea388c5.zip |
Renamed Akonadi2 to Sink
(except for documentation).
Diffstat (limited to 'tests/dummyresourcewritebenchmark.cpp')
-rw-r--r-- | tests/dummyresourcewritebenchmark.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/tests/dummyresourcewritebenchmark.cpp b/tests/dummyresourcewritebenchmark.cpp index 1e7f1ef..1a8893b 100644 --- a/tests/dummyresourcewritebenchmark.cpp +++ b/tests/dummyresourcewritebenchmark.cpp | |||
@@ -60,33 +60,33 @@ static QByteArray createEntityBuffer(int &bufferSize) | |||
60 | eventFbb.Clear(); | 60 | eventFbb.Clear(); |
61 | { | 61 | { |
62 | auto summary = eventFbb.CreateString("summary"); | 62 | auto summary = eventFbb.CreateString("summary"); |
63 | Akonadi2::ApplicationDomain::Buffer::EventBuilder eventBuilder(eventFbb); | 63 | Sink::ApplicationDomain::Buffer::EventBuilder eventBuilder(eventFbb); |
64 | eventBuilder.add_summary(summary); | 64 | eventBuilder.add_summary(summary); |
65 | auto eventLocation = eventBuilder.Finish(); | 65 | auto eventLocation = eventBuilder.Finish(); |
66 | Akonadi2::ApplicationDomain::Buffer::FinishEventBuffer(eventFbb, eventLocation); | 66 | Sink::ApplicationDomain::Buffer::FinishEventBuffer(eventFbb, eventLocation); |
67 | } | 67 | } |
68 | 68 | ||
69 | flatbuffers::FlatBufferBuilder localFbb; | 69 | flatbuffers::FlatBufferBuilder localFbb; |
70 | { | 70 | { |
71 | auto uid = localFbb.CreateString("testuid"); | 71 | auto uid = localFbb.CreateString("testuid"); |
72 | auto localBuilder = Akonadi2::ApplicationDomain::Buffer::EventBuilder(localFbb); | 72 | auto localBuilder = Sink::ApplicationDomain::Buffer::EventBuilder(localFbb); |
73 | localBuilder.add_uid(uid); | 73 | localBuilder.add_uid(uid); |
74 | auto location = localBuilder.Finish(); | 74 | auto location = localBuilder.Finish(); |
75 | Akonadi2::ApplicationDomain::Buffer::FinishEventBuffer(localFbb, location); | 75 | Sink::ApplicationDomain::Buffer::FinishEventBuffer(localFbb, location); |
76 | } | 76 | } |
77 | 77 | ||
78 | flatbuffers::FlatBufferBuilder entityFbb; | 78 | flatbuffers::FlatBufferBuilder entityFbb; |
79 | Akonadi2::EntityBuffer::assembleEntityBuffer(entityFbb, 0, 0, eventFbb.GetBufferPointer(), eventFbb.GetSize(), localFbb.GetBufferPointer(), localFbb.GetSize()); | 79 | Sink::EntityBuffer::assembleEntityBuffer(entityFbb, 0, 0, eventFbb.GetBufferPointer(), eventFbb.GetSize(), localFbb.GetBufferPointer(), localFbb.GetSize()); |
80 | bufferSize = entityFbb.GetSize(); | 80 | bufferSize = entityFbb.GetSize(); |
81 | 81 | ||
82 | flatbuffers::FlatBufferBuilder fbb; | 82 | flatbuffers::FlatBufferBuilder fbb; |
83 | auto type = fbb.CreateString(Akonadi2::ApplicationDomain::getTypeName<Akonadi2::ApplicationDomain::Event>().toStdString().data()); | 83 | auto type = fbb.CreateString(Sink::ApplicationDomain::getTypeName<Sink::ApplicationDomain::Event>().toStdString().data()); |
84 | auto delta = fbb.CreateVector<uint8_t>(entityFbb.GetBufferPointer(), entityFbb.GetSize()); | 84 | auto delta = fbb.CreateVector<uint8_t>(entityFbb.GetBufferPointer(), entityFbb.GetSize()); |
85 | Akonadi2::Commands::CreateEntityBuilder builder(fbb); | 85 | Sink::Commands::CreateEntityBuilder builder(fbb); |
86 | builder.add_domainType(type); | 86 | builder.add_domainType(type); |
87 | builder.add_delta(delta); | 87 | builder.add_delta(delta); |
88 | auto location = builder.Finish(); | 88 | auto location = builder.Finish(); |
89 | Akonadi2::Commands::FinishCreateEntityBuffer(fbb, location); | 89 | Sink::Commands::FinishCreateEntityBuffer(fbb, location); |
90 | 90 | ||
91 | return QByteArray(reinterpret_cast<const char *>(fbb.GetBufferPointer()), fbb.GetSize()); | 91 | return QByteArray(reinterpret_cast<const char *>(fbb.GetBufferPointer()), fbb.GetSize()); |
92 | } | 92 | } |
@@ -109,7 +109,7 @@ class DummyResourceWriteBenchmark : public QObject | |||
109 | QTime time; | 109 | QTime time; |
110 | time.start(); | 110 | time.start(); |
111 | 111 | ||
112 | auto pipeline = QSharedPointer<Akonadi2::Pipeline>::create("org.kde.dummy.instance1"); | 112 | auto pipeline = QSharedPointer<Sink::Pipeline>::create("org.kde.dummy.instance1"); |
113 | DummyResource resource("org.kde.dummy.instance1", pipeline); | 113 | DummyResource resource("org.kde.dummy.instance1", pipeline); |
114 | 114 | ||
115 | int bufferSize = 0; | 115 | int bufferSize = 0; |
@@ -117,7 +117,7 @@ class DummyResourceWriteBenchmark : public QObject | |||
117 | 117 | ||
118 | const auto startingRss = getCurrentRSS(); | 118 | const auto startingRss = getCurrentRSS(); |
119 | for (int i = 0; i < num; i++) { | 119 | for (int i = 0; i < num; i++) { |
120 | resource.processCommand(Akonadi2::Commands::CreateEntityCommand, command); | 120 | resource.processCommand(Sink::Commands::CreateEntityCommand, command); |
121 | } | 121 | } |
122 | auto appendTime = time.elapsed(); | 122 | auto appendTime = time.elapsed(); |
123 | auto bufferSizeTotal = bufferSize * num; | 123 | auto bufferSizeTotal = bufferSize * num; |
@@ -174,7 +174,7 @@ class DummyResourceWriteBenchmark : public QObject | |||
174 | private Q_SLOTS: | 174 | private Q_SLOTS: |
175 | void initTestCase() | 175 | void initTestCase() |
176 | { | 176 | { |
177 | Akonadi2::Log::setDebugOutputLevel(Akonadi2::Log::Warning); | 177 | Sink::Log::setDebugOutputLevel(Sink::Log::Warning); |
178 | } | 178 | } |
179 | 179 | ||
180 | void cleanup() | 180 | void cleanup() |
@@ -215,7 +215,7 @@ private Q_SLOTS: | |||
215 | 215 | ||
216 | void getFreePages() | 216 | void getFreePages() |
217 | { | 217 | { |
218 | std::system(QString("mdb_stat %1/%2 -ff").arg(Akonadi2::storageLocation()).arg("org.kde.dummy.instance1").toLatin1().constData()); | 218 | std::system(QString("mdb_stat %1/%2 -ff").arg(Sink::storageLocation()).arg("org.kde.dummy.instance1").toLatin1().constData()); |
219 | } | 219 | } |
220 | 220 | ||
221 | //This allows to run individual parts without doing a cleanup, but still cleaning up normally | 221 | //This allows to run individual parts without doing a cleanup, but still cleaning up normally |