2005-10-04 00:52:26 +02:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
*
|
|
|
|
* pg_rusage.h
|
|
|
|
* header file for resource usage measurement support routines
|
|
|
|
*
|
|
|
|
*
|
2015-01-06 17:43:47 +01:00
|
|
|
* Portions Copyright (c) 1996-2015, PostgreSQL Global Development Group
|
2005-10-04 00:52:26 +02:00
|
|
|
* Portions Copyright (c) 1994, Regents of the University of California
|
|
|
|
*
|
2010-09-20 22:08:53 +02:00
|
|
|
* src/include/utils/pg_rusage.h
|
2005-10-04 00:52:26 +02:00
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
#ifndef PG_RUSAGE_H
|
|
|
|
#define PG_RUSAGE_H
|
|
|
|
|
|
|
|
#include <sys/time.h>
|
|
|
|
|
2006-10-07 21:25:29 +02:00
|
|
|
#ifdef HAVE_SYS_RESOURCE_H
|
2005-10-04 00:52:26 +02:00
|
|
|
#include <sys/resource.h>
|
|
|
|
#else
|
|
|
|
#include "rusagestub.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
/* State structure for pg_rusage_init/pg_rusage_show */
|
|
|
|
typedef struct PGRUsage
|
|
|
|
{
|
|
|
|
struct timeval tv;
|
|
|
|
struct rusage ru;
|
|
|
|
} PGRUsage;
|
|
|
|
|
|
|
|
|
|
|
|
extern void pg_rusage_init(PGRUsage *ru0);
|
|
|
|
extern const char *pg_rusage_show(const PGRUsage *ru0);
|
|
|
|
|
|
|
|
#endif /* PG_RUSAGE_H */
|