diff --git a/index.js b/index.js index 978f7d8..4cf1529 100644 --- a/index.js +++ b/index.js @@ -760,6 +760,21 @@ class PearcordPlatform extends EventEmitter { return extra } + _logMeshFederationLive (action, extra = {}) { + const guildId = extra.guildId || this.guild?.guild?.id + const span = this.log.time('guild.mesh.federation.live', { + spanKind: 'guild.mesh.federation.live', + action, + guildId: guildId || null, + meshPeerCount: this.guild?.peers?.size ?? 0, + federationPeerTarget: extra.federationPeerTarget ?? 8, + topicPool: this._guildTopicPool?.snapshot?.() || null, + ...extra + }) + span.end(extra) + return extra + } + _reactionTombstoneKey (key, guildId) { return `${guildId || ''}:${key.channelId}:${key.messageId}:${key.emoji}:${key.userId}` } @@ -5003,6 +5018,13 @@ class PearcordPlatform extends EventEmitter { exportMeshReplicationDiagnostics (guildId) { const id = guildId || this.guild?.guild?.id + if (id) { + this._logMeshFederationLive('export-diagnostics', { + guildId: id, + federationPeerTarget: 8, + meshPeerCount: this.guild?.peers?.size ?? 0 + }) + } return { exportedAt: Date.now(), guildId: id,