Merge branch 'vendor/BZIP'
[dragonfly.git] / test / dsched_fq / fqstats.c
CommitLineData
74ce043b
AH
1#include <sys/types.h>
2#include <sys/stat.h>
3#include <sys/sysctl.h>
4
5#include <db.h>
6#include <err.h>
7#include <fcntl.h>
8#include <paths.h>
9#include <stdio.h>
10#include <stdlib.h>
11#include <string.h>
12
0b3a8a4f 13#include "../../sys/kern/dsched/fq/fq.h"
74ce043b
AH
14
15
16int main(void)
17{
18 struct dsched_fq_stats fq_stats;
19 size_t n = sizeof(struct dsched_fq_stats);
20
e02e815e 21 if (sysctlbyname("dsched.fq.stats", &fq_stats, &n, NULL, 0) != 0)
74ce043b
AH
22 err(1, "sysctlbyname");
23
e02e815e 24 printf( "Proccesses\n"
74ce043b
AH
25 "Rate limited:\t%d\n"
26 "---------------------------------------------\n"
27 "Transactions\n"
28 "Issued:\t\t%d\n"
29 "Completed:\t%d\n"
e02e815e 30 "Cancelled:\t%d\n",
aa166ad1 31
74ce043b
AH
32 fq_stats.procs_limited,
33
34 fq_stats.transactions,
35 fq_stats.transactions_completed,
e02e815e 36 fq_stats.cancelled
74ce043b
AH
37 );
38
39
40 return 0;
41}