summaryrefslogtreecommitdiff
path: root/src/pmdas/gfs2/sbstats.h
blob: 5e71791e83e6bf6ddabbd724d2fd5640634a4a82 (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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/*
 * GFS2 sbstats sysfs file statistics.
 *
 * Copyright (c) 2013 Red Hat.
 * 
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the
 * Free Software Foundation; either version 2 of the License, or (at your
 * option) any later version.
 * 
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * for more details.
 */

#ifndef SBSTATS_H
#define SBSTATS_H

enum {
	LOCKSTAT_SRTT = 0,	/* Non-blocking smoothed round trip time */
	LOCKSTAT_SRTTVAR,	/* Non-blocking smoothed variance */
	LOCKSTAT_SRTTB,		/* Blocking smoothed round trip time */
	LOCKSTAT_SRTTVARB,	/* Blocking smoothed variance */
	LOCKSTAT_SIRT,		/* Smoothed inter-request time */
	LOCKSTAT_SIRTVAR,	/* Smoothed inter-request variance */
	LOCKSTAT_DCOUNT,	/* Count of DLM requests */
	LOCKSTAT_QCOUNT,	/* Count of gfs2_holder queues */
	NUM_LOCKSTATS 
};

enum {
	LOCKTYPE_RESERVED = 0,
	LOCKTYPE_NONDISK,
	LOCKTYPE_INODE,
	LOCKTYPE_RGRB,
	LOCKTYPE_META,
	LOCKTYPE_IOPEN,
	LOCKTYPE_FLOCK,
	LOCKTYPE_PLOCK,
	LOCKTYPE_QUOTA,
	LOCKTYPE_JOURNAL,
	NUM_LOCKTYPES 
};

#define SBSTATS_COUNT	(NUM_LOCKSTATS*NUM_LOCKTYPES)

struct sbstats {
	__uint64_t	values[SBSTATS_COUNT];
};

extern void gfs2_sbstats_init(pmdaMetric *, int);
extern int gfs2_sbstats_fetch(int, struct sbstats *, pmAtomValue *);
extern int gfs2_refresh_sbstats(const char *, const char *, struct sbstats *);

#endif	/* SBSTATS_H */