---------- * pgstat_reset_shared_counters() - * * Tell the statistics collector to reset cluster-wide shared counters. * * Permission checking for this function is managed through the normal * GRANT system. * ---------- */
| 1454 | * ---------- |
| 1455 | */ |
| 1456 | void |
| 1457 | pgstat_reset_shared_counters(const char *target) |
| 1458 | { |
| 1459 | PgStat_MsgResetsharedcounter msg; |
| 1460 | |
| 1461 | if (pgStatSock == PGINVALID_SOCKET) |
| 1462 | return; |
| 1463 | |
| 1464 | if (strcmp(target, "archiver") == 0) |
| 1465 | msg.m_resettarget = RESET_ARCHIVER; |
| 1466 | else if (strcmp(target, "bgwriter") == 0) |
| 1467 | msg.m_resettarget = RESET_BGWRITER; |
| 1468 | else if (strcmp(target, "wal") == 0) |
| 1469 | msg.m_resettarget = RESET_WAL; |
| 1470 | else |
| 1471 | ereport(ERROR, |
| 1472 | (errcode(ERRCODE_INVALID_PARAMETER_VALUE), |
| 1473 | errmsg("unrecognized reset target: \"%s\"", target), |
| 1474 | errhint("Target must be \"archiver\", \"bgwriter\", or \"wal\"."))); |
| 1475 | |
| 1476 | pgstat_setheader(&msg.m_hdr, PGSTAT_MTYPE_RESETSHAREDCOUNTER); |
| 1477 | pgstat_send(&msg, sizeof(msg)); |
| 1478 | } |
| 1479 | |
| 1480 | /* ---------- |
| 1481 | * pgstat_reset_single_counter() - |
no test coverage detected