diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-12-06 19:12:47 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-12-06 19:13:05 +0100 |
commit | cd206b3a720807301f1b1707698c4a405da89217 (patch) | |
tree | 084c8afc2e6cadb72c194a2acded26a1409151ee | |
parent | ede78a9840ea6c30244a2cb161cfd1cee63b8283 (diff) | |
download | sink-cd206b3a720807301f1b1707698c4a405da89217.tar.gz sink-cd206b3a720807301f1b1707698c4a405da89217.zip |
Debug output
-rw-r--r-- | common/commandprocessor.cpp | 1 | ||||
-rw-r--r-- | common/pipeline.cpp | 2 | ||||
-rw-r--r-- | common/storage/entitystore.cpp | 6 | ||||
-rw-r--r-- | common/store.cpp | 5 | ||||
-rw-r--r-- | synchronizer/main.cpp | 2 |
5 files changed, 10 insertions, 6 deletions
diff --git a/common/commandprocessor.cpp b/common/commandprocessor.cpp index 06ee142..20fcf3a 100644 --- a/common/commandprocessor.cpp +++ b/common/commandprocessor.cpp | |||
@@ -210,7 +210,6 @@ KAsync::Job<qint64> CommandProcessor::processQueuedCommand(const QByteArray &dat | |||
210 | } | 210 | } |
211 | auto queuedCommand = Sink::GetQueuedCommand(data.constData()); | 211 | auto queuedCommand = Sink::GetQueuedCommand(data.constData()); |
212 | const auto commandId = queuedCommand->commandId(); | 212 | const auto commandId = queuedCommand->commandId(); |
213 | SinkTrace() << "Dequeued Command: " << Sink::Commands::name(commandId); | ||
214 | return processQueuedCommand(queuedCommand) | 213 | return processQueuedCommand(queuedCommand) |
215 | .then<qint64, qint64>( | 214 | .then<qint64, qint64>( |
216 | [this, commandId](const KAsync::Error &error, qint64 createdRevision) -> KAsync::Job<qint64> { | 215 | [this, commandId](const KAsync::Error &error, qint64 createdRevision) -> KAsync::Job<qint64> { |
diff --git a/common/pipeline.cpp b/common/pipeline.cpp index b94e3f0..1620667 100644 --- a/common/pipeline.cpp +++ b/common/pipeline.cpp | |||
@@ -109,7 +109,7 @@ void Pipeline::commit() | |||
109 | } | 109 | } |
110 | const auto revision = d->entityStore.maxRevision(); | 110 | const auto revision = d->entityStore.maxRevision(); |
111 | const auto elapsed = d->transactionTime.elapsed(); | 111 | const auto elapsed = d->transactionTime.elapsed(); |
112 | SinkLog() << "Committing revision: " << revision << ":" << d->transactionItemCount << " items in: " << Log::TraceTime(elapsed) << " " | 112 | SinkTrace() << "Committing revision: " << revision << ":" << d->transactionItemCount << " items in: " << Log::TraceTime(elapsed) << " " |
113 | << (double)elapsed / (double)qMax(d->transactionItemCount, 1) << "[ms/item]"; | 113 | << (double)elapsed / (double)qMax(d->transactionItemCount, 1) << "[ms/item]"; |
114 | d->entityStore.commitTransaction(); | 114 | d->entityStore.commitTransaction(); |
115 | if (d->revisionChanged) { | 115 | if (d->revisionChanged) { |
diff --git a/common/storage/entitystore.cpp b/common/storage/entitystore.cpp index 1417861..7414f49 100644 --- a/common/storage/entitystore.cpp +++ b/common/storage/entitystore.cpp | |||
@@ -130,6 +130,8 @@ bool EntityStore::add(const QByteArray &type, const ApplicationDomain::Applicati | |||
130 | auto entity = *ApplicationDomain::ApplicationDomainType::getInMemoryRepresentation<ApplicationDomain::ApplicationDomainType>(entity_, entity_.availableProperties()); | 130 | auto entity = *ApplicationDomain::ApplicationDomainType::getInMemoryRepresentation<ApplicationDomain::ApplicationDomainType>(entity_, entity_.availableProperties()); |
131 | entity.setChangedProperties(entity.availableProperties().toSet()); | 131 | entity.setChangedProperties(entity.availableProperties().toSet()); |
132 | 132 | ||
133 | SinkTrace() << "New entity " << entity; | ||
134 | |||
133 | preprocess(entity); | 135 | preprocess(entity); |
134 | d->typeIndex(type).add(entity.identifier(), entity, d->transaction); | 136 | d->typeIndex(type).add(entity.identifier(), entity, d->transaction); |
135 | 137 | ||
@@ -205,7 +207,7 @@ bool EntityStore::modify(const QByteArray &type, const ApplicationDomain::Applic | |||
205 | } | 207 | } |
206 | 208 | ||
207 | newEntity.setChangedProperties(newEntity.availableProperties().toSet()); | 209 | newEntity.setChangedProperties(newEntity.availableProperties().toSet()); |
208 | SinkTrace() << "All properties: " << newEntity.availableProperties(); | 210 | SinkTrace() << "Modified entity " << newEntity; |
209 | 211 | ||
210 | flatbuffers::FlatBufferBuilder fbb; | 212 | flatbuffers::FlatBufferBuilder fbb; |
211 | d->resourceContext.adaptorFactory(type).createBuffer(newEntity, fbb, metadataFbb.GetBufferPointer(), metadataFbb.GetSize()); | 213 | d->resourceContext.adaptorFactory(type).createBuffer(newEntity, fbb, metadataFbb.GetBufferPointer(), metadataFbb.GetSize()); |
@@ -251,6 +253,8 @@ bool EntityStore::remove(const QByteArray &type, const QByteArray &uid, bool rep | |||
251 | preprocess(current); | 253 | preprocess(current); |
252 | d->typeIndex(type).remove(current.identifier(), current, d->transaction); | 254 | d->typeIndex(type).remove(current.identifier(), current, d->transaction); |
253 | 255 | ||
256 | SinkTrace() << "Removed entity " << current; | ||
257 | |||
254 | const qint64 newRevision = DataStore::maxRevision(d->transaction) + 1; | 258 | const qint64 newRevision = DataStore::maxRevision(d->transaction) + 1; |
255 | 259 | ||
256 | // Add metadata buffer | 260 | // Add metadata buffer |
diff --git a/common/store.cpp b/common/store.cpp index ef8a593..477b852 100644 --- a/common/store.cpp +++ b/common/store.cpp | |||
@@ -273,7 +273,7 @@ KAsync::Job<void> Store::removeDataFromDisk(const QByteArray &identifier) | |||
273 | 273 | ||
274 | static KAsync::Job<void> synchronize(const QByteArray &resource, const Sink::SyncScope &scope) | 274 | static KAsync::Job<void> synchronize(const QByteArray &resource, const Sink::SyncScope &scope) |
275 | { | 275 | { |
276 | SinkTrace() << "Synchronizing " << resource; | 276 | SinkLog() << "Synchronizing " << resource; |
277 | auto resourceAccess = ResourceAccessFactory::instance().getAccess(resource, ResourceConfig::getResourceType(resource)); | 277 | auto resourceAccess = ResourceAccessFactory::instance().getAccess(resource, ResourceConfig::getResourceType(resource)); |
278 | return resourceAccess->synchronizeResource(scope) | 278 | return resourceAccess->synchronizeResource(scope) |
279 | .addToContext(resourceAccess) | 279 | .addToContext(resourceAccess) |
@@ -295,7 +295,7 @@ KAsync::Job<void> Store::synchronize(const Sink::Query &query) | |||
295 | KAsync::Job<void> Store::synchronize(const Sink::SyncScope &scope) | 295 | KAsync::Job<void> Store::synchronize(const Sink::SyncScope &scope) |
296 | { | 296 | { |
297 | auto resources = getResources(scope.getResourceFilter()).keys(); | 297 | auto resources = getResources(scope.getResourceFilter()).keys(); |
298 | SinkTrace() << "Synchronize" << resources; | 298 | SinkLog() << "Synchronize" << resources; |
299 | return KAsync::value(resources) | 299 | return KAsync::value(resources) |
300 | .template each([scope](const QByteArray &resource) { | 300 | .template each([scope](const QByteArray &resource) { |
301 | return synchronize(resource, scope); | 301 | return synchronize(resource, scope); |
@@ -363,6 +363,7 @@ DomainType Store::readOne(const Sink::Query &query) | |||
363 | if (!list.isEmpty()) { | 363 | if (!list.isEmpty()) { |
364 | return list.first(); | 364 | return list.first(); |
365 | } | 365 | } |
366 | SinkWarning() << "Tried to read value but no values are available."; | ||
366 | return DomainType(); | 367 | return DomainType(); |
367 | } | 368 | } |
368 | 369 | ||
diff --git a/synchronizer/main.cpp b/synchronizer/main.cpp index dc23a51..c0c3c2d 100644 --- a/synchronizer/main.cpp +++ b/synchronizer/main.cpp | |||
@@ -161,7 +161,7 @@ int main(int argc, char *argv[]) | |||
161 | const QByteArray resourceType = arguments.at(2); | 161 | const QByteArray resourceType = arguments.at(2); |
162 | app.setApplicationName(instanceIdentifier); | 162 | app.setApplicationName(instanceIdentifier); |
163 | Sink::Log::setPrimaryComponent(instanceIdentifier); | 163 | Sink::Log::setPrimaryComponent(instanceIdentifier); |
164 | SinkLog() << "Starting: " << instanceIdentifier; | 164 | SinkLog() << "Starting: " << instanceIdentifier << resourceType; |
165 | 165 | ||
166 | QLockFile lockfile(instanceIdentifier + ".lock"); | 166 | QLockFile lockfile(instanceIdentifier + ".lock"); |
167 | lockfile.setStaleLockTime(500); | 167 | lockfile.setStaleLockTime(500); |