blob: 4a37b8f6e764d1492e26ec94151a67bae2677b4b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
/* -------------------------------------------------------------------------
*
* pgstat_archiver.c
* Implementation of archiver statistics.
*
* This file contains the implementation of archiver statistics. It is kept
* separate from pgstat.c to enforce the line between the statistics access /
* storage implementation and the details about individual types of
* statistics.
*
* Copyright (c) 2001-2022, PostgreSQL Global Development Group
*
* IDENTIFICATION
* src/backend/utils/activity/pgstat_archiver.c
* -------------------------------------------------------------------------
*/
#include "postgres.h"
#include "utils/pgstat_internal.h"
#include "utils/timestamp.h"
/*
* Tell the collector about the WAL file that we successfully
* archived or failed to archive.
*/
void
pgstat_send_archiver(const char *xlog, bool failed)
{
PgStat_MsgArchiver msg;
/*
* Prepare and send the message
*/
pgstat_setheader(&msg.m_hdr, PGSTAT_MTYPE_ARCHIVER);
msg.m_failed = failed;
strlcpy(msg.m_xlog, xlog, sizeof(msg.m_xlog));
msg.m_timestamp = GetCurrentTimestamp();
pgstat_send(&msg, sizeof(msg));
}
|