mirror of
https://github.com/postgres/postgres.git
synced 2025-07-05 07:21:24 +03:00
Use NameData datatype for slotname in stats.
This will make it consistent with the other usage of slotname in the code. In the passing, change pgstat_report_replslot signature to use a structure rather than multiple parameters. Reported-by: Andres Freund Author: Vignesh C Reviewed-by: Sawada Masahiko, Amit Kapila Discussion: https://postgr.es/m/20210319185247.ldebgpdaxsowiflw@alap3.anarazel.de
This commit is contained in:
@ -1773,6 +1773,7 @@ void
|
||||
UpdateDecodingStats(LogicalDecodingContext *ctx)
|
||||
{
|
||||
ReorderBuffer *rb = ctx->reorder;
|
||||
PgStat_ReplSlotStats repSlotStat;
|
||||
|
||||
/*
|
||||
* Nothing to do if we haven't spilled or streamed anything since the last
|
||||
@ -1790,9 +1791,15 @@ UpdateDecodingStats(LogicalDecodingContext *ctx)
|
||||
(long long) rb->streamCount,
|
||||
(long long) rb->streamBytes);
|
||||
|
||||
pgstat_report_replslot(NameStr(ctx->slot->data.name),
|
||||
rb->spillTxns, rb->spillCount, rb->spillBytes,
|
||||
rb->streamTxns, rb->streamCount, rb->streamBytes);
|
||||
namestrcpy(&repSlotStat.slotname, NameStr(ctx->slot->data.name));
|
||||
repSlotStat.spill_txns = rb->spillTxns;
|
||||
repSlotStat.spill_count = rb->spillCount;
|
||||
repSlotStat.spill_bytes = rb->spillBytes;
|
||||
repSlotStat.stream_txns = rb->streamTxns;
|
||||
repSlotStat.stream_count = rb->streamCount;
|
||||
repSlotStat.stream_bytes = rb->streamBytes;
|
||||
|
||||
pgstat_report_replslot(&repSlotStat);
|
||||
rb->spillTxns = 0;
|
||||
rb->spillCount = 0;
|
||||
rb->spillBytes = 0;
|
||||
|
Reference in New Issue
Block a user