diff --git a/Sources/CodableDatastore/Datastore/Datastore.swift b/Sources/CodableDatastore/Datastore/Datastore.swift index 96b995d..56b715c 100644 --- a/Sources/CodableDatastore/Datastore/Datastore.swift +++ b/Sources/CodableDatastore/Datastore/Datastore.swift @@ -165,7 +165,7 @@ extension Datastore { } let warmupTask = Task { try await persistence._withTransaction( - actionName: "Migrate Entries", + actionName: "Migrate \(key) Instances", options: [] ) { transaction, _ in try await self.registerAndMigrate(with: transaction) @@ -382,7 +382,7 @@ extension Datastore where AccessMode == ReadWrite { let indexRepresentation = AnyIndexRepresentation(indexRepresentation: self.format[keyPath: index]) try await persistence._withTransaction( - actionName: "Migrate Entries", + actionName: "Migrate \(key) Instances", options: [] ) { transaction, _ in guard @@ -460,7 +460,7 @@ extension Datastore { try await warmupIfNeeded() return try await persistence._withTransaction( - actionName: "Check Count", + actionName: "Check \(key) Count", options: [.idempotent, .readOnly] ) { transaction, _ in let descriptor = try await transaction.datastoreDescriptor(for: self.key) @@ -476,7 +476,7 @@ extension Datastore { try await warmupIfNeeded() return try await persistence._withTransaction( - actionName: nil, + actionName: "Load \(key) ID", options: [.idempotent, .readOnly] ) { transaction, _ in do { @@ -515,7 +515,7 @@ extension Datastore { } try await self.persistence._withTransaction( - actionName: nil, + actionName: "Load \(self.key) ID Range", options: [.readOnly] ) { transaction, _ in do { @@ -602,7 +602,7 @@ extension Datastore { try await self.warmupIfNeeded() try await self.persistence._withTransaction( - actionName: nil, + actionName: "Load \(self.key) \(declaredIndex.indexName)", options: [.readOnly] ) { transaction, _ in do { @@ -753,7 +753,7 @@ extension Datastore { try await warmupIfNeeded() return try await persistence._withTransaction( - actionName: nil, + actionName: "Start \(key) Observations", options: [.idempotent, .readOnly] ) { transaction, _ in try await transaction.makeObserver( @@ -791,7 +791,7 @@ extension Datastore where AccessMode == ReadWrite { let instanceData = try await self.encoder(instance) return try await persistence._withTransaction( - actionName: "Persist Entry", + actionName: "Persist \(key) Instance", options: [.idempotent] ) { transaction, _ in /// Create any missing indexes or prime the datastore for writing. @@ -977,7 +977,7 @@ extension Datastore where AccessMode == ReadWrite { try await warmupIfNeeded() return try await persistence._withTransaction( - actionName: "Delete Entry", + actionName: "Delete \(key) Instance", options: [.idempotent] ) { transaction, _ in /// Get a cursor to the entry within the primary index. diff --git a/Sources/CodableDatastore/Datastore/DatastoreKey.swift b/Sources/CodableDatastore/Datastore/DatastoreKey.swift index 68cc4a2..02d9fa4 100644 --- a/Sources/CodableDatastore/Datastore/DatastoreKey.swift +++ b/Sources/CodableDatastore/Datastore/DatastoreKey.swift @@ -41,3 +41,8 @@ extension DatastoreKey: Encodable { try container.encode(rawValue) } } + +extension DatastoreKey: CustomStringConvertible { + @inlinable + public var description: String { rawValue } +} diff --git a/Sources/CodableDatastore/Indexes/IndexName.swift b/Sources/CodableDatastore/Indexes/IndexName.swift index f4dfb71..2c85359 100644 --- a/Sources/CodableDatastore/Indexes/IndexName.swift +++ b/Sources/CodableDatastore/Indexes/IndexName.swift @@ -42,3 +42,7 @@ extension IndexName: Encodable { try container.encode(rawValue) } } + +extension IndexName: CustomStringConvertible { + public var description: String { rawValue } +}