-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathn2diskdb.h
More file actions
64 lines (52 loc) · 1.41 KB
/
n2diskdb.h
File metadata and controls
64 lines (52 loc) · 1.41 KB
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
57
58
59
60
61
62
63
64
#ifndef N2DISKDB_H
#define N2DISKDB_H 1
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <errno.h>
#include "datatypes.h"
typedef struct n2statitem_struc
{
unsigned short load;
unsigned short cpuusage;
int kmemfree;
unsigned short netin;
unsigned short netout;
unsigned short ping;
status_t worststatus;
} n2statitem;
typedef struct n2stat_struc
{
unsigned long host;
unsigned int date;
int count;
int starttime;
int endtime;
n2statitem data[0];
} n2stat;
unsigned int tdate_sub (unsigned int, int);
void diskdb_setlck (netload_rec *rec);
int diskdb_locked (netload_rec *rec);
FILE *diskdb_open (unsigned long host, unsigned int date);
void diskdb_now (unsigned int *, int *);
void diskdb_setcurrent (unsigned long host,
netload_rec *rec);
void diskdb_store (unsigned long host,
netload_rec *rec,
unsigned int date,
int index);
netload_rec *diskdb_get (unsigned long host,
unsigned int date,
int index);
netload_rec *diskdb_get_current(unsigned long host);
netload_rec **diskdb_get_range (unsigned long host,
unsigned int date,
int first,
int last);
n2stat *diskdb_stats (unsigned long host,
unsigned int date,
int numberofrecords,
int first,
int last);
#endif