<commit_before>/* ----------
 *	pgstat.h
 *
 *	Definitions for the PostgreSQL statistics collector daemon.
 *
 *	Copyright (c) 2001-2003, PostgreSQL Global Development Group
 *
 *	$PostgreSQL: pgsql/src/include/pgstat.h,v 1.19 2004/03/02 18:35:58 momjian Exp $
 * ----------
 */
#ifndef PGSTAT_H
#define PGSTAT_H

#include "utils/hsearch.h"
#include "utils/nabstime.h"
#include "utils/rel.h"


/* ----------
 * Paths for the statistics files. The %s is replaced with the
 * installations $PGDATA.
 * ----------
 */
#define PGSTAT_STAT_FILENAME	"%s/global/pgstat.stat"
#define PGSTAT_STAT_TMPFILE		"%s/global/pgstat.tmp.%d"

/* ----------
 * Timer definitions.
 * ----------
 */
#define PGSTAT_STAT_INTERVAL	500		/* How often to write the status	*/
 /* file; in milliseconds.			 */

#define PGSTAT_DESTROY_DELAY	10000	/* How long to keep destroyed		*/
 /* objects known, to give delayed	 */
 /* UDP packets time to arrive;		 */
 /* in milliseconds.				 */

#define PGSTAT_DESTROY_COUNT	(PGSTAT_DESTROY_DELAY / PGSTAT_STAT_INTERVAL)

#define PGSTAT_RESTART_INTERVAL 60		/* How often to attempt to restart */
 /* a failed statistics collector; in seconds. */

/* ----------
 * How much of the actual query string to send to the collector.
 * ----------
 */
#define PGSTAT_ACTIVITY_SIZE	256


/* ----------
 * The types of backend/postmaster -> collector messages
 * ----------
 */
#define PGSTAT_MTYPE_DUMMY			0
#define PGSTAT_MTYPE_BESTART		1
#define PGSTAT_MTYPE_BETERM			2
#define PGSTAT_MTYPE_ACTIVITY		3
#define PGSTAT_MTYPE_TABSTAT		4
#define PGSTAT_MTYPE_TABPURGE		5
#define PGSTAT_MTYPE_DROPDB			6
#define PGSTAT_MTYPE_RESETCOUNTER	7

/* ----------
 * Amount of space reserved in pgstat_recvbuffer().
 * ----------
 */
#define PGSTAT_RECVBUFFERSZ		((int) (1024 * sizeof(PgStat_Msg)))


/* ----------
 * The initial size hints for the hash tables used in the
 * collector.<commit_msg>Fix sizeof(Oid) in PGSTAT_NUM_TABPURGE.  (Actually done in previous commit.)<commit_after>/* ----------
 *	pgstat.h
 *
 *	Definitions for the PostgreSQL statistics collector daemon.
 *
 *	Copyright (c) 2001-2003, PostgreSQL Global Development Group
 *
 *	$PostgreSQL: pgsql/src/include/pgstat.h,v 1.20 2004/03/02 18:37:52 momjian Exp $
 * ----------
 */
#ifndef PGSTAT_H
#define PGSTAT_H

#include "utils/hsearch.h"
#include "utils/nabstime.h"
#include "utils/rel.h"


/* ----------
 * Paths for the statistics files. The %s is replaced with the
 * installations $PGDATA.
 * ----------
 */
#define PGSTAT_STAT_FILENAME	"%s/global/pgstat.stat"
#define PGSTAT_STAT_TMPFILE		"%s/global/pgstat.tmp.%d"

/* ----------
 * Timer definitions.
 * ----------
 */
#define PGSTAT_STAT_INTERVAL	500		/* How often to write the status	*/
 /* file; in milliseconds.			 */

#define PGSTAT_DESTROY_DELAY	10000	/* How long to keep destroyed		*/
 /* objects known, to give delayed	 */
 /* UDP packets time to arrive;		 */
 /* in milliseconds.				 */

#define PGSTAT_DESTROY_COUNT	(PGSTAT_DESTROY_DELAY / PGSTAT_STAT_INTERVAL)

#define PGSTAT_RESTART_INTERVAL 60		/* How often to attempt to restart */
 /* a failed statistics collector; in seconds. */

/* ----------
 * How much of the actual query string to send to the collector.
 * ----------
 */
#define PGSTAT_ACTIVITY_SIZE	256


/* ----------
 * The types of backend/postmaster -> collector messages
 * ----------
 */
#define PGSTAT_MTYPE_DUMMY			0
#define PGSTAT_MTYPE_BESTART		1
#define PGSTAT_MTYPE_BETERM			2
#define PGSTAT_MTYPE_ACTIVITY		3
#define PGSTAT_MTYPE_TABSTAT		4
#define PGSTAT_MTYPE_TABPURGE		5
#define PGSTAT_MTYPE_DROPDB			6
#define PGSTAT_MTYPE_RESETCOUNTER	7

/* ----------
 * Amount of space reserved in pgstat_recvbuffer().
 * ----------
 */
#define PGSTAT_RECVBUFFERSZ		((int) (1024 * sizeof(PgStat_Msg)))


/* ----------
 * The initial size hints for the hash tables used in the collector.
{'fraction_non_alphanumeric': 0.16293013555787278, 'fraction_numerical': 0.026068821689259645, 'mean_word_length': 2.7840236686390534, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5590676', 'n_tokens_mistral': 1428, 'n_tokens_neox': 1305, 'n_words': 353}