diff options
Diffstat (limited to 'tests/dummyresourcebenchmark.cpp')
-rw-r--r-- | tests/dummyresourcebenchmark.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/tests/dummyresourcebenchmark.cpp b/tests/dummyresourcebenchmark.cpp index d5f98c3..72562c3 100644 --- a/tests/dummyresourcebenchmark.cpp +++ b/tests/dummyresourcebenchmark.cpp | |||
@@ -34,9 +34,9 @@ private slots: | |||
34 | void initTestCase() | 34 | void initTestCase() |
35 | { | 35 | { |
36 | Sink::Log::setDebugOutputLevel(Sink::Log::Warning); | 36 | Sink::Log::setDebugOutputLevel(Sink::Log::Warning); |
37 | auto factory = Sink::ResourceFactory::load("org.kde.dummy"); | 37 | auto factory = Sink::ResourceFactory::load("sink.dummy"); |
38 | QVERIFY(factory); | 38 | QVERIFY(factory); |
39 | ResourceConfig::addResource("org.kde.dummy.instance1", "org.kde.dummy"); | 39 | ResourceConfig::addResource("sink.dummy.instance1", "sink.dummy"); |
40 | num = 5000; | 40 | num = 5000; |
41 | } | 41 | } |
42 | 42 | ||
@@ -76,21 +76,21 @@ private slots: | |||
76 | void testCommandResponsiveness() | 76 | void testCommandResponsiveness() |
77 | { | 77 | { |
78 | // Test responsiveness including starting the process. | 78 | // Test responsiveness including starting the process. |
79 | Sink::Store::removeDataFromDisk("org.kde.dummy.instance1").exec().waitForFinished(); | 79 | Sink::Store::removeDataFromDisk("sink.dummy.instance1").exec().waitForFinished(); |
80 | 80 | ||
81 | QTime time; | 81 | QTime time; |
82 | time.start(); | 82 | time.start(); |
83 | 83 | ||
84 | Sink::ApplicationDomain::Event event("org.kde.dummy.instance1"); | 84 | Sink::ApplicationDomain::Event event("sink.dummy.instance1"); |
85 | event.setProperty("uid", "testuid"); | 85 | event.setProperty("uid", "testuid"); |
86 | QCOMPARE(event.getProperty("uid").toByteArray(), QByteArray("testuid")); | 86 | QCOMPARE(event.getProperty("uid").toByteArray(), QByteArray("testuid")); |
87 | event.setProperty("summary", "summaryValue"); | 87 | event.setProperty("summary", "summaryValue"); |
88 | 88 | ||
89 | auto notifier = QSharedPointer<Sink::Notifier>::create("org.kde.dummy.instance1", "org.kde.dummy"); | 89 | auto notifier = QSharedPointer<Sink::Notifier>::create("sink.dummy.instance1", "sink.dummy"); |
90 | bool gotNotification = false; | 90 | bool gotNotification = false; |
91 | int duration = 0; | 91 | int duration = 0; |
92 | notifier->registerHandler([&gotNotification, &duration, &time](const Sink::Notification ¬ification) { | 92 | notifier->registerHandler([&gotNotification, &duration, &time](const Sink::Notification ¬ification) { |
93 | if (notification.type == Sink::Commands::NotificationType::NotificationType_RevisionUpdate) { | 93 | if (notification.type == Sink::Notification::RevisionUpdate) { |
94 | gotNotification = true; | 94 | gotNotification = true; |
95 | duration = time.elapsed(); | 95 | duration = time.elapsed(); |
96 | } | 96 | } |
@@ -102,19 +102,19 @@ private slots: | |||
102 | QTRY_VERIFY(gotNotification); | 102 | QTRY_VERIFY(gotNotification); |
103 | 103 | ||
104 | QVERIFY2(duration < 100, QString::fromLatin1("Processing a create command took more than 100ms: %1").arg(duration).toLatin1()); | 104 | QVERIFY2(duration < 100, QString::fromLatin1("Processing a create command took more than 100ms: %1").arg(duration).toLatin1()); |
105 | Sink::ResourceControl::shutdown("org.kde.dummy.instance1").exec().waitForFinished(); | 105 | Sink::ResourceControl::shutdown("sink.dummy.instance1").exec().waitForFinished(); |
106 | qDebug() << "Single command took [ms]: " << duration; | 106 | qDebug() << "Single command took [ms]: " << duration; |
107 | } | 107 | } |
108 | 108 | ||
109 | void testWriteToFacade() | 109 | void testWriteToFacade() |
110 | { | 110 | { |
111 | Sink::Store::removeDataFromDisk("org.kde.dummy.instance1").exec().waitForFinished(); | 111 | Sink::Store::removeDataFromDisk("sink.dummy.instance1").exec().waitForFinished(); |
112 | 112 | ||
113 | QTime time; | 113 | QTime time; |
114 | time.start(); | 114 | time.start(); |
115 | QList<KAsync::Future<void>> waitCondition; | 115 | QList<KAsync::Future<void>> waitCondition; |
116 | for (int i = 0; i < num; i++) { | 116 | for (int i = 0; i < num; i++) { |
117 | Sink::ApplicationDomain::Event event("org.kde.dummy.instance1"); | 117 | Sink::ApplicationDomain::Event event("sink.dummy.instance1"); |
118 | event.setProperty("uid", "testuid"); | 118 | event.setProperty("uid", "testuid"); |
119 | QCOMPARE(event.getProperty("uid").toByteArray(), QByteArray("testuid")); | 119 | QCOMPARE(event.getProperty("uid").toByteArray(), QByteArray("testuid")); |
120 | event.setProperty("summary", "summaryValue"); | 120 | event.setProperty("summary", "summaryValue"); |
@@ -126,7 +126,7 @@ private slots: | |||
126 | // Ensure everything is processed | 126 | // Ensure everything is processed |
127 | { | 127 | { |
128 | Sink::Query query; | 128 | Sink::Query query; |
129 | query.resources << "org.kde.dummy.instance1"; | 129 | query.resources << "sink.dummy.instance1"; |
130 | Sink::ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); | 130 | Sink::ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); |
131 | } | 131 | } |
132 | auto allProcessedTime = time.elapsed(); | 132 | auto allProcessedTime = time.elapsed(); |
@@ -140,7 +140,7 @@ private slots: | |||
140 | dataset.insertRow(row); | 140 | dataset.insertRow(row); |
141 | HAWD::Formatter::print(dataset); | 141 | HAWD::Formatter::print(dataset); |
142 | 142 | ||
143 | auto diskUsage = DummyResource::diskUsage("org.kde.dummy.instance1"); | 143 | auto diskUsage = DummyResource::diskUsage("sink.dummy.instance1"); |
144 | qDebug() << "Database size [kb]: " << diskUsage / 1024; | 144 | qDebug() << "Database size [kb]: " << diskUsage / 1024; |
145 | 145 | ||
146 | // Print memory layout, RSS is what is in memory | 146 | // Print memory layout, RSS is what is in memory |
@@ -155,7 +155,7 @@ private slots: | |||
155 | { | 155 | { |
156 | time.start(); | 156 | time.start(); |
157 | Sink::Query query; | 157 | Sink::Query query; |
158 | query.resources << "org.kde.dummy.instance1"; | 158 | query.resources << "sink.dummy.instance1"; |
159 | 159 | ||
160 | query.propertyFilter.insert("uid", Sink::Query::Comparator("testuid")); | 160 | query.propertyFilter.insert("uid", Sink::Query::Comparator("testuid")); |
161 | auto model = Sink::Store::loadModel<Sink::ApplicationDomain::Event>(query); | 161 | auto model = Sink::Store::loadModel<Sink::ApplicationDomain::Event>(query); |
@@ -173,12 +173,12 @@ private slots: | |||
173 | 173 | ||
174 | void testWriteInProcess() | 174 | void testWriteInProcess() |
175 | { | 175 | { |
176 | Sink::Store::removeDataFromDisk("org.kde.dummy.instance1").exec().waitForFinished(); | 176 | Sink::Store::removeDataFromDisk("sink.dummy.instance1").exec().waitForFinished(); |
177 | QTime time; | 177 | QTime time; |
178 | time.start(); | 178 | time.start(); |
179 | 179 | ||
180 | auto pipeline = QSharedPointer<Sink::Pipeline>::create("org.kde.dummy.instance1"); | 180 | auto pipeline = QSharedPointer<Sink::Pipeline>::create("sink.dummy.instance1"); |
181 | DummyResource resource("org.kde.dummy.instance1", pipeline); | 181 | DummyResource resource("sink.dummy.instance1", pipeline); |
182 | 182 | ||
183 | flatbuffers::FlatBufferBuilder eventFbb; | 183 | flatbuffers::FlatBufferBuilder eventFbb; |
184 | eventFbb.Clear(); | 184 | eventFbb.Clear(); |
@@ -261,7 +261,7 @@ private slots: | |||
261 | // This allows to run individual parts without doing a cleanup, but still cleaning up normally | 261 | // This allows to run individual parts without doing a cleanup, but still cleaning up normally |
262 | void testCleanupForCompleteTest() | 262 | void testCleanupForCompleteTest() |
263 | { | 263 | { |
264 | Sink::Store::removeDataFromDisk("org.kde.dummy.instance1").exec().waitForFinished(); | 264 | Sink::Store::removeDataFromDisk("sink.dummy.instance1").exec().waitForFinished(); |
265 | } | 265 | } |
266 | 266 | ||
267 | private: | 267 | private: |