sigar 0.7.1 → 0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Rakefile +2 -2
- metadata +1 -25
- data/bindings/ruby/Makefile +0 -187
- data/bindings/ruby/darwin_sigar.c +0 -3711
- data/bindings/ruby/darwin_sigar.o +0 -0
- data/bindings/ruby/rbsigar.o +0 -0
- data/bindings/ruby/rbsigar_generated.rx +0 -2830
- data/bindings/ruby/sigar.bundle +0 -0
- data/bindings/ruby/sigar.c +0 -2428
- data/bindings/ruby/sigar.o +0 -0
- data/bindings/ruby/sigar_cache.c +0 -179
- data/bindings/ruby/sigar_cache.o +0 -0
- data/bindings/ruby/sigar_fileinfo.c +0 -815
- data/bindings/ruby/sigar_fileinfo.o +0 -0
- data/bindings/ruby/sigar_format.c +0 -696
- data/bindings/ruby/sigar_format.o +0 -0
- data/bindings/ruby/sigar_getline.c +0 -1849
- data/bindings/ruby/sigar_getline.o +0 -0
- data/bindings/ruby/sigar_ptql.c +0 -1967
- data/bindings/ruby/sigar_ptql.o +0 -0
- data/bindings/ruby/sigar_signal.c +0 -216
- data/bindings/ruby/sigar_signal.o +0 -0
- data/bindings/ruby/sigar_util.c +0 -1060
- data/bindings/ruby/sigar_util.o +0 -0
- data/bindings/ruby/sigar_version.c +0 -22
- data/bindings/ruby/sigar_version.o +0 -0
Binary file
|
data/bindings/ruby/rbsigar.o
DELETED
Binary file
|
@@ -1,2830 +0,0 @@
|
|
1
|
-
static VALUE rb_cSigarUptime;
|
2
|
-
|
3
|
-
static VALUE rb_sigar_uptime(VALUE obj)
|
4
|
-
{
|
5
|
-
SIGAR_GET;
|
6
|
-
|
7
|
-
int status;
|
8
|
-
sigar_uptime_t *RETVAL = malloc(sizeof(*RETVAL));
|
9
|
-
|
10
|
-
if ((status = sigar_uptime_get(sigar, RETVAL)) != SIGAR_OK) {
|
11
|
-
free(RETVAL);
|
12
|
-
rb_raise(rb_eArgError, "%s", sigar_strerror(sigar, status));
|
13
|
-
return Qnil;
|
14
|
-
}
|
15
|
-
|
16
|
-
return Data_Wrap_Struct(rb_cSigarUptime, 0, rb_sigar_free, RETVAL);
|
17
|
-
}
|
18
|
-
static VALUE rb_sigar_Uptime_uptime(VALUE self)
|
19
|
-
{
|
20
|
-
sigar_uptime_t *uptime;
|
21
|
-
Data_Get_Struct(self, sigar_uptime_t, uptime);
|
22
|
-
return rb_float_new(uptime->uptime);
|
23
|
-
}
|
24
|
-
static VALUE rb_sigar_NetStat_tcp_inbound_total(VALUE self)
|
25
|
-
{
|
26
|
-
sigar_net_stat_t *net_stat;
|
27
|
-
Data_Get_Struct(self, sigar_net_stat_t, net_stat);
|
28
|
-
return rb_int2inum(net_stat->tcp_inbound_total);
|
29
|
-
}
|
30
|
-
static VALUE rb_sigar_NetStat_tcp_outbound_total(VALUE self)
|
31
|
-
{
|
32
|
-
sigar_net_stat_t *net_stat;
|
33
|
-
Data_Get_Struct(self, sigar_net_stat_t, net_stat);
|
34
|
-
return rb_int2inum(net_stat->tcp_outbound_total);
|
35
|
-
}
|
36
|
-
static VALUE rb_sigar_NetStat_all_inbound_total(VALUE self)
|
37
|
-
{
|
38
|
-
sigar_net_stat_t *net_stat;
|
39
|
-
Data_Get_Struct(self, sigar_net_stat_t, net_stat);
|
40
|
-
return rb_int2inum(net_stat->all_inbound_total);
|
41
|
-
}
|
42
|
-
static VALUE rb_sigar_NetStat_all_outbound_total(VALUE self)
|
43
|
-
{
|
44
|
-
sigar_net_stat_t *net_stat;
|
45
|
-
Data_Get_Struct(self, sigar_net_stat_t, net_stat);
|
46
|
-
return rb_int2inum(net_stat->all_outbound_total);
|
47
|
-
}
|
48
|
-
static VALUE rb_cSigarDirStat;
|
49
|
-
|
50
|
-
static VALUE rb_sigar_dir_stat(VALUE obj, VALUE name)
|
51
|
-
{
|
52
|
-
SIGAR_GET;
|
53
|
-
|
54
|
-
int status;
|
55
|
-
sigar_dir_stat_t *RETVAL = malloc(sizeof(*RETVAL));
|
56
|
-
|
57
|
-
if ((status = sigar_dir_stat_get(sigar, StringValuePtr(name), RETVAL)) != SIGAR_OK) {
|
58
|
-
free(RETVAL);
|
59
|
-
rb_raise(rb_eArgError, "%s", sigar_strerror(sigar, status));
|
60
|
-
return Qnil;
|
61
|
-
}
|
62
|
-
|
63
|
-
return Data_Wrap_Struct(rb_cSigarDirStat, 0, rb_sigar_free, RETVAL);
|
64
|
-
}
|
65
|
-
static VALUE rb_sigar_DirStat_total(VALUE self)
|
66
|
-
{
|
67
|
-
sigar_dir_stat_t *dir_stat;
|
68
|
-
Data_Get_Struct(self, sigar_dir_stat_t, dir_stat);
|
69
|
-
return rb_ll2inum(dir_stat->total);
|
70
|
-
}
|
71
|
-
static VALUE rb_sigar_DirStat_files(VALUE self)
|
72
|
-
{
|
73
|
-
sigar_dir_stat_t *dir_stat;
|
74
|
-
Data_Get_Struct(self, sigar_dir_stat_t, dir_stat);
|
75
|
-
return rb_ll2inum(dir_stat->files);
|
76
|
-
}
|
77
|
-
static VALUE rb_sigar_DirStat_subdirs(VALUE self)
|
78
|
-
{
|
79
|
-
sigar_dir_stat_t *dir_stat;
|
80
|
-
Data_Get_Struct(self, sigar_dir_stat_t, dir_stat);
|
81
|
-
return rb_ll2inum(dir_stat->subdirs);
|
82
|
-
}
|
83
|
-
static VALUE rb_sigar_DirStat_symlinks(VALUE self)
|
84
|
-
{
|
85
|
-
sigar_dir_stat_t *dir_stat;
|
86
|
-
Data_Get_Struct(self, sigar_dir_stat_t, dir_stat);
|
87
|
-
return rb_ll2inum(dir_stat->symlinks);
|
88
|
-
}
|
89
|
-
static VALUE rb_sigar_DirStat_chrdevs(VALUE self)
|
90
|
-
{
|
91
|
-
sigar_dir_stat_t *dir_stat;
|
92
|
-
Data_Get_Struct(self, sigar_dir_stat_t, dir_stat);
|
93
|
-
return rb_ll2inum(dir_stat->chrdevs);
|
94
|
-
}
|
95
|
-
static VALUE rb_sigar_DirStat_blkdevs(VALUE self)
|
96
|
-
{
|
97
|
-
sigar_dir_stat_t *dir_stat;
|
98
|
-
Data_Get_Struct(self, sigar_dir_stat_t, dir_stat);
|
99
|
-
return rb_ll2inum(dir_stat->blkdevs);
|
100
|
-
}
|
101
|
-
static VALUE rb_sigar_DirStat_sockets(VALUE self)
|
102
|
-
{
|
103
|
-
sigar_dir_stat_t *dir_stat;
|
104
|
-
Data_Get_Struct(self, sigar_dir_stat_t, dir_stat);
|
105
|
-
return rb_ll2inum(dir_stat->sockets);
|
106
|
-
}
|
107
|
-
static VALUE rb_sigar_DirStat_disk_usage(VALUE self)
|
108
|
-
{
|
109
|
-
sigar_dir_stat_t *dir_stat;
|
110
|
-
Data_Get_Struct(self, sigar_dir_stat_t, dir_stat);
|
111
|
-
return rb_ll2inum(dir_stat->disk_usage);
|
112
|
-
}
|
113
|
-
static VALUE rb_sigar_CpuPerc_user(VALUE self)
|
114
|
-
{
|
115
|
-
sigar_cpu_perc_t *cpu_perc;
|
116
|
-
Data_Get_Struct(self, sigar_cpu_perc_t, cpu_perc);
|
117
|
-
return rb_float_new(cpu_perc->user);
|
118
|
-
}
|
119
|
-
static VALUE rb_sigar_CpuPerc_sys(VALUE self)
|
120
|
-
{
|
121
|
-
sigar_cpu_perc_t *cpu_perc;
|
122
|
-
Data_Get_Struct(self, sigar_cpu_perc_t, cpu_perc);
|
123
|
-
return rb_float_new(cpu_perc->sys);
|
124
|
-
}
|
125
|
-
static VALUE rb_sigar_CpuPerc_nice(VALUE self)
|
126
|
-
{
|
127
|
-
sigar_cpu_perc_t *cpu_perc;
|
128
|
-
Data_Get_Struct(self, sigar_cpu_perc_t, cpu_perc);
|
129
|
-
return rb_float_new(cpu_perc->nice);
|
130
|
-
}
|
131
|
-
static VALUE rb_sigar_CpuPerc_idle(VALUE self)
|
132
|
-
{
|
133
|
-
sigar_cpu_perc_t *cpu_perc;
|
134
|
-
Data_Get_Struct(self, sigar_cpu_perc_t, cpu_perc);
|
135
|
-
return rb_float_new(cpu_perc->idle);
|
136
|
-
}
|
137
|
-
static VALUE rb_sigar_CpuPerc_wait(VALUE self)
|
138
|
-
{
|
139
|
-
sigar_cpu_perc_t *cpu_perc;
|
140
|
-
Data_Get_Struct(self, sigar_cpu_perc_t, cpu_perc);
|
141
|
-
return rb_float_new(cpu_perc->wait);
|
142
|
-
}
|
143
|
-
static VALUE rb_sigar_CpuPerc_irq(VALUE self)
|
144
|
-
{
|
145
|
-
sigar_cpu_perc_t *cpu_perc;
|
146
|
-
Data_Get_Struct(self, sigar_cpu_perc_t, cpu_perc);
|
147
|
-
return rb_float_new(cpu_perc->irq);
|
148
|
-
}
|
149
|
-
static VALUE rb_sigar_CpuPerc_soft_irq(VALUE self)
|
150
|
-
{
|
151
|
-
sigar_cpu_perc_t *cpu_perc;
|
152
|
-
Data_Get_Struct(self, sigar_cpu_perc_t, cpu_perc);
|
153
|
-
return rb_float_new(cpu_perc->soft_irq);
|
154
|
-
}
|
155
|
-
static VALUE rb_sigar_CpuPerc_stolen(VALUE self)
|
156
|
-
{
|
157
|
-
sigar_cpu_perc_t *cpu_perc;
|
158
|
-
Data_Get_Struct(self, sigar_cpu_perc_t, cpu_perc);
|
159
|
-
return rb_float_new(cpu_perc->stolen);
|
160
|
-
}
|
161
|
-
static VALUE rb_sigar_CpuPerc_combined(VALUE self)
|
162
|
-
{
|
163
|
-
sigar_cpu_perc_t *cpu_perc;
|
164
|
-
Data_Get_Struct(self, sigar_cpu_perc_t, cpu_perc);
|
165
|
-
return rb_float_new(cpu_perc->combined);
|
166
|
-
}
|
167
|
-
static VALUE rb_sigar_Arp_ifname(VALUE self)
|
168
|
-
{
|
169
|
-
sigar_arp_t *arp;
|
170
|
-
Data_Get_Struct(self, sigar_arp_t, arp);
|
171
|
-
return rb_str_new2(arp->ifname);
|
172
|
-
}
|
173
|
-
static VALUE rb_sigar_Arp_hwaddr(VALUE self)
|
174
|
-
{
|
175
|
-
sigar_arp_t *arp;
|
176
|
-
Data_Get_Struct(self, sigar_arp_t, arp);
|
177
|
-
return rb_sigar_net_address_to_s(arp->hwaddr);
|
178
|
-
}
|
179
|
-
static VALUE rb_sigar_Arp_type(VALUE self)
|
180
|
-
{
|
181
|
-
sigar_arp_t *arp;
|
182
|
-
Data_Get_Struct(self, sigar_arp_t, arp);
|
183
|
-
return rb_str_new2(arp->type);
|
184
|
-
}
|
185
|
-
static VALUE rb_sigar_Arp_address(VALUE self)
|
186
|
-
{
|
187
|
-
sigar_arp_t *arp;
|
188
|
-
Data_Get_Struct(self, sigar_arp_t, arp);
|
189
|
-
return rb_sigar_net_address_to_s(arp->address);
|
190
|
-
}
|
191
|
-
static VALUE rb_sigar_Arp_flags(VALUE self)
|
192
|
-
{
|
193
|
-
sigar_arp_t *arp;
|
194
|
-
Data_Get_Struct(self, sigar_arp_t, arp);
|
195
|
-
return rb_ll2inum(arp->flags);
|
196
|
-
}
|
197
|
-
static VALUE rb_cSigarResourceLimit;
|
198
|
-
|
199
|
-
static VALUE rb_sigar_resource_limit(VALUE obj)
|
200
|
-
{
|
201
|
-
SIGAR_GET;
|
202
|
-
|
203
|
-
int status;
|
204
|
-
sigar_resource_limit_t *RETVAL = malloc(sizeof(*RETVAL));
|
205
|
-
|
206
|
-
if ((status = sigar_resource_limit_get(sigar, RETVAL)) != SIGAR_OK) {
|
207
|
-
free(RETVAL);
|
208
|
-
rb_raise(rb_eArgError, "%s", sigar_strerror(sigar, status));
|
209
|
-
return Qnil;
|
210
|
-
}
|
211
|
-
|
212
|
-
return Data_Wrap_Struct(rb_cSigarResourceLimit, 0, rb_sigar_free, RETVAL);
|
213
|
-
}
|
214
|
-
static VALUE rb_sigar_ResourceLimit_cpu_cur(VALUE self)
|
215
|
-
{
|
216
|
-
sigar_resource_limit_t *resource_limit;
|
217
|
-
Data_Get_Struct(self, sigar_resource_limit_t, resource_limit);
|
218
|
-
return rb_ll2inum(resource_limit->cpu_cur);
|
219
|
-
}
|
220
|
-
static VALUE rb_sigar_ResourceLimit_cpu_max(VALUE self)
|
221
|
-
{
|
222
|
-
sigar_resource_limit_t *resource_limit;
|
223
|
-
Data_Get_Struct(self, sigar_resource_limit_t, resource_limit);
|
224
|
-
return rb_ll2inum(resource_limit->cpu_max);
|
225
|
-
}
|
226
|
-
static VALUE rb_sigar_ResourceLimit_file_size_cur(VALUE self)
|
227
|
-
{
|
228
|
-
sigar_resource_limit_t *resource_limit;
|
229
|
-
Data_Get_Struct(self, sigar_resource_limit_t, resource_limit);
|
230
|
-
return rb_ll2inum(resource_limit->file_size_cur);
|
231
|
-
}
|
232
|
-
static VALUE rb_sigar_ResourceLimit_file_size_max(VALUE self)
|
233
|
-
{
|
234
|
-
sigar_resource_limit_t *resource_limit;
|
235
|
-
Data_Get_Struct(self, sigar_resource_limit_t, resource_limit);
|
236
|
-
return rb_ll2inum(resource_limit->file_size_max);
|
237
|
-
}
|
238
|
-
static VALUE rb_sigar_ResourceLimit_pipe_size_max(VALUE self)
|
239
|
-
{
|
240
|
-
sigar_resource_limit_t *resource_limit;
|
241
|
-
Data_Get_Struct(self, sigar_resource_limit_t, resource_limit);
|
242
|
-
return rb_ll2inum(resource_limit->pipe_size_max);
|
243
|
-
}
|
244
|
-
static VALUE rb_sigar_ResourceLimit_pipe_size_cur(VALUE self)
|
245
|
-
{
|
246
|
-
sigar_resource_limit_t *resource_limit;
|
247
|
-
Data_Get_Struct(self, sigar_resource_limit_t, resource_limit);
|
248
|
-
return rb_ll2inum(resource_limit->pipe_size_cur);
|
249
|
-
}
|
250
|
-
static VALUE rb_sigar_ResourceLimit_data_cur(VALUE self)
|
251
|
-
{
|
252
|
-
sigar_resource_limit_t *resource_limit;
|
253
|
-
Data_Get_Struct(self, sigar_resource_limit_t, resource_limit);
|
254
|
-
return rb_ll2inum(resource_limit->data_cur);
|
255
|
-
}
|
256
|
-
static VALUE rb_sigar_ResourceLimit_data_max(VALUE self)
|
257
|
-
{
|
258
|
-
sigar_resource_limit_t *resource_limit;
|
259
|
-
Data_Get_Struct(self, sigar_resource_limit_t, resource_limit);
|
260
|
-
return rb_ll2inum(resource_limit->data_max);
|
261
|
-
}
|
262
|
-
static VALUE rb_sigar_ResourceLimit_stack_cur(VALUE self)
|
263
|
-
{
|
264
|
-
sigar_resource_limit_t *resource_limit;
|
265
|
-
Data_Get_Struct(self, sigar_resource_limit_t, resource_limit);
|
266
|
-
return rb_ll2inum(resource_limit->stack_cur);
|
267
|
-
}
|
268
|
-
static VALUE rb_sigar_ResourceLimit_stack_max(VALUE self)
|
269
|
-
{
|
270
|
-
sigar_resource_limit_t *resource_limit;
|
271
|
-
Data_Get_Struct(self, sigar_resource_limit_t, resource_limit);
|
272
|
-
return rb_ll2inum(resource_limit->stack_max);
|
273
|
-
}
|
274
|
-
static VALUE rb_sigar_ResourceLimit_core_cur(VALUE self)
|
275
|
-
{
|
276
|
-
sigar_resource_limit_t *resource_limit;
|
277
|
-
Data_Get_Struct(self, sigar_resource_limit_t, resource_limit);
|
278
|
-
return rb_ll2inum(resource_limit->core_cur);
|
279
|
-
}
|
280
|
-
static VALUE rb_sigar_ResourceLimit_core_max(VALUE self)
|
281
|
-
{
|
282
|
-
sigar_resource_limit_t *resource_limit;
|
283
|
-
Data_Get_Struct(self, sigar_resource_limit_t, resource_limit);
|
284
|
-
return rb_ll2inum(resource_limit->core_max);
|
285
|
-
}
|
286
|
-
static VALUE rb_sigar_ResourceLimit_memory_cur(VALUE self)
|
287
|
-
{
|
288
|
-
sigar_resource_limit_t *resource_limit;
|
289
|
-
Data_Get_Struct(self, sigar_resource_limit_t, resource_limit);
|
290
|
-
return rb_ll2inum(resource_limit->memory_cur);
|
291
|
-
}
|
292
|
-
static VALUE rb_sigar_ResourceLimit_memory_max(VALUE self)
|
293
|
-
{
|
294
|
-
sigar_resource_limit_t *resource_limit;
|
295
|
-
Data_Get_Struct(self, sigar_resource_limit_t, resource_limit);
|
296
|
-
return rb_ll2inum(resource_limit->memory_max);
|
297
|
-
}
|
298
|
-
static VALUE rb_sigar_ResourceLimit_processes_cur(VALUE self)
|
299
|
-
{
|
300
|
-
sigar_resource_limit_t *resource_limit;
|
301
|
-
Data_Get_Struct(self, sigar_resource_limit_t, resource_limit);
|
302
|
-
return rb_ll2inum(resource_limit->processes_cur);
|
303
|
-
}
|
304
|
-
static VALUE rb_sigar_ResourceLimit_processes_max(VALUE self)
|
305
|
-
{
|
306
|
-
sigar_resource_limit_t *resource_limit;
|
307
|
-
Data_Get_Struct(self, sigar_resource_limit_t, resource_limit);
|
308
|
-
return rb_ll2inum(resource_limit->processes_max);
|
309
|
-
}
|
310
|
-
static VALUE rb_sigar_ResourceLimit_open_files_cur(VALUE self)
|
311
|
-
{
|
312
|
-
sigar_resource_limit_t *resource_limit;
|
313
|
-
Data_Get_Struct(self, sigar_resource_limit_t, resource_limit);
|
314
|
-
return rb_ll2inum(resource_limit->open_files_cur);
|
315
|
-
}
|
316
|
-
static VALUE rb_sigar_ResourceLimit_open_files_max(VALUE self)
|
317
|
-
{
|
318
|
-
sigar_resource_limit_t *resource_limit;
|
319
|
-
Data_Get_Struct(self, sigar_resource_limit_t, resource_limit);
|
320
|
-
return rb_ll2inum(resource_limit->open_files_max);
|
321
|
-
}
|
322
|
-
static VALUE rb_sigar_ResourceLimit_virtual_memory_cur(VALUE self)
|
323
|
-
{
|
324
|
-
sigar_resource_limit_t *resource_limit;
|
325
|
-
Data_Get_Struct(self, sigar_resource_limit_t, resource_limit);
|
326
|
-
return rb_ll2inum(resource_limit->virtual_memory_cur);
|
327
|
-
}
|
328
|
-
static VALUE rb_sigar_ResourceLimit_virtual_memory_max(VALUE self)
|
329
|
-
{
|
330
|
-
sigar_resource_limit_t *resource_limit;
|
331
|
-
Data_Get_Struct(self, sigar_resource_limit_t, resource_limit);
|
332
|
-
return rb_ll2inum(resource_limit->virtual_memory_max);
|
333
|
-
}
|
334
|
-
static VALUE rb_cSigarNfsServerV3;
|
335
|
-
|
336
|
-
static VALUE rb_sigar_nfs_server_v3(VALUE obj)
|
337
|
-
{
|
338
|
-
SIGAR_GET;
|
339
|
-
|
340
|
-
int status;
|
341
|
-
sigar_nfs_server_v3_t *RETVAL = malloc(sizeof(*RETVAL));
|
342
|
-
|
343
|
-
if ((status = sigar_nfs_server_v3_get(sigar, RETVAL)) != SIGAR_OK) {
|
344
|
-
free(RETVAL);
|
345
|
-
rb_raise(rb_eArgError, "%s", sigar_strerror(sigar, status));
|
346
|
-
return Qnil;
|
347
|
-
}
|
348
|
-
|
349
|
-
return Data_Wrap_Struct(rb_cSigarNfsServerV3, 0, rb_sigar_free, RETVAL);
|
350
|
-
}
|
351
|
-
static VALUE rb_sigar_NfsServerV3_null(VALUE self)
|
352
|
-
{
|
353
|
-
sigar_nfs_server_v3_t *nfs_server_v3;
|
354
|
-
Data_Get_Struct(self, sigar_nfs_server_v3_t, nfs_server_v3);
|
355
|
-
return rb_ll2inum(nfs_server_v3->null);
|
356
|
-
}
|
357
|
-
static VALUE rb_sigar_NfsServerV3_getattr(VALUE self)
|
358
|
-
{
|
359
|
-
sigar_nfs_server_v3_t *nfs_server_v3;
|
360
|
-
Data_Get_Struct(self, sigar_nfs_server_v3_t, nfs_server_v3);
|
361
|
-
return rb_ll2inum(nfs_server_v3->getattr);
|
362
|
-
}
|
363
|
-
static VALUE rb_sigar_NfsServerV3_setattr(VALUE self)
|
364
|
-
{
|
365
|
-
sigar_nfs_server_v3_t *nfs_server_v3;
|
366
|
-
Data_Get_Struct(self, sigar_nfs_server_v3_t, nfs_server_v3);
|
367
|
-
return rb_ll2inum(nfs_server_v3->setattr);
|
368
|
-
}
|
369
|
-
static VALUE rb_sigar_NfsServerV3_lookup(VALUE self)
|
370
|
-
{
|
371
|
-
sigar_nfs_server_v3_t *nfs_server_v3;
|
372
|
-
Data_Get_Struct(self, sigar_nfs_server_v3_t, nfs_server_v3);
|
373
|
-
return rb_ll2inum(nfs_server_v3->lookup);
|
374
|
-
}
|
375
|
-
static VALUE rb_sigar_NfsServerV3_access(VALUE self)
|
376
|
-
{
|
377
|
-
sigar_nfs_server_v3_t *nfs_server_v3;
|
378
|
-
Data_Get_Struct(self, sigar_nfs_server_v3_t, nfs_server_v3);
|
379
|
-
return rb_ll2inum(nfs_server_v3->access);
|
380
|
-
}
|
381
|
-
static VALUE rb_sigar_NfsServerV3_readlink(VALUE self)
|
382
|
-
{
|
383
|
-
sigar_nfs_server_v3_t *nfs_server_v3;
|
384
|
-
Data_Get_Struct(self, sigar_nfs_server_v3_t, nfs_server_v3);
|
385
|
-
return rb_ll2inum(nfs_server_v3->readlink);
|
386
|
-
}
|
387
|
-
static VALUE rb_sigar_NfsServerV3_read(VALUE self)
|
388
|
-
{
|
389
|
-
sigar_nfs_server_v3_t *nfs_server_v3;
|
390
|
-
Data_Get_Struct(self, sigar_nfs_server_v3_t, nfs_server_v3);
|
391
|
-
return rb_ll2inum(nfs_server_v3->read);
|
392
|
-
}
|
393
|
-
static VALUE rb_sigar_NfsServerV3_write(VALUE self)
|
394
|
-
{
|
395
|
-
sigar_nfs_server_v3_t *nfs_server_v3;
|
396
|
-
Data_Get_Struct(self, sigar_nfs_server_v3_t, nfs_server_v3);
|
397
|
-
return rb_ll2inum(nfs_server_v3->write);
|
398
|
-
}
|
399
|
-
static VALUE rb_sigar_NfsServerV3_create(VALUE self)
|
400
|
-
{
|
401
|
-
sigar_nfs_server_v3_t *nfs_server_v3;
|
402
|
-
Data_Get_Struct(self, sigar_nfs_server_v3_t, nfs_server_v3);
|
403
|
-
return rb_ll2inum(nfs_server_v3->create);
|
404
|
-
}
|
405
|
-
static VALUE rb_sigar_NfsServerV3_mkdir(VALUE self)
|
406
|
-
{
|
407
|
-
sigar_nfs_server_v3_t *nfs_server_v3;
|
408
|
-
Data_Get_Struct(self, sigar_nfs_server_v3_t, nfs_server_v3);
|
409
|
-
return rb_ll2inum(nfs_server_v3->mkdir);
|
410
|
-
}
|
411
|
-
static VALUE rb_sigar_NfsServerV3_symlink(VALUE self)
|
412
|
-
{
|
413
|
-
sigar_nfs_server_v3_t *nfs_server_v3;
|
414
|
-
Data_Get_Struct(self, sigar_nfs_server_v3_t, nfs_server_v3);
|
415
|
-
return rb_ll2inum(nfs_server_v3->symlink);
|
416
|
-
}
|
417
|
-
static VALUE rb_sigar_NfsServerV3_mknod(VALUE self)
|
418
|
-
{
|
419
|
-
sigar_nfs_server_v3_t *nfs_server_v3;
|
420
|
-
Data_Get_Struct(self, sigar_nfs_server_v3_t, nfs_server_v3);
|
421
|
-
return rb_ll2inum(nfs_server_v3->mknod);
|
422
|
-
}
|
423
|
-
static VALUE rb_sigar_NfsServerV3_remove(VALUE self)
|
424
|
-
{
|
425
|
-
sigar_nfs_server_v3_t *nfs_server_v3;
|
426
|
-
Data_Get_Struct(self, sigar_nfs_server_v3_t, nfs_server_v3);
|
427
|
-
return rb_ll2inum(nfs_server_v3->remove);
|
428
|
-
}
|
429
|
-
static VALUE rb_sigar_NfsServerV3_rmdir(VALUE self)
|
430
|
-
{
|
431
|
-
sigar_nfs_server_v3_t *nfs_server_v3;
|
432
|
-
Data_Get_Struct(self, sigar_nfs_server_v3_t, nfs_server_v3);
|
433
|
-
return rb_ll2inum(nfs_server_v3->rmdir);
|
434
|
-
}
|
435
|
-
static VALUE rb_sigar_NfsServerV3_rename(VALUE self)
|
436
|
-
{
|
437
|
-
sigar_nfs_server_v3_t *nfs_server_v3;
|
438
|
-
Data_Get_Struct(self, sigar_nfs_server_v3_t, nfs_server_v3);
|
439
|
-
return rb_ll2inum(nfs_server_v3->rename);
|
440
|
-
}
|
441
|
-
static VALUE rb_sigar_NfsServerV3_link(VALUE self)
|
442
|
-
{
|
443
|
-
sigar_nfs_server_v3_t *nfs_server_v3;
|
444
|
-
Data_Get_Struct(self, sigar_nfs_server_v3_t, nfs_server_v3);
|
445
|
-
return rb_ll2inum(nfs_server_v3->link);
|
446
|
-
}
|
447
|
-
static VALUE rb_sigar_NfsServerV3_readdir(VALUE self)
|
448
|
-
{
|
449
|
-
sigar_nfs_server_v3_t *nfs_server_v3;
|
450
|
-
Data_Get_Struct(self, sigar_nfs_server_v3_t, nfs_server_v3);
|
451
|
-
return rb_ll2inum(nfs_server_v3->readdir);
|
452
|
-
}
|
453
|
-
static VALUE rb_sigar_NfsServerV3_readdirplus(VALUE self)
|
454
|
-
{
|
455
|
-
sigar_nfs_server_v3_t *nfs_server_v3;
|
456
|
-
Data_Get_Struct(self, sigar_nfs_server_v3_t, nfs_server_v3);
|
457
|
-
return rb_ll2inum(nfs_server_v3->readdirplus);
|
458
|
-
}
|
459
|
-
static VALUE rb_sigar_NfsServerV3_fsstat(VALUE self)
|
460
|
-
{
|
461
|
-
sigar_nfs_server_v3_t *nfs_server_v3;
|
462
|
-
Data_Get_Struct(self, sigar_nfs_server_v3_t, nfs_server_v3);
|
463
|
-
return rb_ll2inum(nfs_server_v3->fsstat);
|
464
|
-
}
|
465
|
-
static VALUE rb_sigar_NfsServerV3_fsinfo(VALUE self)
|
466
|
-
{
|
467
|
-
sigar_nfs_server_v3_t *nfs_server_v3;
|
468
|
-
Data_Get_Struct(self, sigar_nfs_server_v3_t, nfs_server_v3);
|
469
|
-
return rb_ll2inum(nfs_server_v3->fsinfo);
|
470
|
-
}
|
471
|
-
static VALUE rb_sigar_NfsServerV3_pathconf(VALUE self)
|
472
|
-
{
|
473
|
-
sigar_nfs_server_v3_t *nfs_server_v3;
|
474
|
-
Data_Get_Struct(self, sigar_nfs_server_v3_t, nfs_server_v3);
|
475
|
-
return rb_ll2inum(nfs_server_v3->pathconf);
|
476
|
-
}
|
477
|
-
static VALUE rb_sigar_NfsServerV3_commit(VALUE self)
|
478
|
-
{
|
479
|
-
sigar_nfs_server_v3_t *nfs_server_v3;
|
480
|
-
Data_Get_Struct(self, sigar_nfs_server_v3_t, nfs_server_v3);
|
481
|
-
return rb_ll2inum(nfs_server_v3->commit);
|
482
|
-
}
|
483
|
-
static VALUE rb_cSigarFileAttrs;
|
484
|
-
|
485
|
-
static VALUE rb_sigar_file_attrs(VALUE obj, VALUE name)
|
486
|
-
{
|
487
|
-
SIGAR_GET;
|
488
|
-
|
489
|
-
int status;
|
490
|
-
sigar_file_attrs_t *RETVAL = malloc(sizeof(*RETVAL));
|
491
|
-
|
492
|
-
if ((status = sigar_file_attrs_get(sigar, StringValuePtr(name), RETVAL)) != SIGAR_OK) {
|
493
|
-
free(RETVAL);
|
494
|
-
rb_raise(rb_eArgError, "%s", sigar_strerror(sigar, status));
|
495
|
-
return Qnil;
|
496
|
-
}
|
497
|
-
|
498
|
-
return Data_Wrap_Struct(rb_cSigarFileAttrs, 0, rb_sigar_free, RETVAL);
|
499
|
-
}
|
500
|
-
static VALUE rb_sigar_FileAttrs_permissions(VALUE self)
|
501
|
-
{
|
502
|
-
sigar_file_attrs_t *file_attrs;
|
503
|
-
Data_Get_Struct(self, sigar_file_attrs_t, file_attrs);
|
504
|
-
return rb_ll2inum(file_attrs->permissions);
|
505
|
-
}
|
506
|
-
static VALUE rb_sigar_FileAttrs_type(VALUE self)
|
507
|
-
{
|
508
|
-
sigar_file_attrs_t *file_attrs;
|
509
|
-
Data_Get_Struct(self, sigar_file_attrs_t, file_attrs);
|
510
|
-
return rb_int2inum(file_attrs->type);
|
511
|
-
}
|
512
|
-
static VALUE rb_sigar_FileAttrs_uid(VALUE self)
|
513
|
-
{
|
514
|
-
sigar_file_attrs_t *file_attrs;
|
515
|
-
Data_Get_Struct(self, sigar_file_attrs_t, file_attrs);
|
516
|
-
return rb_ll2inum(file_attrs->uid);
|
517
|
-
}
|
518
|
-
static VALUE rb_sigar_FileAttrs_gid(VALUE self)
|
519
|
-
{
|
520
|
-
sigar_file_attrs_t *file_attrs;
|
521
|
-
Data_Get_Struct(self, sigar_file_attrs_t, file_attrs);
|
522
|
-
return rb_ll2inum(file_attrs->gid);
|
523
|
-
}
|
524
|
-
static VALUE rb_sigar_FileAttrs_inode(VALUE self)
|
525
|
-
{
|
526
|
-
sigar_file_attrs_t *file_attrs;
|
527
|
-
Data_Get_Struct(self, sigar_file_attrs_t, file_attrs);
|
528
|
-
return rb_ll2inum(file_attrs->inode);
|
529
|
-
}
|
530
|
-
static VALUE rb_sigar_FileAttrs_device(VALUE self)
|
531
|
-
{
|
532
|
-
sigar_file_attrs_t *file_attrs;
|
533
|
-
Data_Get_Struct(self, sigar_file_attrs_t, file_attrs);
|
534
|
-
return rb_ll2inum(file_attrs->device);
|
535
|
-
}
|
536
|
-
static VALUE rb_sigar_FileAttrs_nlink(VALUE self)
|
537
|
-
{
|
538
|
-
sigar_file_attrs_t *file_attrs;
|
539
|
-
Data_Get_Struct(self, sigar_file_attrs_t, file_attrs);
|
540
|
-
return rb_ll2inum(file_attrs->nlink);
|
541
|
-
}
|
542
|
-
static VALUE rb_sigar_FileAttrs_size(VALUE self)
|
543
|
-
{
|
544
|
-
sigar_file_attrs_t *file_attrs;
|
545
|
-
Data_Get_Struct(self, sigar_file_attrs_t, file_attrs);
|
546
|
-
return rb_ll2inum(file_attrs->size);
|
547
|
-
}
|
548
|
-
static VALUE rb_sigar_FileAttrs_atime(VALUE self)
|
549
|
-
{
|
550
|
-
sigar_file_attrs_t *file_attrs;
|
551
|
-
Data_Get_Struct(self, sigar_file_attrs_t, file_attrs);
|
552
|
-
return rb_ll2inum(file_attrs->atime);
|
553
|
-
}
|
554
|
-
static VALUE rb_sigar_FileAttrs_ctime(VALUE self)
|
555
|
-
{
|
556
|
-
sigar_file_attrs_t *file_attrs;
|
557
|
-
Data_Get_Struct(self, sigar_file_attrs_t, file_attrs);
|
558
|
-
return rb_ll2inum(file_attrs->ctime);
|
559
|
-
}
|
560
|
-
static VALUE rb_sigar_FileAttrs_mtime(VALUE self)
|
561
|
-
{
|
562
|
-
sigar_file_attrs_t *file_attrs;
|
563
|
-
Data_Get_Struct(self, sigar_file_attrs_t, file_attrs);
|
564
|
-
return rb_ll2inum(file_attrs->mtime);
|
565
|
-
}
|
566
|
-
static VALUE rb_cSigarCpu;
|
567
|
-
|
568
|
-
static VALUE rb_sigar_cpu(VALUE obj)
|
569
|
-
{
|
570
|
-
SIGAR_GET;
|
571
|
-
|
572
|
-
int status;
|
573
|
-
sigar_cpu_t *RETVAL = malloc(sizeof(*RETVAL));
|
574
|
-
|
575
|
-
if ((status = sigar_cpu_get(sigar, RETVAL)) != SIGAR_OK) {
|
576
|
-
free(RETVAL);
|
577
|
-
rb_raise(rb_eArgError, "%s", sigar_strerror(sigar, status));
|
578
|
-
return Qnil;
|
579
|
-
}
|
580
|
-
|
581
|
-
return Data_Wrap_Struct(rb_cSigarCpu, 0, rb_sigar_free, RETVAL);
|
582
|
-
}
|
583
|
-
static VALUE rb_sigar_Cpu_user(VALUE self)
|
584
|
-
{
|
585
|
-
sigar_cpu_t *cpu;
|
586
|
-
Data_Get_Struct(self, sigar_cpu_t, cpu);
|
587
|
-
return rb_ll2inum(cpu->user);
|
588
|
-
}
|
589
|
-
static VALUE rb_sigar_Cpu_sys(VALUE self)
|
590
|
-
{
|
591
|
-
sigar_cpu_t *cpu;
|
592
|
-
Data_Get_Struct(self, sigar_cpu_t, cpu);
|
593
|
-
return rb_ll2inum(cpu->sys);
|
594
|
-
}
|
595
|
-
static VALUE rb_sigar_Cpu_nice(VALUE self)
|
596
|
-
{
|
597
|
-
sigar_cpu_t *cpu;
|
598
|
-
Data_Get_Struct(self, sigar_cpu_t, cpu);
|
599
|
-
return rb_ll2inum(cpu->nice);
|
600
|
-
}
|
601
|
-
static VALUE rb_sigar_Cpu_idle(VALUE self)
|
602
|
-
{
|
603
|
-
sigar_cpu_t *cpu;
|
604
|
-
Data_Get_Struct(self, sigar_cpu_t, cpu);
|
605
|
-
return rb_ll2inum(cpu->idle);
|
606
|
-
}
|
607
|
-
static VALUE rb_sigar_Cpu_wait(VALUE self)
|
608
|
-
{
|
609
|
-
sigar_cpu_t *cpu;
|
610
|
-
Data_Get_Struct(self, sigar_cpu_t, cpu);
|
611
|
-
return rb_ll2inum(cpu->wait);
|
612
|
-
}
|
613
|
-
static VALUE rb_sigar_Cpu_irq(VALUE self)
|
614
|
-
{
|
615
|
-
sigar_cpu_t *cpu;
|
616
|
-
Data_Get_Struct(self, sigar_cpu_t, cpu);
|
617
|
-
return rb_ll2inum(cpu->irq);
|
618
|
-
}
|
619
|
-
static VALUE rb_sigar_Cpu_soft_irq(VALUE self)
|
620
|
-
{
|
621
|
-
sigar_cpu_t *cpu;
|
622
|
-
Data_Get_Struct(self, sigar_cpu_t, cpu);
|
623
|
-
return rb_ll2inum(cpu->soft_irq);
|
624
|
-
}
|
625
|
-
static VALUE rb_sigar_Cpu_stolen(VALUE self)
|
626
|
-
{
|
627
|
-
sigar_cpu_t *cpu;
|
628
|
-
Data_Get_Struct(self, sigar_cpu_t, cpu);
|
629
|
-
return rb_ll2inum(cpu->stolen);
|
630
|
-
}
|
631
|
-
static VALUE rb_sigar_Cpu_total(VALUE self)
|
632
|
-
{
|
633
|
-
sigar_cpu_t *cpu;
|
634
|
-
Data_Get_Struct(self, sigar_cpu_t, cpu);
|
635
|
-
return rb_ll2inum(cpu->total);
|
636
|
-
}
|
637
|
-
static VALUE rb_cSigarNfsClientV2;
|
638
|
-
|
639
|
-
static VALUE rb_sigar_nfs_client_v2(VALUE obj)
|
640
|
-
{
|
641
|
-
SIGAR_GET;
|
642
|
-
|
643
|
-
int status;
|
644
|
-
sigar_nfs_client_v2_t *RETVAL = malloc(sizeof(*RETVAL));
|
645
|
-
|
646
|
-
if ((status = sigar_nfs_client_v2_get(sigar, RETVAL)) != SIGAR_OK) {
|
647
|
-
free(RETVAL);
|
648
|
-
rb_raise(rb_eArgError, "%s", sigar_strerror(sigar, status));
|
649
|
-
return Qnil;
|
650
|
-
}
|
651
|
-
|
652
|
-
return Data_Wrap_Struct(rb_cSigarNfsClientV2, 0, rb_sigar_free, RETVAL);
|
653
|
-
}
|
654
|
-
static VALUE rb_sigar_NfsClientV2_null(VALUE self)
|
655
|
-
{
|
656
|
-
sigar_nfs_client_v2_t *nfs_client_v2;
|
657
|
-
Data_Get_Struct(self, sigar_nfs_client_v2_t, nfs_client_v2);
|
658
|
-
return rb_ll2inum(nfs_client_v2->null);
|
659
|
-
}
|
660
|
-
static VALUE rb_sigar_NfsClientV2_getattr(VALUE self)
|
661
|
-
{
|
662
|
-
sigar_nfs_client_v2_t *nfs_client_v2;
|
663
|
-
Data_Get_Struct(self, sigar_nfs_client_v2_t, nfs_client_v2);
|
664
|
-
return rb_ll2inum(nfs_client_v2->getattr);
|
665
|
-
}
|
666
|
-
static VALUE rb_sigar_NfsClientV2_setattr(VALUE self)
|
667
|
-
{
|
668
|
-
sigar_nfs_client_v2_t *nfs_client_v2;
|
669
|
-
Data_Get_Struct(self, sigar_nfs_client_v2_t, nfs_client_v2);
|
670
|
-
return rb_ll2inum(nfs_client_v2->setattr);
|
671
|
-
}
|
672
|
-
static VALUE rb_sigar_NfsClientV2_root(VALUE self)
|
673
|
-
{
|
674
|
-
sigar_nfs_client_v2_t *nfs_client_v2;
|
675
|
-
Data_Get_Struct(self, sigar_nfs_client_v2_t, nfs_client_v2);
|
676
|
-
return rb_ll2inum(nfs_client_v2->root);
|
677
|
-
}
|
678
|
-
static VALUE rb_sigar_NfsClientV2_lookup(VALUE self)
|
679
|
-
{
|
680
|
-
sigar_nfs_client_v2_t *nfs_client_v2;
|
681
|
-
Data_Get_Struct(self, sigar_nfs_client_v2_t, nfs_client_v2);
|
682
|
-
return rb_ll2inum(nfs_client_v2->lookup);
|
683
|
-
}
|
684
|
-
static VALUE rb_sigar_NfsClientV2_readlink(VALUE self)
|
685
|
-
{
|
686
|
-
sigar_nfs_client_v2_t *nfs_client_v2;
|
687
|
-
Data_Get_Struct(self, sigar_nfs_client_v2_t, nfs_client_v2);
|
688
|
-
return rb_ll2inum(nfs_client_v2->readlink);
|
689
|
-
}
|
690
|
-
static VALUE rb_sigar_NfsClientV2_read(VALUE self)
|
691
|
-
{
|
692
|
-
sigar_nfs_client_v2_t *nfs_client_v2;
|
693
|
-
Data_Get_Struct(self, sigar_nfs_client_v2_t, nfs_client_v2);
|
694
|
-
return rb_ll2inum(nfs_client_v2->read);
|
695
|
-
}
|
696
|
-
static VALUE rb_sigar_NfsClientV2_writecache(VALUE self)
|
697
|
-
{
|
698
|
-
sigar_nfs_client_v2_t *nfs_client_v2;
|
699
|
-
Data_Get_Struct(self, sigar_nfs_client_v2_t, nfs_client_v2);
|
700
|
-
return rb_ll2inum(nfs_client_v2->writecache);
|
701
|
-
}
|
702
|
-
static VALUE rb_sigar_NfsClientV2_write(VALUE self)
|
703
|
-
{
|
704
|
-
sigar_nfs_client_v2_t *nfs_client_v2;
|
705
|
-
Data_Get_Struct(self, sigar_nfs_client_v2_t, nfs_client_v2);
|
706
|
-
return rb_ll2inum(nfs_client_v2->write);
|
707
|
-
}
|
708
|
-
static VALUE rb_sigar_NfsClientV2_create(VALUE self)
|
709
|
-
{
|
710
|
-
sigar_nfs_client_v2_t *nfs_client_v2;
|
711
|
-
Data_Get_Struct(self, sigar_nfs_client_v2_t, nfs_client_v2);
|
712
|
-
return rb_ll2inum(nfs_client_v2->create);
|
713
|
-
}
|
714
|
-
static VALUE rb_sigar_NfsClientV2_remove(VALUE self)
|
715
|
-
{
|
716
|
-
sigar_nfs_client_v2_t *nfs_client_v2;
|
717
|
-
Data_Get_Struct(self, sigar_nfs_client_v2_t, nfs_client_v2);
|
718
|
-
return rb_ll2inum(nfs_client_v2->remove);
|
719
|
-
}
|
720
|
-
static VALUE rb_sigar_NfsClientV2_rename(VALUE self)
|
721
|
-
{
|
722
|
-
sigar_nfs_client_v2_t *nfs_client_v2;
|
723
|
-
Data_Get_Struct(self, sigar_nfs_client_v2_t, nfs_client_v2);
|
724
|
-
return rb_ll2inum(nfs_client_v2->rename);
|
725
|
-
}
|
726
|
-
static VALUE rb_sigar_NfsClientV2_link(VALUE self)
|
727
|
-
{
|
728
|
-
sigar_nfs_client_v2_t *nfs_client_v2;
|
729
|
-
Data_Get_Struct(self, sigar_nfs_client_v2_t, nfs_client_v2);
|
730
|
-
return rb_ll2inum(nfs_client_v2->link);
|
731
|
-
}
|
732
|
-
static VALUE rb_sigar_NfsClientV2_symlink(VALUE self)
|
733
|
-
{
|
734
|
-
sigar_nfs_client_v2_t *nfs_client_v2;
|
735
|
-
Data_Get_Struct(self, sigar_nfs_client_v2_t, nfs_client_v2);
|
736
|
-
return rb_ll2inum(nfs_client_v2->symlink);
|
737
|
-
}
|
738
|
-
static VALUE rb_sigar_NfsClientV2_mkdir(VALUE self)
|
739
|
-
{
|
740
|
-
sigar_nfs_client_v2_t *nfs_client_v2;
|
741
|
-
Data_Get_Struct(self, sigar_nfs_client_v2_t, nfs_client_v2);
|
742
|
-
return rb_ll2inum(nfs_client_v2->mkdir);
|
743
|
-
}
|
744
|
-
static VALUE rb_sigar_NfsClientV2_rmdir(VALUE self)
|
745
|
-
{
|
746
|
-
sigar_nfs_client_v2_t *nfs_client_v2;
|
747
|
-
Data_Get_Struct(self, sigar_nfs_client_v2_t, nfs_client_v2);
|
748
|
-
return rb_ll2inum(nfs_client_v2->rmdir);
|
749
|
-
}
|
750
|
-
static VALUE rb_sigar_NfsClientV2_readdir(VALUE self)
|
751
|
-
{
|
752
|
-
sigar_nfs_client_v2_t *nfs_client_v2;
|
753
|
-
Data_Get_Struct(self, sigar_nfs_client_v2_t, nfs_client_v2);
|
754
|
-
return rb_ll2inum(nfs_client_v2->readdir);
|
755
|
-
}
|
756
|
-
static VALUE rb_sigar_NfsClientV2_fsstat(VALUE self)
|
757
|
-
{
|
758
|
-
sigar_nfs_client_v2_t *nfs_client_v2;
|
759
|
-
Data_Get_Struct(self, sigar_nfs_client_v2_t, nfs_client_v2);
|
760
|
-
return rb_ll2inum(nfs_client_v2->fsstat);
|
761
|
-
}
|
762
|
-
static VALUE rb_cSigarDiskUsage;
|
763
|
-
|
764
|
-
static VALUE rb_sigar_disk_usage(VALUE obj, VALUE name)
|
765
|
-
{
|
766
|
-
SIGAR_GET;
|
767
|
-
|
768
|
-
int status;
|
769
|
-
sigar_disk_usage_t *RETVAL = malloc(sizeof(*RETVAL));
|
770
|
-
|
771
|
-
if ((status = sigar_disk_usage_get(sigar, StringValuePtr(name), RETVAL)) != SIGAR_OK) {
|
772
|
-
free(RETVAL);
|
773
|
-
rb_raise(rb_eArgError, "%s", sigar_strerror(sigar, status));
|
774
|
-
return Qnil;
|
775
|
-
}
|
776
|
-
|
777
|
-
return Data_Wrap_Struct(rb_cSigarDiskUsage, 0, rb_sigar_free, RETVAL);
|
778
|
-
}
|
779
|
-
static VALUE rb_sigar_DiskUsage_reads(VALUE self)
|
780
|
-
{
|
781
|
-
sigar_disk_usage_t *disk_usage;
|
782
|
-
Data_Get_Struct(self, sigar_disk_usage_t, disk_usage);
|
783
|
-
return rb_ll2inum(disk_usage->reads);
|
784
|
-
}
|
785
|
-
static VALUE rb_sigar_DiskUsage_writes(VALUE self)
|
786
|
-
{
|
787
|
-
sigar_disk_usage_t *disk_usage;
|
788
|
-
Data_Get_Struct(self, sigar_disk_usage_t, disk_usage);
|
789
|
-
return rb_ll2inum(disk_usage->writes);
|
790
|
-
}
|
791
|
-
static VALUE rb_sigar_DiskUsage_read_bytes(VALUE self)
|
792
|
-
{
|
793
|
-
sigar_disk_usage_t *disk_usage;
|
794
|
-
Data_Get_Struct(self, sigar_disk_usage_t, disk_usage);
|
795
|
-
return rb_ll2inum(disk_usage->read_bytes);
|
796
|
-
}
|
797
|
-
static VALUE rb_sigar_DiskUsage_write_bytes(VALUE self)
|
798
|
-
{
|
799
|
-
sigar_disk_usage_t *disk_usage;
|
800
|
-
Data_Get_Struct(self, sigar_disk_usage_t, disk_usage);
|
801
|
-
return rb_ll2inum(disk_usage->write_bytes);
|
802
|
-
}
|
803
|
-
static VALUE rb_sigar_DiskUsage_queue(VALUE self)
|
804
|
-
{
|
805
|
-
sigar_disk_usage_t *disk_usage;
|
806
|
-
Data_Get_Struct(self, sigar_disk_usage_t, disk_usage);
|
807
|
-
return rb_float_new(disk_usage->queue);
|
808
|
-
}
|
809
|
-
static VALUE rb_sigar_DiskUsage_service_time(VALUE self)
|
810
|
-
{
|
811
|
-
sigar_disk_usage_t *disk_usage;
|
812
|
-
Data_Get_Struct(self, sigar_disk_usage_t, disk_usage);
|
813
|
-
return rb_float_new(disk_usage->service_time);
|
814
|
-
}
|
815
|
-
static VALUE rb_sigar_CpuInfo_vendor(VALUE self)
|
816
|
-
{
|
817
|
-
sigar_cpu_info_t *cpu_info;
|
818
|
-
Data_Get_Struct(self, sigar_cpu_info_t, cpu_info);
|
819
|
-
return rb_str_new2(cpu_info->vendor);
|
820
|
-
}
|
821
|
-
static VALUE rb_sigar_CpuInfo_model(VALUE self)
|
822
|
-
{
|
823
|
-
sigar_cpu_info_t *cpu_info;
|
824
|
-
Data_Get_Struct(self, sigar_cpu_info_t, cpu_info);
|
825
|
-
return rb_str_new2(cpu_info->model);
|
826
|
-
}
|
827
|
-
static VALUE rb_sigar_CpuInfo_mhz(VALUE self)
|
828
|
-
{
|
829
|
-
sigar_cpu_info_t *cpu_info;
|
830
|
-
Data_Get_Struct(self, sigar_cpu_info_t, cpu_info);
|
831
|
-
return rb_int2inum(cpu_info->mhz);
|
832
|
-
}
|
833
|
-
static VALUE rb_sigar_CpuInfo_mhz_max(VALUE self)
|
834
|
-
{
|
835
|
-
sigar_cpu_info_t *cpu_info;
|
836
|
-
Data_Get_Struct(self, sigar_cpu_info_t, cpu_info);
|
837
|
-
return rb_int2inum(cpu_info->mhz_max);
|
838
|
-
}
|
839
|
-
static VALUE rb_sigar_CpuInfo_mhz_min(VALUE self)
|
840
|
-
{
|
841
|
-
sigar_cpu_info_t *cpu_info;
|
842
|
-
Data_Get_Struct(self, sigar_cpu_info_t, cpu_info);
|
843
|
-
return rb_int2inum(cpu_info->mhz_min);
|
844
|
-
}
|
845
|
-
static VALUE rb_sigar_CpuInfo_cache_size(VALUE self)
|
846
|
-
{
|
847
|
-
sigar_cpu_info_t *cpu_info;
|
848
|
-
Data_Get_Struct(self, sigar_cpu_info_t, cpu_info);
|
849
|
-
return rb_ll2inum(cpu_info->cache_size);
|
850
|
-
}
|
851
|
-
static VALUE rb_sigar_CpuInfo_total_cores(VALUE self)
|
852
|
-
{
|
853
|
-
sigar_cpu_info_t *cpu_info;
|
854
|
-
Data_Get_Struct(self, sigar_cpu_info_t, cpu_info);
|
855
|
-
return rb_int2inum(cpu_info->total_cores);
|
856
|
-
}
|
857
|
-
static VALUE rb_sigar_CpuInfo_total_sockets(VALUE self)
|
858
|
-
{
|
859
|
-
sigar_cpu_info_t *cpu_info;
|
860
|
-
Data_Get_Struct(self, sigar_cpu_info_t, cpu_info);
|
861
|
-
return rb_int2inum(cpu_info->total_sockets);
|
862
|
-
}
|
863
|
-
static VALUE rb_sigar_CpuInfo_cores_per_socket(VALUE self)
|
864
|
-
{
|
865
|
-
sigar_cpu_info_t *cpu_info;
|
866
|
-
Data_Get_Struct(self, sigar_cpu_info_t, cpu_info);
|
867
|
-
return rb_int2inum(cpu_info->cores_per_socket);
|
868
|
-
}
|
869
|
-
static VALUE rb_sigar_FileSystem_dir_name(VALUE self)
|
870
|
-
{
|
871
|
-
sigar_file_system_t *file_system;
|
872
|
-
Data_Get_Struct(self, sigar_file_system_t, file_system);
|
873
|
-
return rb_str_new2(file_system->dir_name);
|
874
|
-
}
|
875
|
-
static VALUE rb_sigar_FileSystem_dev_name(VALUE self)
|
876
|
-
{
|
877
|
-
sigar_file_system_t *file_system;
|
878
|
-
Data_Get_Struct(self, sigar_file_system_t, file_system);
|
879
|
-
return rb_str_new2(file_system->dev_name);
|
880
|
-
}
|
881
|
-
static VALUE rb_sigar_FileSystem_type_name(VALUE self)
|
882
|
-
{
|
883
|
-
sigar_file_system_t *file_system;
|
884
|
-
Data_Get_Struct(self, sigar_file_system_t, file_system);
|
885
|
-
return rb_str_new2(file_system->type_name);
|
886
|
-
}
|
887
|
-
static VALUE rb_sigar_FileSystem_sys_type_name(VALUE self)
|
888
|
-
{
|
889
|
-
sigar_file_system_t *file_system;
|
890
|
-
Data_Get_Struct(self, sigar_file_system_t, file_system);
|
891
|
-
return rb_str_new2(file_system->sys_type_name);
|
892
|
-
}
|
893
|
-
static VALUE rb_sigar_FileSystem_options(VALUE self)
|
894
|
-
{
|
895
|
-
sigar_file_system_t *file_system;
|
896
|
-
Data_Get_Struct(self, sigar_file_system_t, file_system);
|
897
|
-
return rb_str_new2(file_system->options);
|
898
|
-
}
|
899
|
-
static VALUE rb_sigar_FileSystem_type(VALUE self)
|
900
|
-
{
|
901
|
-
sigar_file_system_t *file_system;
|
902
|
-
Data_Get_Struct(self, sigar_file_system_t, file_system);
|
903
|
-
return rb_int2inum(file_system->type);
|
904
|
-
}
|
905
|
-
static VALUE rb_sigar_FileSystem_flags(VALUE self)
|
906
|
-
{
|
907
|
-
sigar_file_system_t *file_system;
|
908
|
-
Data_Get_Struct(self, sigar_file_system_t, file_system);
|
909
|
-
return rb_ll2inum(file_system->flags);
|
910
|
-
}
|
911
|
-
static VALUE rb_sigar_Who_user(VALUE self)
|
912
|
-
{
|
913
|
-
sigar_who_t *who;
|
914
|
-
Data_Get_Struct(self, sigar_who_t, who);
|
915
|
-
return rb_str_new2(who->user);
|
916
|
-
}
|
917
|
-
static VALUE rb_sigar_Who_device(VALUE self)
|
918
|
-
{
|
919
|
-
sigar_who_t *who;
|
920
|
-
Data_Get_Struct(self, sigar_who_t, who);
|
921
|
-
return rb_str_new2(who->device);
|
922
|
-
}
|
923
|
-
static VALUE rb_sigar_Who_host(VALUE self)
|
924
|
-
{
|
925
|
-
sigar_who_t *who;
|
926
|
-
Data_Get_Struct(self, sigar_who_t, who);
|
927
|
-
return rb_str_new2(who->host);
|
928
|
-
}
|
929
|
-
static VALUE rb_sigar_Who_time(VALUE self)
|
930
|
-
{
|
931
|
-
sigar_who_t *who;
|
932
|
-
Data_Get_Struct(self, sigar_who_t, who);
|
933
|
-
return rb_ll2inum(who->time);
|
934
|
-
}
|
935
|
-
static VALUE rb_cSigarSwap;
|
936
|
-
|
937
|
-
static VALUE rb_sigar_swap(VALUE obj)
|
938
|
-
{
|
939
|
-
SIGAR_GET;
|
940
|
-
|
941
|
-
int status;
|
942
|
-
sigar_swap_t *RETVAL = malloc(sizeof(*RETVAL));
|
943
|
-
|
944
|
-
if ((status = sigar_swap_get(sigar, RETVAL)) != SIGAR_OK) {
|
945
|
-
free(RETVAL);
|
946
|
-
rb_raise(rb_eArgError, "%s", sigar_strerror(sigar, status));
|
947
|
-
return Qnil;
|
948
|
-
}
|
949
|
-
|
950
|
-
return Data_Wrap_Struct(rb_cSigarSwap, 0, rb_sigar_free, RETVAL);
|
951
|
-
}
|
952
|
-
static VALUE rb_sigar_Swap_total(VALUE self)
|
953
|
-
{
|
954
|
-
sigar_swap_t *swap;
|
955
|
-
Data_Get_Struct(self, sigar_swap_t, swap);
|
956
|
-
return rb_ll2inum(swap->total);
|
957
|
-
}
|
958
|
-
static VALUE rb_sigar_Swap_used(VALUE self)
|
959
|
-
{
|
960
|
-
sigar_swap_t *swap;
|
961
|
-
Data_Get_Struct(self, sigar_swap_t, swap);
|
962
|
-
return rb_ll2inum(swap->used);
|
963
|
-
}
|
964
|
-
static VALUE rb_sigar_Swap_free(VALUE self)
|
965
|
-
{
|
966
|
-
sigar_swap_t *swap;
|
967
|
-
Data_Get_Struct(self, sigar_swap_t, swap);
|
968
|
-
return rb_ll2inum(swap->free);
|
969
|
-
}
|
970
|
-
static VALUE rb_sigar_Swap_page_in(VALUE self)
|
971
|
-
{
|
972
|
-
sigar_swap_t *swap;
|
973
|
-
Data_Get_Struct(self, sigar_swap_t, swap);
|
974
|
-
return rb_ll2inum(swap->page_in);
|
975
|
-
}
|
976
|
-
static VALUE rb_sigar_Swap_page_out(VALUE self)
|
977
|
-
{
|
978
|
-
sigar_swap_t *swap;
|
979
|
-
Data_Get_Struct(self, sigar_swap_t, swap);
|
980
|
-
return rb_ll2inum(swap->page_out);
|
981
|
-
}
|
982
|
-
static VALUE rb_cSigarProcTime;
|
983
|
-
|
984
|
-
static VALUE rb_sigar_proc_time(VALUE obj, VALUE pid)
|
985
|
-
{
|
986
|
-
SIGAR_GET;
|
987
|
-
|
988
|
-
int status;
|
989
|
-
sigar_proc_time_t *RETVAL = malloc(sizeof(*RETVAL));
|
990
|
-
|
991
|
-
if ((status = sigar_proc_time_get(sigar, OBJ2PID(pid), RETVAL)) != SIGAR_OK) {
|
992
|
-
free(RETVAL);
|
993
|
-
rb_raise(rb_eArgError, "%s", sigar_strerror(sigar, status));
|
994
|
-
return Qnil;
|
995
|
-
}
|
996
|
-
|
997
|
-
return Data_Wrap_Struct(rb_cSigarProcTime, 0, rb_sigar_free, RETVAL);
|
998
|
-
}
|
999
|
-
static VALUE rb_sigar_ProcTime_start_time(VALUE self)
|
1000
|
-
{
|
1001
|
-
sigar_proc_time_t *proc_time;
|
1002
|
-
Data_Get_Struct(self, sigar_proc_time_t, proc_time);
|
1003
|
-
return rb_ll2inum(proc_time->start_time);
|
1004
|
-
}
|
1005
|
-
static VALUE rb_sigar_ProcTime_user(VALUE self)
|
1006
|
-
{
|
1007
|
-
sigar_proc_time_t *proc_time;
|
1008
|
-
Data_Get_Struct(self, sigar_proc_time_t, proc_time);
|
1009
|
-
return rb_ll2inum(proc_time->user);
|
1010
|
-
}
|
1011
|
-
static VALUE rb_sigar_ProcTime_sys(VALUE self)
|
1012
|
-
{
|
1013
|
-
sigar_proc_time_t *proc_time;
|
1014
|
-
Data_Get_Struct(self, sigar_proc_time_t, proc_time);
|
1015
|
-
return rb_ll2inum(proc_time->sys);
|
1016
|
-
}
|
1017
|
-
static VALUE rb_sigar_ProcTime_total(VALUE self)
|
1018
|
-
{
|
1019
|
-
sigar_proc_time_t *proc_time;
|
1020
|
-
Data_Get_Struct(self, sigar_proc_time_t, proc_time);
|
1021
|
-
return rb_ll2inum(proc_time->total);
|
1022
|
-
}
|
1023
|
-
static VALUE rb_cSigarFileSystemUsage;
|
1024
|
-
|
1025
|
-
static VALUE rb_sigar_file_system_usage(VALUE obj, VALUE name)
|
1026
|
-
{
|
1027
|
-
SIGAR_GET;
|
1028
|
-
|
1029
|
-
int status;
|
1030
|
-
sigar_file_system_usage_t *RETVAL = malloc(sizeof(*RETVAL));
|
1031
|
-
|
1032
|
-
if ((status = sigar_file_system_usage_get(sigar, StringValuePtr(name), RETVAL)) != SIGAR_OK) {
|
1033
|
-
free(RETVAL);
|
1034
|
-
rb_raise(rb_eArgError, "%s", sigar_strerror(sigar, status));
|
1035
|
-
return Qnil;
|
1036
|
-
}
|
1037
|
-
|
1038
|
-
return Data_Wrap_Struct(rb_cSigarFileSystemUsage, 0, rb_sigar_free, RETVAL);
|
1039
|
-
}
|
1040
|
-
static VALUE rb_sigar_FileSystemUsage_total(VALUE self)
|
1041
|
-
{
|
1042
|
-
sigar_file_system_usage_t *file_system_usage;
|
1043
|
-
Data_Get_Struct(self, sigar_file_system_usage_t, file_system_usage);
|
1044
|
-
return rb_ll2inum(file_system_usage->total);
|
1045
|
-
}
|
1046
|
-
static VALUE rb_sigar_FileSystemUsage_free(VALUE self)
|
1047
|
-
{
|
1048
|
-
sigar_file_system_usage_t *file_system_usage;
|
1049
|
-
Data_Get_Struct(self, sigar_file_system_usage_t, file_system_usage);
|
1050
|
-
return rb_ll2inum(file_system_usage->free);
|
1051
|
-
}
|
1052
|
-
static VALUE rb_sigar_FileSystemUsage_used(VALUE self)
|
1053
|
-
{
|
1054
|
-
sigar_file_system_usage_t *file_system_usage;
|
1055
|
-
Data_Get_Struct(self, sigar_file_system_usage_t, file_system_usage);
|
1056
|
-
return rb_ll2inum(file_system_usage->used);
|
1057
|
-
}
|
1058
|
-
static VALUE rb_sigar_FileSystemUsage_avail(VALUE self)
|
1059
|
-
{
|
1060
|
-
sigar_file_system_usage_t *file_system_usage;
|
1061
|
-
Data_Get_Struct(self, sigar_file_system_usage_t, file_system_usage);
|
1062
|
-
return rb_ll2inum(file_system_usage->avail);
|
1063
|
-
}
|
1064
|
-
static VALUE rb_sigar_FileSystemUsage_files(VALUE self)
|
1065
|
-
{
|
1066
|
-
sigar_file_system_usage_t *file_system_usage;
|
1067
|
-
Data_Get_Struct(self, sigar_file_system_usage_t, file_system_usage);
|
1068
|
-
return rb_ll2inum(file_system_usage->files);
|
1069
|
-
}
|
1070
|
-
static VALUE rb_sigar_FileSystemUsage_free_files(VALUE self)
|
1071
|
-
{
|
1072
|
-
sigar_file_system_usage_t *file_system_usage;
|
1073
|
-
Data_Get_Struct(self, sigar_file_system_usage_t, file_system_usage);
|
1074
|
-
return rb_ll2inum(file_system_usage->free_files);
|
1075
|
-
}
|
1076
|
-
static VALUE rb_sigar_FileSystemUsage_disk_reads(VALUE self)
|
1077
|
-
{
|
1078
|
-
sigar_file_system_usage_t *file_system_usage;
|
1079
|
-
Data_Get_Struct(self, sigar_file_system_usage_t, file_system_usage);
|
1080
|
-
return rb_ll2inum(file_system_usage->disk_reads);
|
1081
|
-
}
|
1082
|
-
static VALUE rb_sigar_FileSystemUsage_disk_writes(VALUE self)
|
1083
|
-
{
|
1084
|
-
sigar_file_system_usage_t *file_system_usage;
|
1085
|
-
Data_Get_Struct(self, sigar_file_system_usage_t, file_system_usage);
|
1086
|
-
return rb_ll2inum(file_system_usage->disk_writes);
|
1087
|
-
}
|
1088
|
-
static VALUE rb_sigar_FileSystemUsage_disk_read_bytes(VALUE self)
|
1089
|
-
{
|
1090
|
-
sigar_file_system_usage_t *file_system_usage;
|
1091
|
-
Data_Get_Struct(self, sigar_file_system_usage_t, file_system_usage);
|
1092
|
-
return rb_ll2inum(file_system_usage->disk_read_bytes);
|
1093
|
-
}
|
1094
|
-
static VALUE rb_sigar_FileSystemUsage_disk_write_bytes(VALUE self)
|
1095
|
-
{
|
1096
|
-
sigar_file_system_usage_t *file_system_usage;
|
1097
|
-
Data_Get_Struct(self, sigar_file_system_usage_t, file_system_usage);
|
1098
|
-
return rb_ll2inum(file_system_usage->disk_write_bytes);
|
1099
|
-
}
|
1100
|
-
static VALUE rb_sigar_FileSystemUsage_disk_queue(VALUE self)
|
1101
|
-
{
|
1102
|
-
sigar_file_system_usage_t *file_system_usage;
|
1103
|
-
Data_Get_Struct(self, sigar_file_system_usage_t, file_system_usage);
|
1104
|
-
return rb_float_new(file_system_usage->disk_queue);
|
1105
|
-
}
|
1106
|
-
static VALUE rb_sigar_FileSystemUsage_disk_service_time(VALUE self)
|
1107
|
-
{
|
1108
|
-
sigar_file_system_usage_t *file_system_usage;
|
1109
|
-
Data_Get_Struct(self, sigar_file_system_usage_t, file_system_usage);
|
1110
|
-
return rb_float_new(file_system_usage->disk_service_time);
|
1111
|
-
}
|
1112
|
-
static VALUE rb_sigar_FileSystemUsage_use_percent(VALUE self)
|
1113
|
-
{
|
1114
|
-
sigar_file_system_usage_t *file_system_usage;
|
1115
|
-
Data_Get_Struct(self, sigar_file_system_usage_t, file_system_usage);
|
1116
|
-
return rb_float_new(file_system_usage->use_percent);
|
1117
|
-
}
|
1118
|
-
static VALUE rb_cSigarProcMem;
|
1119
|
-
|
1120
|
-
static VALUE rb_sigar_proc_mem(VALUE obj, VALUE pid)
|
1121
|
-
{
|
1122
|
-
SIGAR_GET;
|
1123
|
-
|
1124
|
-
int status;
|
1125
|
-
sigar_proc_mem_t *RETVAL = malloc(sizeof(*RETVAL));
|
1126
|
-
|
1127
|
-
if ((status = sigar_proc_mem_get(sigar, OBJ2PID(pid), RETVAL)) != SIGAR_OK) {
|
1128
|
-
free(RETVAL);
|
1129
|
-
rb_raise(rb_eArgError, "%s", sigar_strerror(sigar, status));
|
1130
|
-
return Qnil;
|
1131
|
-
}
|
1132
|
-
|
1133
|
-
return Data_Wrap_Struct(rb_cSigarProcMem, 0, rb_sigar_free, RETVAL);
|
1134
|
-
}
|
1135
|
-
static VALUE rb_sigar_ProcMem_size(VALUE self)
|
1136
|
-
{
|
1137
|
-
sigar_proc_mem_t *proc_mem;
|
1138
|
-
Data_Get_Struct(self, sigar_proc_mem_t, proc_mem);
|
1139
|
-
return rb_ll2inum(proc_mem->size);
|
1140
|
-
}
|
1141
|
-
static VALUE rb_sigar_ProcMem_resident(VALUE self)
|
1142
|
-
{
|
1143
|
-
sigar_proc_mem_t *proc_mem;
|
1144
|
-
Data_Get_Struct(self, sigar_proc_mem_t, proc_mem);
|
1145
|
-
return rb_ll2inum(proc_mem->resident);
|
1146
|
-
}
|
1147
|
-
static VALUE rb_sigar_ProcMem_share(VALUE self)
|
1148
|
-
{
|
1149
|
-
sigar_proc_mem_t *proc_mem;
|
1150
|
-
Data_Get_Struct(self, sigar_proc_mem_t, proc_mem);
|
1151
|
-
return rb_ll2inum(proc_mem->share);
|
1152
|
-
}
|
1153
|
-
static VALUE rb_sigar_ProcMem_minor_faults(VALUE self)
|
1154
|
-
{
|
1155
|
-
sigar_proc_mem_t *proc_mem;
|
1156
|
-
Data_Get_Struct(self, sigar_proc_mem_t, proc_mem);
|
1157
|
-
return rb_ll2inum(proc_mem->minor_faults);
|
1158
|
-
}
|
1159
|
-
static VALUE rb_sigar_ProcMem_major_faults(VALUE self)
|
1160
|
-
{
|
1161
|
-
sigar_proc_mem_t *proc_mem;
|
1162
|
-
Data_Get_Struct(self, sigar_proc_mem_t, proc_mem);
|
1163
|
-
return rb_ll2inum(proc_mem->major_faults);
|
1164
|
-
}
|
1165
|
-
static VALUE rb_sigar_ProcMem_page_faults(VALUE self)
|
1166
|
-
{
|
1167
|
-
sigar_proc_mem_t *proc_mem;
|
1168
|
-
Data_Get_Struct(self, sigar_proc_mem_t, proc_mem);
|
1169
|
-
return rb_ll2inum(proc_mem->page_faults);
|
1170
|
-
}
|
1171
|
-
static VALUE rb_cSigarThreadCpu;
|
1172
|
-
|
1173
|
-
static VALUE rb_sigar_thread_cpu(VALUE obj, VALUE pid)
|
1174
|
-
{
|
1175
|
-
SIGAR_GET;
|
1176
|
-
|
1177
|
-
int status;
|
1178
|
-
sigar_thread_cpu_t *RETVAL = malloc(sizeof(*RETVAL));
|
1179
|
-
|
1180
|
-
if ((status = sigar_thread_cpu_get(sigar, OBJ2PID(pid), RETVAL)) != SIGAR_OK) {
|
1181
|
-
free(RETVAL);
|
1182
|
-
rb_raise(rb_eArgError, "%s", sigar_strerror(sigar, status));
|
1183
|
-
return Qnil;
|
1184
|
-
}
|
1185
|
-
|
1186
|
-
return Data_Wrap_Struct(rb_cSigarThreadCpu, 0, rb_sigar_free, RETVAL);
|
1187
|
-
}
|
1188
|
-
static VALUE rb_sigar_ThreadCpu_user(VALUE self)
|
1189
|
-
{
|
1190
|
-
sigar_thread_cpu_t *thread_cpu;
|
1191
|
-
Data_Get_Struct(self, sigar_thread_cpu_t, thread_cpu);
|
1192
|
-
return rb_ll2inum(thread_cpu->user);
|
1193
|
-
}
|
1194
|
-
static VALUE rb_sigar_ThreadCpu_sys(VALUE self)
|
1195
|
-
{
|
1196
|
-
sigar_thread_cpu_t *thread_cpu;
|
1197
|
-
Data_Get_Struct(self, sigar_thread_cpu_t, thread_cpu);
|
1198
|
-
return rb_ll2inum(thread_cpu->sys);
|
1199
|
-
}
|
1200
|
-
static VALUE rb_sigar_ThreadCpu_total(VALUE self)
|
1201
|
-
{
|
1202
|
-
sigar_thread_cpu_t *thread_cpu;
|
1203
|
-
Data_Get_Struct(self, sigar_thread_cpu_t, thread_cpu);
|
1204
|
-
return rb_ll2inum(thread_cpu->total);
|
1205
|
-
}
|
1206
|
-
static VALUE rb_sigar_NetRoute_destination(VALUE self)
|
1207
|
-
{
|
1208
|
-
sigar_net_route_t *net_route;
|
1209
|
-
Data_Get_Struct(self, sigar_net_route_t, net_route);
|
1210
|
-
return rb_sigar_net_address_to_s(net_route->destination);
|
1211
|
-
}
|
1212
|
-
static VALUE rb_sigar_NetRoute_gateway(VALUE self)
|
1213
|
-
{
|
1214
|
-
sigar_net_route_t *net_route;
|
1215
|
-
Data_Get_Struct(self, sigar_net_route_t, net_route);
|
1216
|
-
return rb_sigar_net_address_to_s(net_route->gateway);
|
1217
|
-
}
|
1218
|
-
static VALUE rb_sigar_NetRoute_flags(VALUE self)
|
1219
|
-
{
|
1220
|
-
sigar_net_route_t *net_route;
|
1221
|
-
Data_Get_Struct(self, sigar_net_route_t, net_route);
|
1222
|
-
return rb_ll2inum(net_route->flags);
|
1223
|
-
}
|
1224
|
-
static VALUE rb_sigar_NetRoute_refcnt(VALUE self)
|
1225
|
-
{
|
1226
|
-
sigar_net_route_t *net_route;
|
1227
|
-
Data_Get_Struct(self, sigar_net_route_t, net_route);
|
1228
|
-
return rb_ll2inum(net_route->refcnt);
|
1229
|
-
}
|
1230
|
-
static VALUE rb_sigar_NetRoute_use(VALUE self)
|
1231
|
-
{
|
1232
|
-
sigar_net_route_t *net_route;
|
1233
|
-
Data_Get_Struct(self, sigar_net_route_t, net_route);
|
1234
|
-
return rb_ll2inum(net_route->use);
|
1235
|
-
}
|
1236
|
-
static VALUE rb_sigar_NetRoute_metric(VALUE self)
|
1237
|
-
{
|
1238
|
-
sigar_net_route_t *net_route;
|
1239
|
-
Data_Get_Struct(self, sigar_net_route_t, net_route);
|
1240
|
-
return rb_ll2inum(net_route->metric);
|
1241
|
-
}
|
1242
|
-
static VALUE rb_sigar_NetRoute_mask(VALUE self)
|
1243
|
-
{
|
1244
|
-
sigar_net_route_t *net_route;
|
1245
|
-
Data_Get_Struct(self, sigar_net_route_t, net_route);
|
1246
|
-
return rb_sigar_net_address_to_s(net_route->mask);
|
1247
|
-
}
|
1248
|
-
static VALUE rb_sigar_NetRoute_mtu(VALUE self)
|
1249
|
-
{
|
1250
|
-
sigar_net_route_t *net_route;
|
1251
|
-
Data_Get_Struct(self, sigar_net_route_t, net_route);
|
1252
|
-
return rb_ll2inum(net_route->mtu);
|
1253
|
-
}
|
1254
|
-
static VALUE rb_sigar_NetRoute_window(VALUE self)
|
1255
|
-
{
|
1256
|
-
sigar_net_route_t *net_route;
|
1257
|
-
Data_Get_Struct(self, sigar_net_route_t, net_route);
|
1258
|
-
return rb_ll2inum(net_route->window);
|
1259
|
-
}
|
1260
|
-
static VALUE rb_sigar_NetRoute_irtt(VALUE self)
|
1261
|
-
{
|
1262
|
-
sigar_net_route_t *net_route;
|
1263
|
-
Data_Get_Struct(self, sigar_net_route_t, net_route);
|
1264
|
-
return rb_ll2inum(net_route->irtt);
|
1265
|
-
}
|
1266
|
-
static VALUE rb_sigar_NetRoute_ifname(VALUE self)
|
1267
|
-
{
|
1268
|
-
sigar_net_route_t *net_route;
|
1269
|
-
Data_Get_Struct(self, sigar_net_route_t, net_route);
|
1270
|
-
return rb_str_new2(net_route->ifname);
|
1271
|
-
}
|
1272
|
-
static VALUE rb_cSigarProcStat;
|
1273
|
-
|
1274
|
-
static VALUE rb_sigar_proc_stat(VALUE obj)
|
1275
|
-
{
|
1276
|
-
SIGAR_GET;
|
1277
|
-
|
1278
|
-
int status;
|
1279
|
-
sigar_proc_stat_t *RETVAL = malloc(sizeof(*RETVAL));
|
1280
|
-
|
1281
|
-
if ((status = sigar_proc_stat_get(sigar, RETVAL)) != SIGAR_OK) {
|
1282
|
-
free(RETVAL);
|
1283
|
-
rb_raise(rb_eArgError, "%s", sigar_strerror(sigar, status));
|
1284
|
-
return Qnil;
|
1285
|
-
}
|
1286
|
-
|
1287
|
-
return Data_Wrap_Struct(rb_cSigarProcStat, 0, rb_sigar_free, RETVAL);
|
1288
|
-
}
|
1289
|
-
static VALUE rb_sigar_ProcStat_total(VALUE self)
|
1290
|
-
{
|
1291
|
-
sigar_proc_stat_t *proc_stat;
|
1292
|
-
Data_Get_Struct(self, sigar_proc_stat_t, proc_stat);
|
1293
|
-
return rb_ll2inum(proc_stat->total);
|
1294
|
-
}
|
1295
|
-
static VALUE rb_sigar_ProcStat_idle(VALUE self)
|
1296
|
-
{
|
1297
|
-
sigar_proc_stat_t *proc_stat;
|
1298
|
-
Data_Get_Struct(self, sigar_proc_stat_t, proc_stat);
|
1299
|
-
return rb_ll2inum(proc_stat->idle);
|
1300
|
-
}
|
1301
|
-
static VALUE rb_sigar_ProcStat_running(VALUE self)
|
1302
|
-
{
|
1303
|
-
sigar_proc_stat_t *proc_stat;
|
1304
|
-
Data_Get_Struct(self, sigar_proc_stat_t, proc_stat);
|
1305
|
-
return rb_ll2inum(proc_stat->running);
|
1306
|
-
}
|
1307
|
-
static VALUE rb_sigar_ProcStat_sleeping(VALUE self)
|
1308
|
-
{
|
1309
|
-
sigar_proc_stat_t *proc_stat;
|
1310
|
-
Data_Get_Struct(self, sigar_proc_stat_t, proc_stat);
|
1311
|
-
return rb_ll2inum(proc_stat->sleeping);
|
1312
|
-
}
|
1313
|
-
static VALUE rb_sigar_ProcStat_stopped(VALUE self)
|
1314
|
-
{
|
1315
|
-
sigar_proc_stat_t *proc_stat;
|
1316
|
-
Data_Get_Struct(self, sigar_proc_stat_t, proc_stat);
|
1317
|
-
return rb_ll2inum(proc_stat->stopped);
|
1318
|
-
}
|
1319
|
-
static VALUE rb_sigar_ProcStat_zombie(VALUE self)
|
1320
|
-
{
|
1321
|
-
sigar_proc_stat_t *proc_stat;
|
1322
|
-
Data_Get_Struct(self, sigar_proc_stat_t, proc_stat);
|
1323
|
-
return rb_ll2inum(proc_stat->zombie);
|
1324
|
-
}
|
1325
|
-
static VALUE rb_sigar_ProcStat_threads(VALUE self)
|
1326
|
-
{
|
1327
|
-
sigar_proc_stat_t *proc_stat;
|
1328
|
-
Data_Get_Struct(self, sigar_proc_stat_t, proc_stat);
|
1329
|
-
return rb_ll2inum(proc_stat->threads);
|
1330
|
-
}
|
1331
|
-
static VALUE rb_cSigarNetInterfaceConfig;
|
1332
|
-
|
1333
|
-
static VALUE rb_sigar_net_interface_config(VALUE obj, VALUE name)
|
1334
|
-
{
|
1335
|
-
SIGAR_GET;
|
1336
|
-
|
1337
|
-
int status;
|
1338
|
-
sigar_net_interface_config_t *RETVAL = malloc(sizeof(*RETVAL));
|
1339
|
-
|
1340
|
-
if ((status = sigar_net_interface_config_get(sigar, StringValuePtr(name), RETVAL)) != SIGAR_OK) {
|
1341
|
-
free(RETVAL);
|
1342
|
-
rb_raise(rb_eArgError, "%s", sigar_strerror(sigar, status));
|
1343
|
-
return Qnil;
|
1344
|
-
}
|
1345
|
-
|
1346
|
-
return Data_Wrap_Struct(rb_cSigarNetInterfaceConfig, 0, rb_sigar_free, RETVAL);
|
1347
|
-
}
|
1348
|
-
static VALUE rb_sigar_NetInterfaceConfig_name(VALUE self)
|
1349
|
-
{
|
1350
|
-
sigar_net_interface_config_t *net_interface_config;
|
1351
|
-
Data_Get_Struct(self, sigar_net_interface_config_t, net_interface_config);
|
1352
|
-
return rb_str_new2(net_interface_config->name);
|
1353
|
-
}
|
1354
|
-
static VALUE rb_sigar_NetInterfaceConfig_hwaddr(VALUE self)
|
1355
|
-
{
|
1356
|
-
sigar_net_interface_config_t *net_interface_config;
|
1357
|
-
Data_Get_Struct(self, sigar_net_interface_config_t, net_interface_config);
|
1358
|
-
return rb_sigar_net_address_to_s(net_interface_config->hwaddr);
|
1359
|
-
}
|
1360
|
-
static VALUE rb_sigar_NetInterfaceConfig_type(VALUE self)
|
1361
|
-
{
|
1362
|
-
sigar_net_interface_config_t *net_interface_config;
|
1363
|
-
Data_Get_Struct(self, sigar_net_interface_config_t, net_interface_config);
|
1364
|
-
return rb_str_new2(net_interface_config->type);
|
1365
|
-
}
|
1366
|
-
static VALUE rb_sigar_NetInterfaceConfig_description(VALUE self)
|
1367
|
-
{
|
1368
|
-
sigar_net_interface_config_t *net_interface_config;
|
1369
|
-
Data_Get_Struct(self, sigar_net_interface_config_t, net_interface_config);
|
1370
|
-
return rb_str_new2(net_interface_config->description);
|
1371
|
-
}
|
1372
|
-
static VALUE rb_sigar_NetInterfaceConfig_address(VALUE self)
|
1373
|
-
{
|
1374
|
-
sigar_net_interface_config_t *net_interface_config;
|
1375
|
-
Data_Get_Struct(self, sigar_net_interface_config_t, net_interface_config);
|
1376
|
-
return rb_sigar_net_address_to_s(net_interface_config->address);
|
1377
|
-
}
|
1378
|
-
static VALUE rb_sigar_NetInterfaceConfig_address6(VALUE self)
|
1379
|
-
{
|
1380
|
-
sigar_net_interface_config_t *net_interface_config;
|
1381
|
-
Data_Get_Struct(self, sigar_net_interface_config_t, net_interface_config);
|
1382
|
-
return rb_sigar_net_address_to_s(net_interface_config->address6);
|
1383
|
-
}
|
1384
|
-
static VALUE rb_sigar_NetInterfaceConfig_prefix6_length(VALUE self)
|
1385
|
-
{
|
1386
|
-
sigar_net_interface_config_t *net_interface_config;
|
1387
|
-
Data_Get_Struct(self, sigar_net_interface_config_t, net_interface_config);
|
1388
|
-
return rb_int2inum(net_interface_config->prefix6_length);
|
1389
|
-
}
|
1390
|
-
static VALUE rb_sigar_NetInterfaceConfig_scope6(VALUE self)
|
1391
|
-
{
|
1392
|
-
sigar_net_interface_config_t *net_interface_config;
|
1393
|
-
Data_Get_Struct(self, sigar_net_interface_config_t, net_interface_config);
|
1394
|
-
return rb_int2inum(net_interface_config->scope6);
|
1395
|
-
}
|
1396
|
-
static VALUE rb_sigar_NetInterfaceConfig_destination(VALUE self)
|
1397
|
-
{
|
1398
|
-
sigar_net_interface_config_t *net_interface_config;
|
1399
|
-
Data_Get_Struct(self, sigar_net_interface_config_t, net_interface_config);
|
1400
|
-
return rb_sigar_net_address_to_s(net_interface_config->destination);
|
1401
|
-
}
|
1402
|
-
static VALUE rb_sigar_NetInterfaceConfig_broadcast(VALUE self)
|
1403
|
-
{
|
1404
|
-
sigar_net_interface_config_t *net_interface_config;
|
1405
|
-
Data_Get_Struct(self, sigar_net_interface_config_t, net_interface_config);
|
1406
|
-
return rb_sigar_net_address_to_s(net_interface_config->broadcast);
|
1407
|
-
}
|
1408
|
-
static VALUE rb_sigar_NetInterfaceConfig_netmask(VALUE self)
|
1409
|
-
{
|
1410
|
-
sigar_net_interface_config_t *net_interface_config;
|
1411
|
-
Data_Get_Struct(self, sigar_net_interface_config_t, net_interface_config);
|
1412
|
-
return rb_sigar_net_address_to_s(net_interface_config->netmask);
|
1413
|
-
}
|
1414
|
-
static VALUE rb_sigar_NetInterfaceConfig_flags(VALUE self)
|
1415
|
-
{
|
1416
|
-
sigar_net_interface_config_t *net_interface_config;
|
1417
|
-
Data_Get_Struct(self, sigar_net_interface_config_t, net_interface_config);
|
1418
|
-
return rb_ll2inum(net_interface_config->flags);
|
1419
|
-
}
|
1420
|
-
static VALUE rb_sigar_NetInterfaceConfig_mtu(VALUE self)
|
1421
|
-
{
|
1422
|
-
sigar_net_interface_config_t *net_interface_config;
|
1423
|
-
Data_Get_Struct(self, sigar_net_interface_config_t, net_interface_config);
|
1424
|
-
return rb_ll2inum(net_interface_config->mtu);
|
1425
|
-
}
|
1426
|
-
static VALUE rb_sigar_NetInterfaceConfig_metric(VALUE self)
|
1427
|
-
{
|
1428
|
-
sigar_net_interface_config_t *net_interface_config;
|
1429
|
-
Data_Get_Struct(self, sigar_net_interface_config_t, net_interface_config);
|
1430
|
-
return rb_ll2inum(net_interface_config->metric);
|
1431
|
-
}
|
1432
|
-
static VALUE rb_sigar_NetInterfaceConfig_tx_queue_len(VALUE self)
|
1433
|
-
{
|
1434
|
-
sigar_net_interface_config_t *net_interface_config;
|
1435
|
-
Data_Get_Struct(self, sigar_net_interface_config_t, net_interface_config);
|
1436
|
-
return rb_int2inum(net_interface_config->tx_queue_len);
|
1437
|
-
}
|
1438
|
-
static VALUE rb_cSigarNetInfo;
|
1439
|
-
|
1440
|
-
static VALUE rb_sigar_net_info(VALUE obj)
|
1441
|
-
{
|
1442
|
-
SIGAR_GET;
|
1443
|
-
|
1444
|
-
int status;
|
1445
|
-
sigar_net_info_t *RETVAL = malloc(sizeof(*RETVAL));
|
1446
|
-
|
1447
|
-
if ((status = sigar_net_info_get(sigar, RETVAL)) != SIGAR_OK) {
|
1448
|
-
free(RETVAL);
|
1449
|
-
rb_raise(rb_eArgError, "%s", sigar_strerror(sigar, status));
|
1450
|
-
return Qnil;
|
1451
|
-
}
|
1452
|
-
|
1453
|
-
return Data_Wrap_Struct(rb_cSigarNetInfo, 0, rb_sigar_free, RETVAL);
|
1454
|
-
}
|
1455
|
-
static VALUE rb_sigar_NetInfo_default_gateway(VALUE self)
|
1456
|
-
{
|
1457
|
-
sigar_net_info_t *net_info;
|
1458
|
-
Data_Get_Struct(self, sigar_net_info_t, net_info);
|
1459
|
-
return rb_str_new2(net_info->default_gateway);
|
1460
|
-
}
|
1461
|
-
static VALUE rb_sigar_NetInfo_default_gateway_interface(VALUE self)
|
1462
|
-
{
|
1463
|
-
sigar_net_info_t *net_info;
|
1464
|
-
Data_Get_Struct(self, sigar_net_info_t, net_info);
|
1465
|
-
return rb_str_new2(net_info->default_gateway_interface);
|
1466
|
-
}
|
1467
|
-
static VALUE rb_sigar_NetInfo_host_name(VALUE self)
|
1468
|
-
{
|
1469
|
-
sigar_net_info_t *net_info;
|
1470
|
-
Data_Get_Struct(self, sigar_net_info_t, net_info);
|
1471
|
-
return rb_str_new2(net_info->host_name);
|
1472
|
-
}
|
1473
|
-
static VALUE rb_sigar_NetInfo_domain_name(VALUE self)
|
1474
|
-
{
|
1475
|
-
sigar_net_info_t *net_info;
|
1476
|
-
Data_Get_Struct(self, sigar_net_info_t, net_info);
|
1477
|
-
return rb_str_new2(net_info->domain_name);
|
1478
|
-
}
|
1479
|
-
static VALUE rb_sigar_NetInfo_primary_dns(VALUE self)
|
1480
|
-
{
|
1481
|
-
sigar_net_info_t *net_info;
|
1482
|
-
Data_Get_Struct(self, sigar_net_info_t, net_info);
|
1483
|
-
return rb_str_new2(net_info->primary_dns);
|
1484
|
-
}
|
1485
|
-
static VALUE rb_sigar_NetInfo_secondary_dns(VALUE self)
|
1486
|
-
{
|
1487
|
-
sigar_net_info_t *net_info;
|
1488
|
-
Data_Get_Struct(self, sigar_net_info_t, net_info);
|
1489
|
-
return rb_str_new2(net_info->secondary_dns);
|
1490
|
-
}
|
1491
|
-
static VALUE rb_cSigarSysInfo;
|
1492
|
-
|
1493
|
-
static VALUE rb_sigar_sys_info(VALUE obj)
|
1494
|
-
{
|
1495
|
-
SIGAR_GET;
|
1496
|
-
|
1497
|
-
int status;
|
1498
|
-
sigar_sys_info_t *RETVAL = malloc(sizeof(*RETVAL));
|
1499
|
-
|
1500
|
-
if ((status = sigar_sys_info_get(sigar, RETVAL)) != SIGAR_OK) {
|
1501
|
-
free(RETVAL);
|
1502
|
-
rb_raise(rb_eArgError, "%s", sigar_strerror(sigar, status));
|
1503
|
-
return Qnil;
|
1504
|
-
}
|
1505
|
-
|
1506
|
-
return Data_Wrap_Struct(rb_cSigarSysInfo, 0, rb_sigar_free, RETVAL);
|
1507
|
-
}
|
1508
|
-
static VALUE rb_sigar_SysInfo_name(VALUE self)
|
1509
|
-
{
|
1510
|
-
sigar_sys_info_t *sys_info;
|
1511
|
-
Data_Get_Struct(self, sigar_sys_info_t, sys_info);
|
1512
|
-
return rb_str_new2(sys_info->name);
|
1513
|
-
}
|
1514
|
-
static VALUE rb_sigar_SysInfo_version(VALUE self)
|
1515
|
-
{
|
1516
|
-
sigar_sys_info_t *sys_info;
|
1517
|
-
Data_Get_Struct(self, sigar_sys_info_t, sys_info);
|
1518
|
-
return rb_str_new2(sys_info->version);
|
1519
|
-
}
|
1520
|
-
static VALUE rb_sigar_SysInfo_arch(VALUE self)
|
1521
|
-
{
|
1522
|
-
sigar_sys_info_t *sys_info;
|
1523
|
-
Data_Get_Struct(self, sigar_sys_info_t, sys_info);
|
1524
|
-
return rb_str_new2(sys_info->arch);
|
1525
|
-
}
|
1526
|
-
static VALUE rb_sigar_SysInfo_machine(VALUE self)
|
1527
|
-
{
|
1528
|
-
sigar_sys_info_t *sys_info;
|
1529
|
-
Data_Get_Struct(self, sigar_sys_info_t, sys_info);
|
1530
|
-
return rb_str_new2(sys_info->machine);
|
1531
|
-
}
|
1532
|
-
static VALUE rb_sigar_SysInfo_description(VALUE self)
|
1533
|
-
{
|
1534
|
-
sigar_sys_info_t *sys_info;
|
1535
|
-
Data_Get_Struct(self, sigar_sys_info_t, sys_info);
|
1536
|
-
return rb_str_new2(sys_info->description);
|
1537
|
-
}
|
1538
|
-
static VALUE rb_sigar_SysInfo_patch_level(VALUE self)
|
1539
|
-
{
|
1540
|
-
sigar_sys_info_t *sys_info;
|
1541
|
-
Data_Get_Struct(self, sigar_sys_info_t, sys_info);
|
1542
|
-
return rb_str_new2(sys_info->patch_level);
|
1543
|
-
}
|
1544
|
-
static VALUE rb_sigar_SysInfo_vendor(VALUE self)
|
1545
|
-
{
|
1546
|
-
sigar_sys_info_t *sys_info;
|
1547
|
-
Data_Get_Struct(self, sigar_sys_info_t, sys_info);
|
1548
|
-
return rb_str_new2(sys_info->vendor);
|
1549
|
-
}
|
1550
|
-
static VALUE rb_sigar_SysInfo_vendor_version(VALUE self)
|
1551
|
-
{
|
1552
|
-
sigar_sys_info_t *sys_info;
|
1553
|
-
Data_Get_Struct(self, sigar_sys_info_t, sys_info);
|
1554
|
-
return rb_str_new2(sys_info->vendor_version);
|
1555
|
-
}
|
1556
|
-
static VALUE rb_sigar_SysInfo_vendor_name(VALUE self)
|
1557
|
-
{
|
1558
|
-
sigar_sys_info_t *sys_info;
|
1559
|
-
Data_Get_Struct(self, sigar_sys_info_t, sys_info);
|
1560
|
-
return rb_str_new2(sys_info->vendor_name);
|
1561
|
-
}
|
1562
|
-
static VALUE rb_sigar_SysInfo_vendor_code_name(VALUE self)
|
1563
|
-
{
|
1564
|
-
sigar_sys_info_t *sys_info;
|
1565
|
-
Data_Get_Struct(self, sigar_sys_info_t, sys_info);
|
1566
|
-
return rb_str_new2(sys_info->vendor_code_name);
|
1567
|
-
}
|
1568
|
-
static VALUE rb_cSigarMem;
|
1569
|
-
|
1570
|
-
static VALUE rb_sigar_mem(VALUE obj)
|
1571
|
-
{
|
1572
|
-
SIGAR_GET;
|
1573
|
-
|
1574
|
-
int status;
|
1575
|
-
sigar_mem_t *RETVAL = malloc(sizeof(*RETVAL));
|
1576
|
-
|
1577
|
-
if ((status = sigar_mem_get(sigar, RETVAL)) != SIGAR_OK) {
|
1578
|
-
free(RETVAL);
|
1579
|
-
rb_raise(rb_eArgError, "%s", sigar_strerror(sigar, status));
|
1580
|
-
return Qnil;
|
1581
|
-
}
|
1582
|
-
|
1583
|
-
return Data_Wrap_Struct(rb_cSigarMem, 0, rb_sigar_free, RETVAL);
|
1584
|
-
}
|
1585
|
-
static VALUE rb_sigar_Mem_total(VALUE self)
|
1586
|
-
{
|
1587
|
-
sigar_mem_t *mem;
|
1588
|
-
Data_Get_Struct(self, sigar_mem_t, mem);
|
1589
|
-
return rb_ll2inum(mem->total);
|
1590
|
-
}
|
1591
|
-
static VALUE rb_sigar_Mem_ram(VALUE self)
|
1592
|
-
{
|
1593
|
-
sigar_mem_t *mem;
|
1594
|
-
Data_Get_Struct(self, sigar_mem_t, mem);
|
1595
|
-
return rb_ll2inum(mem->ram);
|
1596
|
-
}
|
1597
|
-
static VALUE rb_sigar_Mem_used(VALUE self)
|
1598
|
-
{
|
1599
|
-
sigar_mem_t *mem;
|
1600
|
-
Data_Get_Struct(self, sigar_mem_t, mem);
|
1601
|
-
return rb_ll2inum(mem->used);
|
1602
|
-
}
|
1603
|
-
static VALUE rb_sigar_Mem_free(VALUE self)
|
1604
|
-
{
|
1605
|
-
sigar_mem_t *mem;
|
1606
|
-
Data_Get_Struct(self, sigar_mem_t, mem);
|
1607
|
-
return rb_ll2inum(mem->free);
|
1608
|
-
}
|
1609
|
-
static VALUE rb_sigar_Mem_actual_used(VALUE self)
|
1610
|
-
{
|
1611
|
-
sigar_mem_t *mem;
|
1612
|
-
Data_Get_Struct(self, sigar_mem_t, mem);
|
1613
|
-
return rb_ll2inum(mem->actual_used);
|
1614
|
-
}
|
1615
|
-
static VALUE rb_sigar_Mem_actual_free(VALUE self)
|
1616
|
-
{
|
1617
|
-
sigar_mem_t *mem;
|
1618
|
-
Data_Get_Struct(self, sigar_mem_t, mem);
|
1619
|
-
return rb_ll2inum(mem->actual_free);
|
1620
|
-
}
|
1621
|
-
static VALUE rb_sigar_Mem_used_percent(VALUE self)
|
1622
|
-
{
|
1623
|
-
sigar_mem_t *mem;
|
1624
|
-
Data_Get_Struct(self, sigar_mem_t, mem);
|
1625
|
-
return rb_float_new(mem->used_percent);
|
1626
|
-
}
|
1627
|
-
static VALUE rb_sigar_Mem_free_percent(VALUE self)
|
1628
|
-
{
|
1629
|
-
sigar_mem_t *mem;
|
1630
|
-
Data_Get_Struct(self, sigar_mem_t, mem);
|
1631
|
-
return rb_float_new(mem->free_percent);
|
1632
|
-
}
|
1633
|
-
static VALUE rb_cSigarNfsClientV3;
|
1634
|
-
|
1635
|
-
static VALUE rb_sigar_nfs_client_v3(VALUE obj)
|
1636
|
-
{
|
1637
|
-
SIGAR_GET;
|
1638
|
-
|
1639
|
-
int status;
|
1640
|
-
sigar_nfs_client_v3_t *RETVAL = malloc(sizeof(*RETVAL));
|
1641
|
-
|
1642
|
-
if ((status = sigar_nfs_client_v3_get(sigar, RETVAL)) != SIGAR_OK) {
|
1643
|
-
free(RETVAL);
|
1644
|
-
rb_raise(rb_eArgError, "%s", sigar_strerror(sigar, status));
|
1645
|
-
return Qnil;
|
1646
|
-
}
|
1647
|
-
|
1648
|
-
return Data_Wrap_Struct(rb_cSigarNfsClientV3, 0, rb_sigar_free, RETVAL);
|
1649
|
-
}
|
1650
|
-
static VALUE rb_sigar_NfsClientV3_null(VALUE self)
|
1651
|
-
{
|
1652
|
-
sigar_nfs_client_v3_t *nfs_client_v3;
|
1653
|
-
Data_Get_Struct(self, sigar_nfs_client_v3_t, nfs_client_v3);
|
1654
|
-
return rb_ll2inum(nfs_client_v3->null);
|
1655
|
-
}
|
1656
|
-
static VALUE rb_sigar_NfsClientV3_getattr(VALUE self)
|
1657
|
-
{
|
1658
|
-
sigar_nfs_client_v3_t *nfs_client_v3;
|
1659
|
-
Data_Get_Struct(self, sigar_nfs_client_v3_t, nfs_client_v3);
|
1660
|
-
return rb_ll2inum(nfs_client_v3->getattr);
|
1661
|
-
}
|
1662
|
-
static VALUE rb_sigar_NfsClientV3_setattr(VALUE self)
|
1663
|
-
{
|
1664
|
-
sigar_nfs_client_v3_t *nfs_client_v3;
|
1665
|
-
Data_Get_Struct(self, sigar_nfs_client_v3_t, nfs_client_v3);
|
1666
|
-
return rb_ll2inum(nfs_client_v3->setattr);
|
1667
|
-
}
|
1668
|
-
static VALUE rb_sigar_NfsClientV3_lookup(VALUE self)
|
1669
|
-
{
|
1670
|
-
sigar_nfs_client_v3_t *nfs_client_v3;
|
1671
|
-
Data_Get_Struct(self, sigar_nfs_client_v3_t, nfs_client_v3);
|
1672
|
-
return rb_ll2inum(nfs_client_v3->lookup);
|
1673
|
-
}
|
1674
|
-
static VALUE rb_sigar_NfsClientV3_access(VALUE self)
|
1675
|
-
{
|
1676
|
-
sigar_nfs_client_v3_t *nfs_client_v3;
|
1677
|
-
Data_Get_Struct(self, sigar_nfs_client_v3_t, nfs_client_v3);
|
1678
|
-
return rb_ll2inum(nfs_client_v3->access);
|
1679
|
-
}
|
1680
|
-
static VALUE rb_sigar_NfsClientV3_readlink(VALUE self)
|
1681
|
-
{
|
1682
|
-
sigar_nfs_client_v3_t *nfs_client_v3;
|
1683
|
-
Data_Get_Struct(self, sigar_nfs_client_v3_t, nfs_client_v3);
|
1684
|
-
return rb_ll2inum(nfs_client_v3->readlink);
|
1685
|
-
}
|
1686
|
-
static VALUE rb_sigar_NfsClientV3_read(VALUE self)
|
1687
|
-
{
|
1688
|
-
sigar_nfs_client_v3_t *nfs_client_v3;
|
1689
|
-
Data_Get_Struct(self, sigar_nfs_client_v3_t, nfs_client_v3);
|
1690
|
-
return rb_ll2inum(nfs_client_v3->read);
|
1691
|
-
}
|
1692
|
-
static VALUE rb_sigar_NfsClientV3_write(VALUE self)
|
1693
|
-
{
|
1694
|
-
sigar_nfs_client_v3_t *nfs_client_v3;
|
1695
|
-
Data_Get_Struct(self, sigar_nfs_client_v3_t, nfs_client_v3);
|
1696
|
-
return rb_ll2inum(nfs_client_v3->write);
|
1697
|
-
}
|
1698
|
-
static VALUE rb_sigar_NfsClientV3_create(VALUE self)
|
1699
|
-
{
|
1700
|
-
sigar_nfs_client_v3_t *nfs_client_v3;
|
1701
|
-
Data_Get_Struct(self, sigar_nfs_client_v3_t, nfs_client_v3);
|
1702
|
-
return rb_ll2inum(nfs_client_v3->create);
|
1703
|
-
}
|
1704
|
-
static VALUE rb_sigar_NfsClientV3_mkdir(VALUE self)
|
1705
|
-
{
|
1706
|
-
sigar_nfs_client_v3_t *nfs_client_v3;
|
1707
|
-
Data_Get_Struct(self, sigar_nfs_client_v3_t, nfs_client_v3);
|
1708
|
-
return rb_ll2inum(nfs_client_v3->mkdir);
|
1709
|
-
}
|
1710
|
-
static VALUE rb_sigar_NfsClientV3_symlink(VALUE self)
|
1711
|
-
{
|
1712
|
-
sigar_nfs_client_v3_t *nfs_client_v3;
|
1713
|
-
Data_Get_Struct(self, sigar_nfs_client_v3_t, nfs_client_v3);
|
1714
|
-
return rb_ll2inum(nfs_client_v3->symlink);
|
1715
|
-
}
|
1716
|
-
static VALUE rb_sigar_NfsClientV3_mknod(VALUE self)
|
1717
|
-
{
|
1718
|
-
sigar_nfs_client_v3_t *nfs_client_v3;
|
1719
|
-
Data_Get_Struct(self, sigar_nfs_client_v3_t, nfs_client_v3);
|
1720
|
-
return rb_ll2inum(nfs_client_v3->mknod);
|
1721
|
-
}
|
1722
|
-
static VALUE rb_sigar_NfsClientV3_remove(VALUE self)
|
1723
|
-
{
|
1724
|
-
sigar_nfs_client_v3_t *nfs_client_v3;
|
1725
|
-
Data_Get_Struct(self, sigar_nfs_client_v3_t, nfs_client_v3);
|
1726
|
-
return rb_ll2inum(nfs_client_v3->remove);
|
1727
|
-
}
|
1728
|
-
static VALUE rb_sigar_NfsClientV3_rmdir(VALUE self)
|
1729
|
-
{
|
1730
|
-
sigar_nfs_client_v3_t *nfs_client_v3;
|
1731
|
-
Data_Get_Struct(self, sigar_nfs_client_v3_t, nfs_client_v3);
|
1732
|
-
return rb_ll2inum(nfs_client_v3->rmdir);
|
1733
|
-
}
|
1734
|
-
static VALUE rb_sigar_NfsClientV3_rename(VALUE self)
|
1735
|
-
{
|
1736
|
-
sigar_nfs_client_v3_t *nfs_client_v3;
|
1737
|
-
Data_Get_Struct(self, sigar_nfs_client_v3_t, nfs_client_v3);
|
1738
|
-
return rb_ll2inum(nfs_client_v3->rename);
|
1739
|
-
}
|
1740
|
-
static VALUE rb_sigar_NfsClientV3_link(VALUE self)
|
1741
|
-
{
|
1742
|
-
sigar_nfs_client_v3_t *nfs_client_v3;
|
1743
|
-
Data_Get_Struct(self, sigar_nfs_client_v3_t, nfs_client_v3);
|
1744
|
-
return rb_ll2inum(nfs_client_v3->link);
|
1745
|
-
}
|
1746
|
-
static VALUE rb_sigar_NfsClientV3_readdir(VALUE self)
|
1747
|
-
{
|
1748
|
-
sigar_nfs_client_v3_t *nfs_client_v3;
|
1749
|
-
Data_Get_Struct(self, sigar_nfs_client_v3_t, nfs_client_v3);
|
1750
|
-
return rb_ll2inum(nfs_client_v3->readdir);
|
1751
|
-
}
|
1752
|
-
static VALUE rb_sigar_NfsClientV3_readdirplus(VALUE self)
|
1753
|
-
{
|
1754
|
-
sigar_nfs_client_v3_t *nfs_client_v3;
|
1755
|
-
Data_Get_Struct(self, sigar_nfs_client_v3_t, nfs_client_v3);
|
1756
|
-
return rb_ll2inum(nfs_client_v3->readdirplus);
|
1757
|
-
}
|
1758
|
-
static VALUE rb_sigar_NfsClientV3_fsstat(VALUE self)
|
1759
|
-
{
|
1760
|
-
sigar_nfs_client_v3_t *nfs_client_v3;
|
1761
|
-
Data_Get_Struct(self, sigar_nfs_client_v3_t, nfs_client_v3);
|
1762
|
-
return rb_ll2inum(nfs_client_v3->fsstat);
|
1763
|
-
}
|
1764
|
-
static VALUE rb_sigar_NfsClientV3_fsinfo(VALUE self)
|
1765
|
-
{
|
1766
|
-
sigar_nfs_client_v3_t *nfs_client_v3;
|
1767
|
-
Data_Get_Struct(self, sigar_nfs_client_v3_t, nfs_client_v3);
|
1768
|
-
return rb_ll2inum(nfs_client_v3->fsinfo);
|
1769
|
-
}
|
1770
|
-
static VALUE rb_sigar_NfsClientV3_pathconf(VALUE self)
|
1771
|
-
{
|
1772
|
-
sigar_nfs_client_v3_t *nfs_client_v3;
|
1773
|
-
Data_Get_Struct(self, sigar_nfs_client_v3_t, nfs_client_v3);
|
1774
|
-
return rb_ll2inum(nfs_client_v3->pathconf);
|
1775
|
-
}
|
1776
|
-
static VALUE rb_sigar_NfsClientV3_commit(VALUE self)
|
1777
|
-
{
|
1778
|
-
sigar_nfs_client_v3_t *nfs_client_v3;
|
1779
|
-
Data_Get_Struct(self, sigar_nfs_client_v3_t, nfs_client_v3);
|
1780
|
-
return rb_ll2inum(nfs_client_v3->commit);
|
1781
|
-
}
|
1782
|
-
static VALUE rb_cSigarDirUsage;
|
1783
|
-
|
1784
|
-
static VALUE rb_sigar_dir_usage(VALUE obj, VALUE name)
|
1785
|
-
{
|
1786
|
-
SIGAR_GET;
|
1787
|
-
|
1788
|
-
int status;
|
1789
|
-
sigar_dir_usage_t *RETVAL = malloc(sizeof(*RETVAL));
|
1790
|
-
|
1791
|
-
if ((status = sigar_dir_usage_get(sigar, StringValuePtr(name), RETVAL)) != SIGAR_OK) {
|
1792
|
-
free(RETVAL);
|
1793
|
-
rb_raise(rb_eArgError, "%s", sigar_strerror(sigar, status));
|
1794
|
-
return Qnil;
|
1795
|
-
}
|
1796
|
-
|
1797
|
-
return Data_Wrap_Struct(rb_cSigarDirUsage, 0, rb_sigar_free, RETVAL);
|
1798
|
-
}
|
1799
|
-
static VALUE rb_sigar_DirUsage_total(VALUE self)
|
1800
|
-
{
|
1801
|
-
sigar_dir_usage_t *dir_usage;
|
1802
|
-
Data_Get_Struct(self, sigar_dir_usage_t, dir_usage);
|
1803
|
-
return rb_ll2inum(dir_usage->total);
|
1804
|
-
}
|
1805
|
-
static VALUE rb_sigar_DirUsage_files(VALUE self)
|
1806
|
-
{
|
1807
|
-
sigar_dir_usage_t *dir_usage;
|
1808
|
-
Data_Get_Struct(self, sigar_dir_usage_t, dir_usage);
|
1809
|
-
return rb_ll2inum(dir_usage->files);
|
1810
|
-
}
|
1811
|
-
static VALUE rb_sigar_DirUsage_subdirs(VALUE self)
|
1812
|
-
{
|
1813
|
-
sigar_dir_usage_t *dir_usage;
|
1814
|
-
Data_Get_Struct(self, sigar_dir_usage_t, dir_usage);
|
1815
|
-
return rb_ll2inum(dir_usage->subdirs);
|
1816
|
-
}
|
1817
|
-
static VALUE rb_sigar_DirUsage_symlinks(VALUE self)
|
1818
|
-
{
|
1819
|
-
sigar_dir_usage_t *dir_usage;
|
1820
|
-
Data_Get_Struct(self, sigar_dir_usage_t, dir_usage);
|
1821
|
-
return rb_ll2inum(dir_usage->symlinks);
|
1822
|
-
}
|
1823
|
-
static VALUE rb_sigar_DirUsage_chrdevs(VALUE self)
|
1824
|
-
{
|
1825
|
-
sigar_dir_usage_t *dir_usage;
|
1826
|
-
Data_Get_Struct(self, sigar_dir_usage_t, dir_usage);
|
1827
|
-
return rb_ll2inum(dir_usage->chrdevs);
|
1828
|
-
}
|
1829
|
-
static VALUE rb_sigar_DirUsage_blkdevs(VALUE self)
|
1830
|
-
{
|
1831
|
-
sigar_dir_usage_t *dir_usage;
|
1832
|
-
Data_Get_Struct(self, sigar_dir_usage_t, dir_usage);
|
1833
|
-
return rb_ll2inum(dir_usage->blkdevs);
|
1834
|
-
}
|
1835
|
-
static VALUE rb_sigar_DirUsage_sockets(VALUE self)
|
1836
|
-
{
|
1837
|
-
sigar_dir_usage_t *dir_usage;
|
1838
|
-
Data_Get_Struct(self, sigar_dir_usage_t, dir_usage);
|
1839
|
-
return rb_ll2inum(dir_usage->sockets);
|
1840
|
-
}
|
1841
|
-
static VALUE rb_sigar_DirUsage_disk_usage(VALUE self)
|
1842
|
-
{
|
1843
|
-
sigar_dir_usage_t *dir_usage;
|
1844
|
-
Data_Get_Struct(self, sigar_dir_usage_t, dir_usage);
|
1845
|
-
return rb_ll2inum(dir_usage->disk_usage);
|
1846
|
-
}
|
1847
|
-
static VALUE rb_sigar_NetConnection_local_port(VALUE self)
|
1848
|
-
{
|
1849
|
-
sigar_net_connection_t *net_connection;
|
1850
|
-
Data_Get_Struct(self, sigar_net_connection_t, net_connection);
|
1851
|
-
return rb_ll2inum(net_connection->local_port);
|
1852
|
-
}
|
1853
|
-
static VALUE rb_sigar_NetConnection_local_address(VALUE self)
|
1854
|
-
{
|
1855
|
-
sigar_net_connection_t *net_connection;
|
1856
|
-
Data_Get_Struct(self, sigar_net_connection_t, net_connection);
|
1857
|
-
return rb_sigar_net_address_to_s(net_connection->local_address);
|
1858
|
-
}
|
1859
|
-
static VALUE rb_sigar_NetConnection_remote_port(VALUE self)
|
1860
|
-
{
|
1861
|
-
sigar_net_connection_t *net_connection;
|
1862
|
-
Data_Get_Struct(self, sigar_net_connection_t, net_connection);
|
1863
|
-
return rb_ll2inum(net_connection->remote_port);
|
1864
|
-
}
|
1865
|
-
static VALUE rb_sigar_NetConnection_remote_address(VALUE self)
|
1866
|
-
{
|
1867
|
-
sigar_net_connection_t *net_connection;
|
1868
|
-
Data_Get_Struct(self, sigar_net_connection_t, net_connection);
|
1869
|
-
return rb_sigar_net_address_to_s(net_connection->remote_address);
|
1870
|
-
}
|
1871
|
-
static VALUE rb_sigar_NetConnection_type(VALUE self)
|
1872
|
-
{
|
1873
|
-
sigar_net_connection_t *net_connection;
|
1874
|
-
Data_Get_Struct(self, sigar_net_connection_t, net_connection);
|
1875
|
-
return rb_int2inum(net_connection->type);
|
1876
|
-
}
|
1877
|
-
static VALUE rb_sigar_NetConnection_state(VALUE self)
|
1878
|
-
{
|
1879
|
-
sigar_net_connection_t *net_connection;
|
1880
|
-
Data_Get_Struct(self, sigar_net_connection_t, net_connection);
|
1881
|
-
return rb_int2inum(net_connection->state);
|
1882
|
-
}
|
1883
|
-
static VALUE rb_sigar_NetConnection_send_queue(VALUE self)
|
1884
|
-
{
|
1885
|
-
sigar_net_connection_t *net_connection;
|
1886
|
-
Data_Get_Struct(self, sigar_net_connection_t, net_connection);
|
1887
|
-
return rb_ll2inum(net_connection->send_queue);
|
1888
|
-
}
|
1889
|
-
static VALUE rb_sigar_NetConnection_receive_queue(VALUE self)
|
1890
|
-
{
|
1891
|
-
sigar_net_connection_t *net_connection;
|
1892
|
-
Data_Get_Struct(self, sigar_net_connection_t, net_connection);
|
1893
|
-
return rb_ll2inum(net_connection->receive_queue);
|
1894
|
-
}
|
1895
|
-
static VALUE rb_cSigarTcp;
|
1896
|
-
|
1897
|
-
static VALUE rb_sigar_tcp(VALUE obj)
|
1898
|
-
{
|
1899
|
-
SIGAR_GET;
|
1900
|
-
|
1901
|
-
int status;
|
1902
|
-
sigar_tcp_t *RETVAL = malloc(sizeof(*RETVAL));
|
1903
|
-
|
1904
|
-
if ((status = sigar_tcp_get(sigar, RETVAL)) != SIGAR_OK) {
|
1905
|
-
free(RETVAL);
|
1906
|
-
rb_raise(rb_eArgError, "%s", sigar_strerror(sigar, status));
|
1907
|
-
return Qnil;
|
1908
|
-
}
|
1909
|
-
|
1910
|
-
return Data_Wrap_Struct(rb_cSigarTcp, 0, rb_sigar_free, RETVAL);
|
1911
|
-
}
|
1912
|
-
static VALUE rb_sigar_Tcp_active_opens(VALUE self)
|
1913
|
-
{
|
1914
|
-
sigar_tcp_t *tcp;
|
1915
|
-
Data_Get_Struct(self, sigar_tcp_t, tcp);
|
1916
|
-
return rb_ll2inum(tcp->active_opens);
|
1917
|
-
}
|
1918
|
-
static VALUE rb_sigar_Tcp_passive_opens(VALUE self)
|
1919
|
-
{
|
1920
|
-
sigar_tcp_t *tcp;
|
1921
|
-
Data_Get_Struct(self, sigar_tcp_t, tcp);
|
1922
|
-
return rb_ll2inum(tcp->passive_opens);
|
1923
|
-
}
|
1924
|
-
static VALUE rb_sigar_Tcp_attempt_fails(VALUE self)
|
1925
|
-
{
|
1926
|
-
sigar_tcp_t *tcp;
|
1927
|
-
Data_Get_Struct(self, sigar_tcp_t, tcp);
|
1928
|
-
return rb_ll2inum(tcp->attempt_fails);
|
1929
|
-
}
|
1930
|
-
static VALUE rb_sigar_Tcp_estab_resets(VALUE self)
|
1931
|
-
{
|
1932
|
-
sigar_tcp_t *tcp;
|
1933
|
-
Data_Get_Struct(self, sigar_tcp_t, tcp);
|
1934
|
-
return rb_ll2inum(tcp->estab_resets);
|
1935
|
-
}
|
1936
|
-
static VALUE rb_sigar_Tcp_curr_estab(VALUE self)
|
1937
|
-
{
|
1938
|
-
sigar_tcp_t *tcp;
|
1939
|
-
Data_Get_Struct(self, sigar_tcp_t, tcp);
|
1940
|
-
return rb_ll2inum(tcp->curr_estab);
|
1941
|
-
}
|
1942
|
-
static VALUE rb_sigar_Tcp_in_segs(VALUE self)
|
1943
|
-
{
|
1944
|
-
sigar_tcp_t *tcp;
|
1945
|
-
Data_Get_Struct(self, sigar_tcp_t, tcp);
|
1946
|
-
return rb_ll2inum(tcp->in_segs);
|
1947
|
-
}
|
1948
|
-
static VALUE rb_sigar_Tcp_out_segs(VALUE self)
|
1949
|
-
{
|
1950
|
-
sigar_tcp_t *tcp;
|
1951
|
-
Data_Get_Struct(self, sigar_tcp_t, tcp);
|
1952
|
-
return rb_ll2inum(tcp->out_segs);
|
1953
|
-
}
|
1954
|
-
static VALUE rb_sigar_Tcp_retrans_segs(VALUE self)
|
1955
|
-
{
|
1956
|
-
sigar_tcp_t *tcp;
|
1957
|
-
Data_Get_Struct(self, sigar_tcp_t, tcp);
|
1958
|
-
return rb_ll2inum(tcp->retrans_segs);
|
1959
|
-
}
|
1960
|
-
static VALUE rb_sigar_Tcp_in_errs(VALUE self)
|
1961
|
-
{
|
1962
|
-
sigar_tcp_t *tcp;
|
1963
|
-
Data_Get_Struct(self, sigar_tcp_t, tcp);
|
1964
|
-
return rb_ll2inum(tcp->in_errs);
|
1965
|
-
}
|
1966
|
-
static VALUE rb_sigar_Tcp_out_rsts(VALUE self)
|
1967
|
-
{
|
1968
|
-
sigar_tcp_t *tcp;
|
1969
|
-
Data_Get_Struct(self, sigar_tcp_t, tcp);
|
1970
|
-
return rb_ll2inum(tcp->out_rsts);
|
1971
|
-
}
|
1972
|
-
static VALUE rb_cSigarNetInterfaceStat;
|
1973
|
-
|
1974
|
-
static VALUE rb_sigar_net_interface_stat(VALUE obj, VALUE name)
|
1975
|
-
{
|
1976
|
-
SIGAR_GET;
|
1977
|
-
|
1978
|
-
int status;
|
1979
|
-
sigar_net_interface_stat_t *RETVAL = malloc(sizeof(*RETVAL));
|
1980
|
-
|
1981
|
-
if ((status = sigar_net_interface_stat_get(sigar, StringValuePtr(name), RETVAL)) != SIGAR_OK) {
|
1982
|
-
free(RETVAL);
|
1983
|
-
rb_raise(rb_eArgError, "%s", sigar_strerror(sigar, status));
|
1984
|
-
return Qnil;
|
1985
|
-
}
|
1986
|
-
|
1987
|
-
return Data_Wrap_Struct(rb_cSigarNetInterfaceStat, 0, rb_sigar_free, RETVAL);
|
1988
|
-
}
|
1989
|
-
static VALUE rb_sigar_NetInterfaceStat_rx_bytes(VALUE self)
|
1990
|
-
{
|
1991
|
-
sigar_net_interface_stat_t *net_interface_stat;
|
1992
|
-
Data_Get_Struct(self, sigar_net_interface_stat_t, net_interface_stat);
|
1993
|
-
return rb_ll2inum(net_interface_stat->rx_bytes);
|
1994
|
-
}
|
1995
|
-
static VALUE rb_sigar_NetInterfaceStat_rx_packets(VALUE self)
|
1996
|
-
{
|
1997
|
-
sigar_net_interface_stat_t *net_interface_stat;
|
1998
|
-
Data_Get_Struct(self, sigar_net_interface_stat_t, net_interface_stat);
|
1999
|
-
return rb_ll2inum(net_interface_stat->rx_packets);
|
2000
|
-
}
|
2001
|
-
static VALUE rb_sigar_NetInterfaceStat_rx_errors(VALUE self)
|
2002
|
-
{
|
2003
|
-
sigar_net_interface_stat_t *net_interface_stat;
|
2004
|
-
Data_Get_Struct(self, sigar_net_interface_stat_t, net_interface_stat);
|
2005
|
-
return rb_ll2inum(net_interface_stat->rx_errors);
|
2006
|
-
}
|
2007
|
-
static VALUE rb_sigar_NetInterfaceStat_rx_dropped(VALUE self)
|
2008
|
-
{
|
2009
|
-
sigar_net_interface_stat_t *net_interface_stat;
|
2010
|
-
Data_Get_Struct(self, sigar_net_interface_stat_t, net_interface_stat);
|
2011
|
-
return rb_ll2inum(net_interface_stat->rx_dropped);
|
2012
|
-
}
|
2013
|
-
static VALUE rb_sigar_NetInterfaceStat_rx_overruns(VALUE self)
|
2014
|
-
{
|
2015
|
-
sigar_net_interface_stat_t *net_interface_stat;
|
2016
|
-
Data_Get_Struct(self, sigar_net_interface_stat_t, net_interface_stat);
|
2017
|
-
return rb_ll2inum(net_interface_stat->rx_overruns);
|
2018
|
-
}
|
2019
|
-
static VALUE rb_sigar_NetInterfaceStat_rx_frame(VALUE self)
|
2020
|
-
{
|
2021
|
-
sigar_net_interface_stat_t *net_interface_stat;
|
2022
|
-
Data_Get_Struct(self, sigar_net_interface_stat_t, net_interface_stat);
|
2023
|
-
return rb_ll2inum(net_interface_stat->rx_frame);
|
2024
|
-
}
|
2025
|
-
static VALUE rb_sigar_NetInterfaceStat_tx_bytes(VALUE self)
|
2026
|
-
{
|
2027
|
-
sigar_net_interface_stat_t *net_interface_stat;
|
2028
|
-
Data_Get_Struct(self, sigar_net_interface_stat_t, net_interface_stat);
|
2029
|
-
return rb_ll2inum(net_interface_stat->tx_bytes);
|
2030
|
-
}
|
2031
|
-
static VALUE rb_sigar_NetInterfaceStat_tx_packets(VALUE self)
|
2032
|
-
{
|
2033
|
-
sigar_net_interface_stat_t *net_interface_stat;
|
2034
|
-
Data_Get_Struct(self, sigar_net_interface_stat_t, net_interface_stat);
|
2035
|
-
return rb_ll2inum(net_interface_stat->tx_packets);
|
2036
|
-
}
|
2037
|
-
static VALUE rb_sigar_NetInterfaceStat_tx_errors(VALUE self)
|
2038
|
-
{
|
2039
|
-
sigar_net_interface_stat_t *net_interface_stat;
|
2040
|
-
Data_Get_Struct(self, sigar_net_interface_stat_t, net_interface_stat);
|
2041
|
-
return rb_ll2inum(net_interface_stat->tx_errors);
|
2042
|
-
}
|
2043
|
-
static VALUE rb_sigar_NetInterfaceStat_tx_dropped(VALUE self)
|
2044
|
-
{
|
2045
|
-
sigar_net_interface_stat_t *net_interface_stat;
|
2046
|
-
Data_Get_Struct(self, sigar_net_interface_stat_t, net_interface_stat);
|
2047
|
-
return rb_ll2inum(net_interface_stat->tx_dropped);
|
2048
|
-
}
|
2049
|
-
static VALUE rb_sigar_NetInterfaceStat_tx_overruns(VALUE self)
|
2050
|
-
{
|
2051
|
-
sigar_net_interface_stat_t *net_interface_stat;
|
2052
|
-
Data_Get_Struct(self, sigar_net_interface_stat_t, net_interface_stat);
|
2053
|
-
return rb_ll2inum(net_interface_stat->tx_overruns);
|
2054
|
-
}
|
2055
|
-
static VALUE rb_sigar_NetInterfaceStat_tx_collisions(VALUE self)
|
2056
|
-
{
|
2057
|
-
sigar_net_interface_stat_t *net_interface_stat;
|
2058
|
-
Data_Get_Struct(self, sigar_net_interface_stat_t, net_interface_stat);
|
2059
|
-
return rb_ll2inum(net_interface_stat->tx_collisions);
|
2060
|
-
}
|
2061
|
-
static VALUE rb_sigar_NetInterfaceStat_tx_carrier(VALUE self)
|
2062
|
-
{
|
2063
|
-
sigar_net_interface_stat_t *net_interface_stat;
|
2064
|
-
Data_Get_Struct(self, sigar_net_interface_stat_t, net_interface_stat);
|
2065
|
-
return rb_ll2inum(net_interface_stat->tx_carrier);
|
2066
|
-
}
|
2067
|
-
static VALUE rb_sigar_NetInterfaceStat_speed(VALUE self)
|
2068
|
-
{
|
2069
|
-
sigar_net_interface_stat_t *net_interface_stat;
|
2070
|
-
Data_Get_Struct(self, sigar_net_interface_stat_t, net_interface_stat);
|
2071
|
-
return rb_ll2inum(net_interface_stat->speed);
|
2072
|
-
}
|
2073
|
-
static VALUE rb_cSigarProcCred;
|
2074
|
-
|
2075
|
-
static VALUE rb_sigar_proc_cred(VALUE obj, VALUE pid)
|
2076
|
-
{
|
2077
|
-
SIGAR_GET;
|
2078
|
-
|
2079
|
-
int status;
|
2080
|
-
sigar_proc_cred_t *RETVAL = malloc(sizeof(*RETVAL));
|
2081
|
-
|
2082
|
-
if ((status = sigar_proc_cred_get(sigar, OBJ2PID(pid), RETVAL)) != SIGAR_OK) {
|
2083
|
-
free(RETVAL);
|
2084
|
-
rb_raise(rb_eArgError, "%s", sigar_strerror(sigar, status));
|
2085
|
-
return Qnil;
|
2086
|
-
}
|
2087
|
-
|
2088
|
-
return Data_Wrap_Struct(rb_cSigarProcCred, 0, rb_sigar_free, RETVAL);
|
2089
|
-
}
|
2090
|
-
static VALUE rb_sigar_ProcCred_uid(VALUE self)
|
2091
|
-
{
|
2092
|
-
sigar_proc_cred_t *proc_cred;
|
2093
|
-
Data_Get_Struct(self, sigar_proc_cred_t, proc_cred);
|
2094
|
-
return rb_ll2inum(proc_cred->uid);
|
2095
|
-
}
|
2096
|
-
static VALUE rb_sigar_ProcCred_gid(VALUE self)
|
2097
|
-
{
|
2098
|
-
sigar_proc_cred_t *proc_cred;
|
2099
|
-
Data_Get_Struct(self, sigar_proc_cred_t, proc_cred);
|
2100
|
-
return rb_ll2inum(proc_cred->gid);
|
2101
|
-
}
|
2102
|
-
static VALUE rb_sigar_ProcCred_euid(VALUE self)
|
2103
|
-
{
|
2104
|
-
sigar_proc_cred_t *proc_cred;
|
2105
|
-
Data_Get_Struct(self, sigar_proc_cred_t, proc_cred);
|
2106
|
-
return rb_ll2inum(proc_cred->euid);
|
2107
|
-
}
|
2108
|
-
static VALUE rb_sigar_ProcCred_egid(VALUE self)
|
2109
|
-
{
|
2110
|
-
sigar_proc_cred_t *proc_cred;
|
2111
|
-
Data_Get_Struct(self, sigar_proc_cred_t, proc_cred);
|
2112
|
-
return rb_ll2inum(proc_cred->egid);
|
2113
|
-
}
|
2114
|
-
static VALUE rb_cSigarProcFd;
|
2115
|
-
|
2116
|
-
static VALUE rb_sigar_proc_fd(VALUE obj, VALUE pid)
|
2117
|
-
{
|
2118
|
-
SIGAR_GET;
|
2119
|
-
|
2120
|
-
int status;
|
2121
|
-
sigar_proc_fd_t *RETVAL = malloc(sizeof(*RETVAL));
|
2122
|
-
|
2123
|
-
if ((status = sigar_proc_fd_get(sigar, OBJ2PID(pid), RETVAL)) != SIGAR_OK) {
|
2124
|
-
free(RETVAL);
|
2125
|
-
rb_raise(rb_eArgError, "%s", sigar_strerror(sigar, status));
|
2126
|
-
return Qnil;
|
2127
|
-
}
|
2128
|
-
|
2129
|
-
return Data_Wrap_Struct(rb_cSigarProcFd, 0, rb_sigar_free, RETVAL);
|
2130
|
-
}
|
2131
|
-
static VALUE rb_sigar_ProcFd_total(VALUE self)
|
2132
|
-
{
|
2133
|
-
sigar_proc_fd_t *proc_fd;
|
2134
|
-
Data_Get_Struct(self, sigar_proc_fd_t, proc_fd);
|
2135
|
-
return rb_ll2inum(proc_fd->total);
|
2136
|
-
}
|
2137
|
-
static VALUE rb_cSigarProcCredName;
|
2138
|
-
|
2139
|
-
static VALUE rb_sigar_proc_cred_name(VALUE obj, VALUE pid)
|
2140
|
-
{
|
2141
|
-
SIGAR_GET;
|
2142
|
-
|
2143
|
-
int status;
|
2144
|
-
sigar_proc_cred_name_t *RETVAL = malloc(sizeof(*RETVAL));
|
2145
|
-
|
2146
|
-
if ((status = sigar_proc_cred_name_get(sigar, OBJ2PID(pid), RETVAL)) != SIGAR_OK) {
|
2147
|
-
free(RETVAL);
|
2148
|
-
rb_raise(rb_eArgError, "%s", sigar_strerror(sigar, status));
|
2149
|
-
return Qnil;
|
2150
|
-
}
|
2151
|
-
|
2152
|
-
return Data_Wrap_Struct(rb_cSigarProcCredName, 0, rb_sigar_free, RETVAL);
|
2153
|
-
}
|
2154
|
-
static VALUE rb_sigar_ProcCredName_user(VALUE self)
|
2155
|
-
{
|
2156
|
-
sigar_proc_cred_name_t *proc_cred_name;
|
2157
|
-
Data_Get_Struct(self, sigar_proc_cred_name_t, proc_cred_name);
|
2158
|
-
return rb_str_new2(proc_cred_name->user);
|
2159
|
-
}
|
2160
|
-
static VALUE rb_sigar_ProcCredName_group(VALUE self)
|
2161
|
-
{
|
2162
|
-
sigar_proc_cred_name_t *proc_cred_name;
|
2163
|
-
Data_Get_Struct(self, sigar_proc_cred_name_t, proc_cred_name);
|
2164
|
-
return rb_str_new2(proc_cred_name->group);
|
2165
|
-
}
|
2166
|
-
static VALUE rb_cSigarProcCpu;
|
2167
|
-
|
2168
|
-
static VALUE rb_sigar_proc_cpu(VALUE obj, VALUE pid)
|
2169
|
-
{
|
2170
|
-
SIGAR_GET;
|
2171
|
-
|
2172
|
-
int status;
|
2173
|
-
sigar_proc_cpu_t *RETVAL = malloc(sizeof(*RETVAL));
|
2174
|
-
|
2175
|
-
if ((status = sigar_proc_cpu_get(sigar, OBJ2PID(pid), RETVAL)) != SIGAR_OK) {
|
2176
|
-
free(RETVAL);
|
2177
|
-
rb_raise(rb_eArgError, "%s", sigar_strerror(sigar, status));
|
2178
|
-
return Qnil;
|
2179
|
-
}
|
2180
|
-
|
2181
|
-
return Data_Wrap_Struct(rb_cSigarProcCpu, 0, rb_sigar_free, RETVAL);
|
2182
|
-
}
|
2183
|
-
static VALUE rb_sigar_ProcCpu_percent(VALUE self)
|
2184
|
-
{
|
2185
|
-
sigar_proc_cpu_t *proc_cpu;
|
2186
|
-
Data_Get_Struct(self, sigar_proc_cpu_t, proc_cpu);
|
2187
|
-
return rb_float_new(proc_cpu->percent);
|
2188
|
-
}
|
2189
|
-
static VALUE rb_sigar_ProcCpu_last_time(VALUE self)
|
2190
|
-
{
|
2191
|
-
sigar_proc_cpu_t *proc_cpu;
|
2192
|
-
Data_Get_Struct(self, sigar_proc_cpu_t, proc_cpu);
|
2193
|
-
return rb_ll2inum(proc_cpu->last_time);
|
2194
|
-
}
|
2195
|
-
static VALUE rb_sigar_ProcCpu_start_time(VALUE self)
|
2196
|
-
{
|
2197
|
-
sigar_proc_cpu_t *proc_cpu;
|
2198
|
-
Data_Get_Struct(self, sigar_proc_cpu_t, proc_cpu);
|
2199
|
-
return rb_ll2inum(proc_cpu->start_time);
|
2200
|
-
}
|
2201
|
-
static VALUE rb_sigar_ProcCpu_user(VALUE self)
|
2202
|
-
{
|
2203
|
-
sigar_proc_cpu_t *proc_cpu;
|
2204
|
-
Data_Get_Struct(self, sigar_proc_cpu_t, proc_cpu);
|
2205
|
-
return rb_ll2inum(proc_cpu->user);
|
2206
|
-
}
|
2207
|
-
static VALUE rb_sigar_ProcCpu_sys(VALUE self)
|
2208
|
-
{
|
2209
|
-
sigar_proc_cpu_t *proc_cpu;
|
2210
|
-
Data_Get_Struct(self, sigar_proc_cpu_t, proc_cpu);
|
2211
|
-
return rb_ll2inum(proc_cpu->sys);
|
2212
|
-
}
|
2213
|
-
static VALUE rb_sigar_ProcCpu_total(VALUE self)
|
2214
|
-
{
|
2215
|
-
sigar_proc_cpu_t *proc_cpu;
|
2216
|
-
Data_Get_Struct(self, sigar_proc_cpu_t, proc_cpu);
|
2217
|
-
return rb_ll2inum(proc_cpu->total);
|
2218
|
-
}
|
2219
|
-
static VALUE rb_cSigarNfsServerV2;
|
2220
|
-
|
2221
|
-
static VALUE rb_sigar_nfs_server_v2(VALUE obj)
|
2222
|
-
{
|
2223
|
-
SIGAR_GET;
|
2224
|
-
|
2225
|
-
int status;
|
2226
|
-
sigar_nfs_server_v2_t *RETVAL = malloc(sizeof(*RETVAL));
|
2227
|
-
|
2228
|
-
if ((status = sigar_nfs_server_v2_get(sigar, RETVAL)) != SIGAR_OK) {
|
2229
|
-
free(RETVAL);
|
2230
|
-
rb_raise(rb_eArgError, "%s", sigar_strerror(sigar, status));
|
2231
|
-
return Qnil;
|
2232
|
-
}
|
2233
|
-
|
2234
|
-
return Data_Wrap_Struct(rb_cSigarNfsServerV2, 0, rb_sigar_free, RETVAL);
|
2235
|
-
}
|
2236
|
-
static VALUE rb_sigar_NfsServerV2_null(VALUE self)
|
2237
|
-
{
|
2238
|
-
sigar_nfs_server_v2_t *nfs_server_v2;
|
2239
|
-
Data_Get_Struct(self, sigar_nfs_server_v2_t, nfs_server_v2);
|
2240
|
-
return rb_ll2inum(nfs_server_v2->null);
|
2241
|
-
}
|
2242
|
-
static VALUE rb_sigar_NfsServerV2_getattr(VALUE self)
|
2243
|
-
{
|
2244
|
-
sigar_nfs_server_v2_t *nfs_server_v2;
|
2245
|
-
Data_Get_Struct(self, sigar_nfs_server_v2_t, nfs_server_v2);
|
2246
|
-
return rb_ll2inum(nfs_server_v2->getattr);
|
2247
|
-
}
|
2248
|
-
static VALUE rb_sigar_NfsServerV2_setattr(VALUE self)
|
2249
|
-
{
|
2250
|
-
sigar_nfs_server_v2_t *nfs_server_v2;
|
2251
|
-
Data_Get_Struct(self, sigar_nfs_server_v2_t, nfs_server_v2);
|
2252
|
-
return rb_ll2inum(nfs_server_v2->setattr);
|
2253
|
-
}
|
2254
|
-
static VALUE rb_sigar_NfsServerV2_root(VALUE self)
|
2255
|
-
{
|
2256
|
-
sigar_nfs_server_v2_t *nfs_server_v2;
|
2257
|
-
Data_Get_Struct(self, sigar_nfs_server_v2_t, nfs_server_v2);
|
2258
|
-
return rb_ll2inum(nfs_server_v2->root);
|
2259
|
-
}
|
2260
|
-
static VALUE rb_sigar_NfsServerV2_lookup(VALUE self)
|
2261
|
-
{
|
2262
|
-
sigar_nfs_server_v2_t *nfs_server_v2;
|
2263
|
-
Data_Get_Struct(self, sigar_nfs_server_v2_t, nfs_server_v2);
|
2264
|
-
return rb_ll2inum(nfs_server_v2->lookup);
|
2265
|
-
}
|
2266
|
-
static VALUE rb_sigar_NfsServerV2_readlink(VALUE self)
|
2267
|
-
{
|
2268
|
-
sigar_nfs_server_v2_t *nfs_server_v2;
|
2269
|
-
Data_Get_Struct(self, sigar_nfs_server_v2_t, nfs_server_v2);
|
2270
|
-
return rb_ll2inum(nfs_server_v2->readlink);
|
2271
|
-
}
|
2272
|
-
static VALUE rb_sigar_NfsServerV2_read(VALUE self)
|
2273
|
-
{
|
2274
|
-
sigar_nfs_server_v2_t *nfs_server_v2;
|
2275
|
-
Data_Get_Struct(self, sigar_nfs_server_v2_t, nfs_server_v2);
|
2276
|
-
return rb_ll2inum(nfs_server_v2->read);
|
2277
|
-
}
|
2278
|
-
static VALUE rb_sigar_NfsServerV2_writecache(VALUE self)
|
2279
|
-
{
|
2280
|
-
sigar_nfs_server_v2_t *nfs_server_v2;
|
2281
|
-
Data_Get_Struct(self, sigar_nfs_server_v2_t, nfs_server_v2);
|
2282
|
-
return rb_ll2inum(nfs_server_v2->writecache);
|
2283
|
-
}
|
2284
|
-
static VALUE rb_sigar_NfsServerV2_write(VALUE self)
|
2285
|
-
{
|
2286
|
-
sigar_nfs_server_v2_t *nfs_server_v2;
|
2287
|
-
Data_Get_Struct(self, sigar_nfs_server_v2_t, nfs_server_v2);
|
2288
|
-
return rb_ll2inum(nfs_server_v2->write);
|
2289
|
-
}
|
2290
|
-
static VALUE rb_sigar_NfsServerV2_create(VALUE self)
|
2291
|
-
{
|
2292
|
-
sigar_nfs_server_v2_t *nfs_server_v2;
|
2293
|
-
Data_Get_Struct(self, sigar_nfs_server_v2_t, nfs_server_v2);
|
2294
|
-
return rb_ll2inum(nfs_server_v2->create);
|
2295
|
-
}
|
2296
|
-
static VALUE rb_sigar_NfsServerV2_remove(VALUE self)
|
2297
|
-
{
|
2298
|
-
sigar_nfs_server_v2_t *nfs_server_v2;
|
2299
|
-
Data_Get_Struct(self, sigar_nfs_server_v2_t, nfs_server_v2);
|
2300
|
-
return rb_ll2inum(nfs_server_v2->remove);
|
2301
|
-
}
|
2302
|
-
static VALUE rb_sigar_NfsServerV2_rename(VALUE self)
|
2303
|
-
{
|
2304
|
-
sigar_nfs_server_v2_t *nfs_server_v2;
|
2305
|
-
Data_Get_Struct(self, sigar_nfs_server_v2_t, nfs_server_v2);
|
2306
|
-
return rb_ll2inum(nfs_server_v2->rename);
|
2307
|
-
}
|
2308
|
-
static VALUE rb_sigar_NfsServerV2_link(VALUE self)
|
2309
|
-
{
|
2310
|
-
sigar_nfs_server_v2_t *nfs_server_v2;
|
2311
|
-
Data_Get_Struct(self, sigar_nfs_server_v2_t, nfs_server_v2);
|
2312
|
-
return rb_ll2inum(nfs_server_v2->link);
|
2313
|
-
}
|
2314
|
-
static VALUE rb_sigar_NfsServerV2_symlink(VALUE self)
|
2315
|
-
{
|
2316
|
-
sigar_nfs_server_v2_t *nfs_server_v2;
|
2317
|
-
Data_Get_Struct(self, sigar_nfs_server_v2_t, nfs_server_v2);
|
2318
|
-
return rb_ll2inum(nfs_server_v2->symlink);
|
2319
|
-
}
|
2320
|
-
static VALUE rb_sigar_NfsServerV2_mkdir(VALUE self)
|
2321
|
-
{
|
2322
|
-
sigar_nfs_server_v2_t *nfs_server_v2;
|
2323
|
-
Data_Get_Struct(self, sigar_nfs_server_v2_t, nfs_server_v2);
|
2324
|
-
return rb_ll2inum(nfs_server_v2->mkdir);
|
2325
|
-
}
|
2326
|
-
static VALUE rb_sigar_NfsServerV2_rmdir(VALUE self)
|
2327
|
-
{
|
2328
|
-
sigar_nfs_server_v2_t *nfs_server_v2;
|
2329
|
-
Data_Get_Struct(self, sigar_nfs_server_v2_t, nfs_server_v2);
|
2330
|
-
return rb_ll2inum(nfs_server_v2->rmdir);
|
2331
|
-
}
|
2332
|
-
static VALUE rb_sigar_NfsServerV2_readdir(VALUE self)
|
2333
|
-
{
|
2334
|
-
sigar_nfs_server_v2_t *nfs_server_v2;
|
2335
|
-
Data_Get_Struct(self, sigar_nfs_server_v2_t, nfs_server_v2);
|
2336
|
-
return rb_ll2inum(nfs_server_v2->readdir);
|
2337
|
-
}
|
2338
|
-
static VALUE rb_sigar_NfsServerV2_fsstat(VALUE self)
|
2339
|
-
{
|
2340
|
-
sigar_nfs_server_v2_t *nfs_server_v2;
|
2341
|
-
Data_Get_Struct(self, sigar_nfs_server_v2_t, nfs_server_v2);
|
2342
|
-
return rb_ll2inum(nfs_server_v2->fsstat);
|
2343
|
-
}
|
2344
|
-
static VALUE rb_cSigarProcState;
|
2345
|
-
|
2346
|
-
static VALUE rb_sigar_proc_state(VALUE obj, VALUE pid)
|
2347
|
-
{
|
2348
|
-
SIGAR_GET;
|
2349
|
-
|
2350
|
-
int status;
|
2351
|
-
sigar_proc_state_t *RETVAL = malloc(sizeof(*RETVAL));
|
2352
|
-
|
2353
|
-
if ((status = sigar_proc_state_get(sigar, OBJ2PID(pid), RETVAL)) != SIGAR_OK) {
|
2354
|
-
free(RETVAL);
|
2355
|
-
rb_raise(rb_eArgError, "%s", sigar_strerror(sigar, status));
|
2356
|
-
return Qnil;
|
2357
|
-
}
|
2358
|
-
|
2359
|
-
return Data_Wrap_Struct(rb_cSigarProcState, 0, rb_sigar_free, RETVAL);
|
2360
|
-
}
|
2361
|
-
static VALUE rb_sigar_ProcState_state(VALUE self)
|
2362
|
-
{
|
2363
|
-
sigar_proc_state_t *proc_state;
|
2364
|
-
Data_Get_Struct(self, sigar_proc_state_t, proc_state);
|
2365
|
-
return CHR2FIX(proc_state->state);
|
2366
|
-
}
|
2367
|
-
static VALUE rb_sigar_ProcState_name(VALUE self)
|
2368
|
-
{
|
2369
|
-
sigar_proc_state_t *proc_state;
|
2370
|
-
Data_Get_Struct(self, sigar_proc_state_t, proc_state);
|
2371
|
-
return rb_str_new2(proc_state->name);
|
2372
|
-
}
|
2373
|
-
static VALUE rb_sigar_ProcState_ppid(VALUE self)
|
2374
|
-
{
|
2375
|
-
sigar_proc_state_t *proc_state;
|
2376
|
-
Data_Get_Struct(self, sigar_proc_state_t, proc_state);
|
2377
|
-
return rb_ll2inum(proc_state->ppid);
|
2378
|
-
}
|
2379
|
-
static VALUE rb_sigar_ProcState_tty(VALUE self)
|
2380
|
-
{
|
2381
|
-
sigar_proc_state_t *proc_state;
|
2382
|
-
Data_Get_Struct(self, sigar_proc_state_t, proc_state);
|
2383
|
-
return rb_int2inum(proc_state->tty);
|
2384
|
-
}
|
2385
|
-
static VALUE rb_sigar_ProcState_nice(VALUE self)
|
2386
|
-
{
|
2387
|
-
sigar_proc_state_t *proc_state;
|
2388
|
-
Data_Get_Struct(self, sigar_proc_state_t, proc_state);
|
2389
|
-
return rb_int2inum(proc_state->nice);
|
2390
|
-
}
|
2391
|
-
static VALUE rb_sigar_ProcState_priority(VALUE self)
|
2392
|
-
{
|
2393
|
-
sigar_proc_state_t *proc_state;
|
2394
|
-
Data_Get_Struct(self, sigar_proc_state_t, proc_state);
|
2395
|
-
return rb_int2inum(proc_state->priority);
|
2396
|
-
}
|
2397
|
-
static VALUE rb_sigar_ProcState_threads(VALUE self)
|
2398
|
-
{
|
2399
|
-
sigar_proc_state_t *proc_state;
|
2400
|
-
Data_Get_Struct(self, sigar_proc_state_t, proc_state);
|
2401
|
-
return rb_ll2inum(proc_state->threads);
|
2402
|
-
}
|
2403
|
-
static VALUE rb_sigar_ProcState_processor(VALUE self)
|
2404
|
-
{
|
2405
|
-
sigar_proc_state_t *proc_state;
|
2406
|
-
Data_Get_Struct(self, sigar_proc_state_t, proc_state);
|
2407
|
-
return rb_int2inum(proc_state->processor);
|
2408
|
-
}
|
2409
|
-
static VALUE rb_cSigarProcExe;
|
2410
|
-
|
2411
|
-
static VALUE rb_sigar_proc_exe(VALUE obj, VALUE pid)
|
2412
|
-
{
|
2413
|
-
SIGAR_GET;
|
2414
|
-
|
2415
|
-
int status;
|
2416
|
-
sigar_proc_exe_t *RETVAL = malloc(sizeof(*RETVAL));
|
2417
|
-
|
2418
|
-
if ((status = sigar_proc_exe_get(sigar, OBJ2PID(pid), RETVAL)) != SIGAR_OK) {
|
2419
|
-
free(RETVAL);
|
2420
|
-
rb_raise(rb_eArgError, "%s", sigar_strerror(sigar, status));
|
2421
|
-
return Qnil;
|
2422
|
-
}
|
2423
|
-
|
2424
|
-
return Data_Wrap_Struct(rb_cSigarProcExe, 0, rb_sigar_free, RETVAL);
|
2425
|
-
}
|
2426
|
-
static VALUE rb_sigar_ProcExe_name(VALUE self)
|
2427
|
-
{
|
2428
|
-
sigar_proc_exe_t *proc_exe;
|
2429
|
-
Data_Get_Struct(self, sigar_proc_exe_t, proc_exe);
|
2430
|
-
return rb_str_new2(proc_exe->name);
|
2431
|
-
}
|
2432
|
-
static VALUE rb_sigar_ProcExe_cwd(VALUE self)
|
2433
|
-
{
|
2434
|
-
sigar_proc_exe_t *proc_exe;
|
2435
|
-
Data_Get_Struct(self, sigar_proc_exe_t, proc_exe);
|
2436
|
-
return rb_str_new2(proc_exe->cwd);
|
2437
|
-
}
|
2438
|
-
static void rb_sigar_define_module_methods(VALUE rclass)
|
2439
|
-
{
|
2440
|
-
rb_define_method(rclass, "uptime", rb_sigar_uptime, 0);
|
2441
|
-
rb_define_method(rclass, "dir_stat", rb_sigar_dir_stat, 1);
|
2442
|
-
rb_define_method(rclass, "resource_limit", rb_sigar_resource_limit, 0);
|
2443
|
-
rb_define_method(rclass, "nfs_server_v3", rb_sigar_nfs_server_v3, 0);
|
2444
|
-
rb_define_method(rclass, "file_attrs", rb_sigar_file_attrs, 1);
|
2445
|
-
rb_define_method(rclass, "cpu", rb_sigar_cpu, 0);
|
2446
|
-
rb_define_method(rclass, "nfs_client_v2", rb_sigar_nfs_client_v2, 0);
|
2447
|
-
rb_define_method(rclass, "disk_usage", rb_sigar_disk_usage, 1);
|
2448
|
-
rb_define_method(rclass, "swap", rb_sigar_swap, 0);
|
2449
|
-
rb_define_method(rclass, "proc_time", rb_sigar_proc_time, 1);
|
2450
|
-
rb_define_method(rclass, "file_system_usage", rb_sigar_file_system_usage, 1);
|
2451
|
-
rb_define_method(rclass, "proc_mem", rb_sigar_proc_mem, 1);
|
2452
|
-
rb_define_method(rclass, "thread_cpu", rb_sigar_thread_cpu, 1);
|
2453
|
-
rb_define_method(rclass, "proc_stat", rb_sigar_proc_stat, 0);
|
2454
|
-
rb_define_method(rclass, "net_interface_config", rb_sigar_net_interface_config, 1);
|
2455
|
-
rb_define_method(rclass, "net_info", rb_sigar_net_info, 0);
|
2456
|
-
rb_define_method(rclass, "sys_info", rb_sigar_sys_info, 0);
|
2457
|
-
rb_define_method(rclass, "mem", rb_sigar_mem, 0);
|
2458
|
-
rb_define_method(rclass, "nfs_client_v3", rb_sigar_nfs_client_v3, 0);
|
2459
|
-
rb_define_method(rclass, "dir_usage", rb_sigar_dir_usage, 1);
|
2460
|
-
rb_define_method(rclass, "tcp", rb_sigar_tcp, 0);
|
2461
|
-
rb_define_method(rclass, "net_interface_stat", rb_sigar_net_interface_stat, 1);
|
2462
|
-
rb_define_method(rclass, "proc_cred", rb_sigar_proc_cred, 1);
|
2463
|
-
rb_define_method(rclass, "proc_fd", rb_sigar_proc_fd, 1);
|
2464
|
-
rb_define_method(rclass, "proc_cred_name", rb_sigar_proc_cred_name, 1);
|
2465
|
-
rb_define_method(rclass, "proc_cpu", rb_sigar_proc_cpu, 1);
|
2466
|
-
rb_define_method(rclass, "nfs_server_v2", rb_sigar_nfs_server_v2, 0);
|
2467
|
-
rb_define_method(rclass, "proc_state", rb_sigar_proc_state, 1);
|
2468
|
-
rb_define_method(rclass, "proc_exe", rb_sigar_proc_exe, 1);
|
2469
|
-
rb_cSigarArp = rb_define_class_under(rclass, "Arp", rb_cObject);
|
2470
|
-
rb_define_method(rb_cSigarArp, "ifname", rb_sigar_Arp_ifname, 0);
|
2471
|
-
rb_define_method(rb_cSigarArp, "hwaddr", rb_sigar_Arp_hwaddr, 0);
|
2472
|
-
rb_define_method(rb_cSigarArp, "type", rb_sigar_Arp_type, 0);
|
2473
|
-
rb_define_method(rb_cSigarArp, "address", rb_sigar_Arp_address, 0);
|
2474
|
-
rb_define_method(rb_cSigarArp, "flags", rb_sigar_Arp_flags, 0);
|
2475
|
-
rb_cSigarCpu = rb_define_class_under(rclass, "Cpu", rb_cObject);
|
2476
|
-
rb_define_method(rb_cSigarCpu, "user", rb_sigar_Cpu_user, 0);
|
2477
|
-
rb_define_method(rb_cSigarCpu, "sys", rb_sigar_Cpu_sys, 0);
|
2478
|
-
rb_define_method(rb_cSigarCpu, "nice", rb_sigar_Cpu_nice, 0);
|
2479
|
-
rb_define_method(rb_cSigarCpu, "idle", rb_sigar_Cpu_idle, 0);
|
2480
|
-
rb_define_method(rb_cSigarCpu, "wait", rb_sigar_Cpu_wait, 0);
|
2481
|
-
rb_define_method(rb_cSigarCpu, "irq", rb_sigar_Cpu_irq, 0);
|
2482
|
-
rb_define_method(rb_cSigarCpu, "soft_irq", rb_sigar_Cpu_soft_irq, 0);
|
2483
|
-
rb_define_method(rb_cSigarCpu, "stolen", rb_sigar_Cpu_stolen, 0);
|
2484
|
-
rb_define_method(rb_cSigarCpu, "total", rb_sigar_Cpu_total, 0);
|
2485
|
-
rb_cSigarCpuInfo = rb_define_class_under(rclass, "CpuInfo", rb_cObject);
|
2486
|
-
rb_define_method(rb_cSigarCpuInfo, "vendor", rb_sigar_CpuInfo_vendor, 0);
|
2487
|
-
rb_define_method(rb_cSigarCpuInfo, "model", rb_sigar_CpuInfo_model, 0);
|
2488
|
-
rb_define_method(rb_cSigarCpuInfo, "mhz", rb_sigar_CpuInfo_mhz, 0);
|
2489
|
-
rb_define_method(rb_cSigarCpuInfo, "mhz_max", rb_sigar_CpuInfo_mhz_max, 0);
|
2490
|
-
rb_define_method(rb_cSigarCpuInfo, "mhz_min", rb_sigar_CpuInfo_mhz_min, 0);
|
2491
|
-
rb_define_method(rb_cSigarCpuInfo, "cache_size", rb_sigar_CpuInfo_cache_size, 0);
|
2492
|
-
rb_define_method(rb_cSigarCpuInfo, "total_cores", rb_sigar_CpuInfo_total_cores, 0);
|
2493
|
-
rb_define_method(rb_cSigarCpuInfo, "total_sockets", rb_sigar_CpuInfo_total_sockets, 0);
|
2494
|
-
rb_define_method(rb_cSigarCpuInfo, "cores_per_socket", rb_sigar_CpuInfo_cores_per_socket, 0);
|
2495
|
-
rb_cSigarCpuPerc = rb_define_class_under(rclass, "CpuPerc", rb_cObject);
|
2496
|
-
rb_define_method(rb_cSigarCpuPerc, "user", rb_sigar_CpuPerc_user, 0);
|
2497
|
-
rb_define_method(rb_cSigarCpuPerc, "sys", rb_sigar_CpuPerc_sys, 0);
|
2498
|
-
rb_define_method(rb_cSigarCpuPerc, "nice", rb_sigar_CpuPerc_nice, 0);
|
2499
|
-
rb_define_method(rb_cSigarCpuPerc, "idle", rb_sigar_CpuPerc_idle, 0);
|
2500
|
-
rb_define_method(rb_cSigarCpuPerc, "wait", rb_sigar_CpuPerc_wait, 0);
|
2501
|
-
rb_define_method(rb_cSigarCpuPerc, "irq", rb_sigar_CpuPerc_irq, 0);
|
2502
|
-
rb_define_method(rb_cSigarCpuPerc, "soft_irq", rb_sigar_CpuPerc_soft_irq, 0);
|
2503
|
-
rb_define_method(rb_cSigarCpuPerc, "stolen", rb_sigar_CpuPerc_stolen, 0);
|
2504
|
-
rb_define_method(rb_cSigarCpuPerc, "combined", rb_sigar_CpuPerc_combined, 0);
|
2505
|
-
rb_cSigarDirStat = rb_define_class_under(rclass, "DirStat", rb_cObject);
|
2506
|
-
rb_define_method(rb_cSigarDirStat, "total", rb_sigar_DirStat_total, 0);
|
2507
|
-
rb_define_method(rb_cSigarDirStat, "files", rb_sigar_DirStat_files, 0);
|
2508
|
-
rb_define_method(rb_cSigarDirStat, "subdirs", rb_sigar_DirStat_subdirs, 0);
|
2509
|
-
rb_define_method(rb_cSigarDirStat, "symlinks", rb_sigar_DirStat_symlinks, 0);
|
2510
|
-
rb_define_method(rb_cSigarDirStat, "chrdevs", rb_sigar_DirStat_chrdevs, 0);
|
2511
|
-
rb_define_method(rb_cSigarDirStat, "blkdevs", rb_sigar_DirStat_blkdevs, 0);
|
2512
|
-
rb_define_method(rb_cSigarDirStat, "sockets", rb_sigar_DirStat_sockets, 0);
|
2513
|
-
rb_define_method(rb_cSigarDirStat, "disk_usage", rb_sigar_DirStat_disk_usage, 0);
|
2514
|
-
rb_cSigarDirUsage = rb_define_class_under(rclass, "DirUsage", rb_cObject);
|
2515
|
-
rb_define_method(rb_cSigarDirUsage, "total", rb_sigar_DirUsage_total, 0);
|
2516
|
-
rb_define_method(rb_cSigarDirUsage, "files", rb_sigar_DirUsage_files, 0);
|
2517
|
-
rb_define_method(rb_cSigarDirUsage, "subdirs", rb_sigar_DirUsage_subdirs, 0);
|
2518
|
-
rb_define_method(rb_cSigarDirUsage, "symlinks", rb_sigar_DirUsage_symlinks, 0);
|
2519
|
-
rb_define_method(rb_cSigarDirUsage, "chrdevs", rb_sigar_DirUsage_chrdevs, 0);
|
2520
|
-
rb_define_method(rb_cSigarDirUsage, "blkdevs", rb_sigar_DirUsage_blkdevs, 0);
|
2521
|
-
rb_define_method(rb_cSigarDirUsage, "sockets", rb_sigar_DirUsage_sockets, 0);
|
2522
|
-
rb_define_method(rb_cSigarDirUsage, "disk_usage", rb_sigar_DirUsage_disk_usage, 0);
|
2523
|
-
rb_cSigarDiskUsage = rb_define_class_under(rclass, "DiskUsage", rb_cObject);
|
2524
|
-
rb_define_method(rb_cSigarDiskUsage, "reads", rb_sigar_DiskUsage_reads, 0);
|
2525
|
-
rb_define_method(rb_cSigarDiskUsage, "writes", rb_sigar_DiskUsage_writes, 0);
|
2526
|
-
rb_define_method(rb_cSigarDiskUsage, "read_bytes", rb_sigar_DiskUsage_read_bytes, 0);
|
2527
|
-
rb_define_method(rb_cSigarDiskUsage, "write_bytes", rb_sigar_DiskUsage_write_bytes, 0);
|
2528
|
-
rb_define_method(rb_cSigarDiskUsage, "queue", rb_sigar_DiskUsage_queue, 0);
|
2529
|
-
rb_define_method(rb_cSigarDiskUsage, "service_time", rb_sigar_DiskUsage_service_time, 0);
|
2530
|
-
rb_cSigarFileAttrs = rb_define_class_under(rclass, "FileAttrs", rb_cObject);
|
2531
|
-
rb_define_method(rb_cSigarFileAttrs, "permissions", rb_sigar_FileAttrs_permissions, 0);
|
2532
|
-
rb_define_method(rb_cSigarFileAttrs, "type", rb_sigar_FileAttrs_type, 0);
|
2533
|
-
rb_define_method(rb_cSigarFileAttrs, "uid", rb_sigar_FileAttrs_uid, 0);
|
2534
|
-
rb_define_method(rb_cSigarFileAttrs, "gid", rb_sigar_FileAttrs_gid, 0);
|
2535
|
-
rb_define_method(rb_cSigarFileAttrs, "inode", rb_sigar_FileAttrs_inode, 0);
|
2536
|
-
rb_define_method(rb_cSigarFileAttrs, "device", rb_sigar_FileAttrs_device, 0);
|
2537
|
-
rb_define_method(rb_cSigarFileAttrs, "nlink", rb_sigar_FileAttrs_nlink, 0);
|
2538
|
-
rb_define_method(rb_cSigarFileAttrs, "size", rb_sigar_FileAttrs_size, 0);
|
2539
|
-
rb_define_method(rb_cSigarFileAttrs, "atime", rb_sigar_FileAttrs_atime, 0);
|
2540
|
-
rb_define_method(rb_cSigarFileAttrs, "ctime", rb_sigar_FileAttrs_ctime, 0);
|
2541
|
-
rb_define_method(rb_cSigarFileAttrs, "mtime", rb_sigar_FileAttrs_mtime, 0);
|
2542
|
-
rb_cSigarFileSystem = rb_define_class_under(rclass, "FileSystem", rb_cObject);
|
2543
|
-
rb_define_method(rb_cSigarFileSystem, "dir_name", rb_sigar_FileSystem_dir_name, 0);
|
2544
|
-
rb_define_method(rb_cSigarFileSystem, "dev_name", rb_sigar_FileSystem_dev_name, 0);
|
2545
|
-
rb_define_method(rb_cSigarFileSystem, "type_name", rb_sigar_FileSystem_type_name, 0);
|
2546
|
-
rb_define_method(rb_cSigarFileSystem, "sys_type_name", rb_sigar_FileSystem_sys_type_name, 0);
|
2547
|
-
rb_define_method(rb_cSigarFileSystem, "options", rb_sigar_FileSystem_options, 0);
|
2548
|
-
rb_define_method(rb_cSigarFileSystem, "type", rb_sigar_FileSystem_type, 0);
|
2549
|
-
rb_define_method(rb_cSigarFileSystem, "flags", rb_sigar_FileSystem_flags, 0);
|
2550
|
-
rb_cSigarFileSystemUsage = rb_define_class_under(rclass, "FileSystemUsage", rb_cObject);
|
2551
|
-
rb_define_method(rb_cSigarFileSystemUsage, "total", rb_sigar_FileSystemUsage_total, 0);
|
2552
|
-
rb_define_method(rb_cSigarFileSystemUsage, "free", rb_sigar_FileSystemUsage_free, 0);
|
2553
|
-
rb_define_method(rb_cSigarFileSystemUsage, "used", rb_sigar_FileSystemUsage_used, 0);
|
2554
|
-
rb_define_method(rb_cSigarFileSystemUsage, "avail", rb_sigar_FileSystemUsage_avail, 0);
|
2555
|
-
rb_define_method(rb_cSigarFileSystemUsage, "files", rb_sigar_FileSystemUsage_files, 0);
|
2556
|
-
rb_define_method(rb_cSigarFileSystemUsage, "free_files", rb_sigar_FileSystemUsage_free_files, 0);
|
2557
|
-
rb_define_method(rb_cSigarFileSystemUsage, "disk_reads", rb_sigar_FileSystemUsage_disk_reads, 0);
|
2558
|
-
rb_define_method(rb_cSigarFileSystemUsage, "disk_writes", rb_sigar_FileSystemUsage_disk_writes, 0);
|
2559
|
-
rb_define_method(rb_cSigarFileSystemUsage, "disk_read_bytes", rb_sigar_FileSystemUsage_disk_read_bytes, 0);
|
2560
|
-
rb_define_method(rb_cSigarFileSystemUsage, "disk_write_bytes", rb_sigar_FileSystemUsage_disk_write_bytes, 0);
|
2561
|
-
rb_define_method(rb_cSigarFileSystemUsage, "disk_queue", rb_sigar_FileSystemUsage_disk_queue, 0);
|
2562
|
-
rb_define_method(rb_cSigarFileSystemUsage, "disk_service_time", rb_sigar_FileSystemUsage_disk_service_time, 0);
|
2563
|
-
rb_define_method(rb_cSigarFileSystemUsage, "use_percent", rb_sigar_FileSystemUsage_use_percent, 0);
|
2564
|
-
rb_cSigarMem = rb_define_class_under(rclass, "Mem", rb_cObject);
|
2565
|
-
rb_define_method(rb_cSigarMem, "total", rb_sigar_Mem_total, 0);
|
2566
|
-
rb_define_method(rb_cSigarMem, "ram", rb_sigar_Mem_ram, 0);
|
2567
|
-
rb_define_method(rb_cSigarMem, "used", rb_sigar_Mem_used, 0);
|
2568
|
-
rb_define_method(rb_cSigarMem, "free", rb_sigar_Mem_free, 0);
|
2569
|
-
rb_define_method(rb_cSigarMem, "actual_used", rb_sigar_Mem_actual_used, 0);
|
2570
|
-
rb_define_method(rb_cSigarMem, "actual_free", rb_sigar_Mem_actual_free, 0);
|
2571
|
-
rb_define_method(rb_cSigarMem, "used_percent", rb_sigar_Mem_used_percent, 0);
|
2572
|
-
rb_define_method(rb_cSigarMem, "free_percent", rb_sigar_Mem_free_percent, 0);
|
2573
|
-
rb_cSigarNetConnection = rb_define_class_under(rclass, "NetConnection", rb_cObject);
|
2574
|
-
rb_define_method(rb_cSigarNetConnection, "local_port", rb_sigar_NetConnection_local_port, 0);
|
2575
|
-
rb_define_method(rb_cSigarNetConnection, "local_address", rb_sigar_NetConnection_local_address, 0);
|
2576
|
-
rb_define_method(rb_cSigarNetConnection, "remote_port", rb_sigar_NetConnection_remote_port, 0);
|
2577
|
-
rb_define_method(rb_cSigarNetConnection, "remote_address", rb_sigar_NetConnection_remote_address, 0);
|
2578
|
-
rb_define_method(rb_cSigarNetConnection, "type", rb_sigar_NetConnection_type, 0);
|
2579
|
-
rb_define_method(rb_cSigarNetConnection, "state", rb_sigar_NetConnection_state, 0);
|
2580
|
-
rb_define_method(rb_cSigarNetConnection, "send_queue", rb_sigar_NetConnection_send_queue, 0);
|
2581
|
-
rb_define_method(rb_cSigarNetConnection, "receive_queue", rb_sigar_NetConnection_receive_queue, 0);
|
2582
|
-
rb_cSigarNetInfo = rb_define_class_under(rclass, "NetInfo", rb_cObject);
|
2583
|
-
rb_define_method(rb_cSigarNetInfo, "default_gateway", rb_sigar_NetInfo_default_gateway, 0);
|
2584
|
-
rb_define_method(rb_cSigarNetInfo, "default_gateway_interface", rb_sigar_NetInfo_default_gateway_interface, 0);
|
2585
|
-
rb_define_method(rb_cSigarNetInfo, "host_name", rb_sigar_NetInfo_host_name, 0);
|
2586
|
-
rb_define_method(rb_cSigarNetInfo, "domain_name", rb_sigar_NetInfo_domain_name, 0);
|
2587
|
-
rb_define_method(rb_cSigarNetInfo, "primary_dns", rb_sigar_NetInfo_primary_dns, 0);
|
2588
|
-
rb_define_method(rb_cSigarNetInfo, "secondary_dns", rb_sigar_NetInfo_secondary_dns, 0);
|
2589
|
-
rb_cSigarNetInterfaceConfig = rb_define_class_under(rclass, "NetInterfaceConfig", rb_cObject);
|
2590
|
-
rb_define_method(rb_cSigarNetInterfaceConfig, "name", rb_sigar_NetInterfaceConfig_name, 0);
|
2591
|
-
rb_define_method(rb_cSigarNetInterfaceConfig, "hwaddr", rb_sigar_NetInterfaceConfig_hwaddr, 0);
|
2592
|
-
rb_define_method(rb_cSigarNetInterfaceConfig, "type", rb_sigar_NetInterfaceConfig_type, 0);
|
2593
|
-
rb_define_method(rb_cSigarNetInterfaceConfig, "description", rb_sigar_NetInterfaceConfig_description, 0);
|
2594
|
-
rb_define_method(rb_cSigarNetInterfaceConfig, "address", rb_sigar_NetInterfaceConfig_address, 0);
|
2595
|
-
rb_define_method(rb_cSigarNetInterfaceConfig, "address6", rb_sigar_NetInterfaceConfig_address6, 0);
|
2596
|
-
rb_define_method(rb_cSigarNetInterfaceConfig, "prefix6_length", rb_sigar_NetInterfaceConfig_prefix6_length, 0);
|
2597
|
-
rb_define_method(rb_cSigarNetInterfaceConfig, "scope6", rb_sigar_NetInterfaceConfig_scope6, 0);
|
2598
|
-
rb_define_method(rb_cSigarNetInterfaceConfig, "destination", rb_sigar_NetInterfaceConfig_destination, 0);
|
2599
|
-
rb_define_method(rb_cSigarNetInterfaceConfig, "broadcast", rb_sigar_NetInterfaceConfig_broadcast, 0);
|
2600
|
-
rb_define_method(rb_cSigarNetInterfaceConfig, "netmask", rb_sigar_NetInterfaceConfig_netmask, 0);
|
2601
|
-
rb_define_method(rb_cSigarNetInterfaceConfig, "flags", rb_sigar_NetInterfaceConfig_flags, 0);
|
2602
|
-
rb_define_method(rb_cSigarNetInterfaceConfig, "mtu", rb_sigar_NetInterfaceConfig_mtu, 0);
|
2603
|
-
rb_define_method(rb_cSigarNetInterfaceConfig, "metric", rb_sigar_NetInterfaceConfig_metric, 0);
|
2604
|
-
rb_define_method(rb_cSigarNetInterfaceConfig, "tx_queue_len", rb_sigar_NetInterfaceConfig_tx_queue_len, 0);
|
2605
|
-
rb_cSigarNetInterfaceStat = rb_define_class_under(rclass, "NetInterfaceStat", rb_cObject);
|
2606
|
-
rb_define_method(rb_cSigarNetInterfaceStat, "rx_bytes", rb_sigar_NetInterfaceStat_rx_bytes, 0);
|
2607
|
-
rb_define_method(rb_cSigarNetInterfaceStat, "rx_packets", rb_sigar_NetInterfaceStat_rx_packets, 0);
|
2608
|
-
rb_define_method(rb_cSigarNetInterfaceStat, "rx_errors", rb_sigar_NetInterfaceStat_rx_errors, 0);
|
2609
|
-
rb_define_method(rb_cSigarNetInterfaceStat, "rx_dropped", rb_sigar_NetInterfaceStat_rx_dropped, 0);
|
2610
|
-
rb_define_method(rb_cSigarNetInterfaceStat, "rx_overruns", rb_sigar_NetInterfaceStat_rx_overruns, 0);
|
2611
|
-
rb_define_method(rb_cSigarNetInterfaceStat, "rx_frame", rb_sigar_NetInterfaceStat_rx_frame, 0);
|
2612
|
-
rb_define_method(rb_cSigarNetInterfaceStat, "tx_bytes", rb_sigar_NetInterfaceStat_tx_bytes, 0);
|
2613
|
-
rb_define_method(rb_cSigarNetInterfaceStat, "tx_packets", rb_sigar_NetInterfaceStat_tx_packets, 0);
|
2614
|
-
rb_define_method(rb_cSigarNetInterfaceStat, "tx_errors", rb_sigar_NetInterfaceStat_tx_errors, 0);
|
2615
|
-
rb_define_method(rb_cSigarNetInterfaceStat, "tx_dropped", rb_sigar_NetInterfaceStat_tx_dropped, 0);
|
2616
|
-
rb_define_method(rb_cSigarNetInterfaceStat, "tx_overruns", rb_sigar_NetInterfaceStat_tx_overruns, 0);
|
2617
|
-
rb_define_method(rb_cSigarNetInterfaceStat, "tx_collisions", rb_sigar_NetInterfaceStat_tx_collisions, 0);
|
2618
|
-
rb_define_method(rb_cSigarNetInterfaceStat, "tx_carrier", rb_sigar_NetInterfaceStat_tx_carrier, 0);
|
2619
|
-
rb_define_method(rb_cSigarNetInterfaceStat, "speed", rb_sigar_NetInterfaceStat_speed, 0);
|
2620
|
-
rb_cSigarNetRoute = rb_define_class_under(rclass, "NetRoute", rb_cObject);
|
2621
|
-
rb_define_method(rb_cSigarNetRoute, "destination", rb_sigar_NetRoute_destination, 0);
|
2622
|
-
rb_define_method(rb_cSigarNetRoute, "gateway", rb_sigar_NetRoute_gateway, 0);
|
2623
|
-
rb_define_method(rb_cSigarNetRoute, "flags", rb_sigar_NetRoute_flags, 0);
|
2624
|
-
rb_define_method(rb_cSigarNetRoute, "refcnt", rb_sigar_NetRoute_refcnt, 0);
|
2625
|
-
rb_define_method(rb_cSigarNetRoute, "use", rb_sigar_NetRoute_use, 0);
|
2626
|
-
rb_define_method(rb_cSigarNetRoute, "metric", rb_sigar_NetRoute_metric, 0);
|
2627
|
-
rb_define_method(rb_cSigarNetRoute, "mask", rb_sigar_NetRoute_mask, 0);
|
2628
|
-
rb_define_method(rb_cSigarNetRoute, "mtu", rb_sigar_NetRoute_mtu, 0);
|
2629
|
-
rb_define_method(rb_cSigarNetRoute, "window", rb_sigar_NetRoute_window, 0);
|
2630
|
-
rb_define_method(rb_cSigarNetRoute, "irtt", rb_sigar_NetRoute_irtt, 0);
|
2631
|
-
rb_define_method(rb_cSigarNetRoute, "ifname", rb_sigar_NetRoute_ifname, 0);
|
2632
|
-
rb_cSigarNetStat = rb_define_class_under(rclass, "NetStat", rb_cObject);
|
2633
|
-
rb_define_method(rb_cSigarNetStat, "tcp_inbound_total", rb_sigar_NetStat_tcp_inbound_total, 0);
|
2634
|
-
rb_define_method(rb_cSigarNetStat, "tcp_outbound_total", rb_sigar_NetStat_tcp_outbound_total, 0);
|
2635
|
-
rb_define_method(rb_cSigarNetStat, "all_inbound_total", rb_sigar_NetStat_all_inbound_total, 0);
|
2636
|
-
rb_define_method(rb_cSigarNetStat, "all_outbound_total", rb_sigar_NetStat_all_outbound_total, 0);
|
2637
|
-
rb_cSigarNfsClientV2 = rb_define_class_under(rclass, "NfsClientV2", rb_cObject);
|
2638
|
-
rb_define_method(rb_cSigarNfsClientV2, "null", rb_sigar_NfsClientV2_null, 0);
|
2639
|
-
rb_define_method(rb_cSigarNfsClientV2, "getattr", rb_sigar_NfsClientV2_getattr, 0);
|
2640
|
-
rb_define_method(rb_cSigarNfsClientV2, "setattr", rb_sigar_NfsClientV2_setattr, 0);
|
2641
|
-
rb_define_method(rb_cSigarNfsClientV2, "root", rb_sigar_NfsClientV2_root, 0);
|
2642
|
-
rb_define_method(rb_cSigarNfsClientV2, "lookup", rb_sigar_NfsClientV2_lookup, 0);
|
2643
|
-
rb_define_method(rb_cSigarNfsClientV2, "readlink", rb_sigar_NfsClientV2_readlink, 0);
|
2644
|
-
rb_define_method(rb_cSigarNfsClientV2, "read", rb_sigar_NfsClientV2_read, 0);
|
2645
|
-
rb_define_method(rb_cSigarNfsClientV2, "writecache", rb_sigar_NfsClientV2_writecache, 0);
|
2646
|
-
rb_define_method(rb_cSigarNfsClientV2, "write", rb_sigar_NfsClientV2_write, 0);
|
2647
|
-
rb_define_method(rb_cSigarNfsClientV2, "create", rb_sigar_NfsClientV2_create, 0);
|
2648
|
-
rb_define_method(rb_cSigarNfsClientV2, "remove", rb_sigar_NfsClientV2_remove, 0);
|
2649
|
-
rb_define_method(rb_cSigarNfsClientV2, "rename", rb_sigar_NfsClientV2_rename, 0);
|
2650
|
-
rb_define_method(rb_cSigarNfsClientV2, "link", rb_sigar_NfsClientV2_link, 0);
|
2651
|
-
rb_define_method(rb_cSigarNfsClientV2, "symlink", rb_sigar_NfsClientV2_symlink, 0);
|
2652
|
-
rb_define_method(rb_cSigarNfsClientV2, "mkdir", rb_sigar_NfsClientV2_mkdir, 0);
|
2653
|
-
rb_define_method(rb_cSigarNfsClientV2, "rmdir", rb_sigar_NfsClientV2_rmdir, 0);
|
2654
|
-
rb_define_method(rb_cSigarNfsClientV2, "readdir", rb_sigar_NfsClientV2_readdir, 0);
|
2655
|
-
rb_define_method(rb_cSigarNfsClientV2, "fsstat", rb_sigar_NfsClientV2_fsstat, 0);
|
2656
|
-
rb_cSigarNfsClientV3 = rb_define_class_under(rclass, "NfsClientV3", rb_cObject);
|
2657
|
-
rb_define_method(rb_cSigarNfsClientV3, "null", rb_sigar_NfsClientV3_null, 0);
|
2658
|
-
rb_define_method(rb_cSigarNfsClientV3, "getattr", rb_sigar_NfsClientV3_getattr, 0);
|
2659
|
-
rb_define_method(rb_cSigarNfsClientV3, "setattr", rb_sigar_NfsClientV3_setattr, 0);
|
2660
|
-
rb_define_method(rb_cSigarNfsClientV3, "lookup", rb_sigar_NfsClientV3_lookup, 0);
|
2661
|
-
rb_define_method(rb_cSigarNfsClientV3, "access", rb_sigar_NfsClientV3_access, 0);
|
2662
|
-
rb_define_method(rb_cSigarNfsClientV3, "readlink", rb_sigar_NfsClientV3_readlink, 0);
|
2663
|
-
rb_define_method(rb_cSigarNfsClientV3, "read", rb_sigar_NfsClientV3_read, 0);
|
2664
|
-
rb_define_method(rb_cSigarNfsClientV3, "write", rb_sigar_NfsClientV3_write, 0);
|
2665
|
-
rb_define_method(rb_cSigarNfsClientV3, "create", rb_sigar_NfsClientV3_create, 0);
|
2666
|
-
rb_define_method(rb_cSigarNfsClientV3, "mkdir", rb_sigar_NfsClientV3_mkdir, 0);
|
2667
|
-
rb_define_method(rb_cSigarNfsClientV3, "symlink", rb_sigar_NfsClientV3_symlink, 0);
|
2668
|
-
rb_define_method(rb_cSigarNfsClientV3, "mknod", rb_sigar_NfsClientV3_mknod, 0);
|
2669
|
-
rb_define_method(rb_cSigarNfsClientV3, "remove", rb_sigar_NfsClientV3_remove, 0);
|
2670
|
-
rb_define_method(rb_cSigarNfsClientV3, "rmdir", rb_sigar_NfsClientV3_rmdir, 0);
|
2671
|
-
rb_define_method(rb_cSigarNfsClientV3, "rename", rb_sigar_NfsClientV3_rename, 0);
|
2672
|
-
rb_define_method(rb_cSigarNfsClientV3, "link", rb_sigar_NfsClientV3_link, 0);
|
2673
|
-
rb_define_method(rb_cSigarNfsClientV3, "readdir", rb_sigar_NfsClientV3_readdir, 0);
|
2674
|
-
rb_define_method(rb_cSigarNfsClientV3, "readdirplus", rb_sigar_NfsClientV3_readdirplus, 0);
|
2675
|
-
rb_define_method(rb_cSigarNfsClientV3, "fsstat", rb_sigar_NfsClientV3_fsstat, 0);
|
2676
|
-
rb_define_method(rb_cSigarNfsClientV3, "fsinfo", rb_sigar_NfsClientV3_fsinfo, 0);
|
2677
|
-
rb_define_method(rb_cSigarNfsClientV3, "pathconf", rb_sigar_NfsClientV3_pathconf, 0);
|
2678
|
-
rb_define_method(rb_cSigarNfsClientV3, "commit", rb_sigar_NfsClientV3_commit, 0);
|
2679
|
-
rb_cSigarNfsServerV2 = rb_define_class_under(rclass, "NfsServerV2", rb_cObject);
|
2680
|
-
rb_define_method(rb_cSigarNfsServerV2, "null", rb_sigar_NfsServerV2_null, 0);
|
2681
|
-
rb_define_method(rb_cSigarNfsServerV2, "getattr", rb_sigar_NfsServerV2_getattr, 0);
|
2682
|
-
rb_define_method(rb_cSigarNfsServerV2, "setattr", rb_sigar_NfsServerV2_setattr, 0);
|
2683
|
-
rb_define_method(rb_cSigarNfsServerV2, "root", rb_sigar_NfsServerV2_root, 0);
|
2684
|
-
rb_define_method(rb_cSigarNfsServerV2, "lookup", rb_sigar_NfsServerV2_lookup, 0);
|
2685
|
-
rb_define_method(rb_cSigarNfsServerV2, "readlink", rb_sigar_NfsServerV2_readlink, 0);
|
2686
|
-
rb_define_method(rb_cSigarNfsServerV2, "read", rb_sigar_NfsServerV2_read, 0);
|
2687
|
-
rb_define_method(rb_cSigarNfsServerV2, "writecache", rb_sigar_NfsServerV2_writecache, 0);
|
2688
|
-
rb_define_method(rb_cSigarNfsServerV2, "write", rb_sigar_NfsServerV2_write, 0);
|
2689
|
-
rb_define_method(rb_cSigarNfsServerV2, "create", rb_sigar_NfsServerV2_create, 0);
|
2690
|
-
rb_define_method(rb_cSigarNfsServerV2, "remove", rb_sigar_NfsServerV2_remove, 0);
|
2691
|
-
rb_define_method(rb_cSigarNfsServerV2, "rename", rb_sigar_NfsServerV2_rename, 0);
|
2692
|
-
rb_define_method(rb_cSigarNfsServerV2, "link", rb_sigar_NfsServerV2_link, 0);
|
2693
|
-
rb_define_method(rb_cSigarNfsServerV2, "symlink", rb_sigar_NfsServerV2_symlink, 0);
|
2694
|
-
rb_define_method(rb_cSigarNfsServerV2, "mkdir", rb_sigar_NfsServerV2_mkdir, 0);
|
2695
|
-
rb_define_method(rb_cSigarNfsServerV2, "rmdir", rb_sigar_NfsServerV2_rmdir, 0);
|
2696
|
-
rb_define_method(rb_cSigarNfsServerV2, "readdir", rb_sigar_NfsServerV2_readdir, 0);
|
2697
|
-
rb_define_method(rb_cSigarNfsServerV2, "fsstat", rb_sigar_NfsServerV2_fsstat, 0);
|
2698
|
-
rb_cSigarNfsServerV3 = rb_define_class_under(rclass, "NfsServerV3", rb_cObject);
|
2699
|
-
rb_define_method(rb_cSigarNfsServerV3, "null", rb_sigar_NfsServerV3_null, 0);
|
2700
|
-
rb_define_method(rb_cSigarNfsServerV3, "getattr", rb_sigar_NfsServerV3_getattr, 0);
|
2701
|
-
rb_define_method(rb_cSigarNfsServerV3, "setattr", rb_sigar_NfsServerV3_setattr, 0);
|
2702
|
-
rb_define_method(rb_cSigarNfsServerV3, "lookup", rb_sigar_NfsServerV3_lookup, 0);
|
2703
|
-
rb_define_method(rb_cSigarNfsServerV3, "access", rb_sigar_NfsServerV3_access, 0);
|
2704
|
-
rb_define_method(rb_cSigarNfsServerV3, "readlink", rb_sigar_NfsServerV3_readlink, 0);
|
2705
|
-
rb_define_method(rb_cSigarNfsServerV3, "read", rb_sigar_NfsServerV3_read, 0);
|
2706
|
-
rb_define_method(rb_cSigarNfsServerV3, "write", rb_sigar_NfsServerV3_write, 0);
|
2707
|
-
rb_define_method(rb_cSigarNfsServerV3, "create", rb_sigar_NfsServerV3_create, 0);
|
2708
|
-
rb_define_method(rb_cSigarNfsServerV3, "mkdir", rb_sigar_NfsServerV3_mkdir, 0);
|
2709
|
-
rb_define_method(rb_cSigarNfsServerV3, "symlink", rb_sigar_NfsServerV3_symlink, 0);
|
2710
|
-
rb_define_method(rb_cSigarNfsServerV3, "mknod", rb_sigar_NfsServerV3_mknod, 0);
|
2711
|
-
rb_define_method(rb_cSigarNfsServerV3, "remove", rb_sigar_NfsServerV3_remove, 0);
|
2712
|
-
rb_define_method(rb_cSigarNfsServerV3, "rmdir", rb_sigar_NfsServerV3_rmdir, 0);
|
2713
|
-
rb_define_method(rb_cSigarNfsServerV3, "rename", rb_sigar_NfsServerV3_rename, 0);
|
2714
|
-
rb_define_method(rb_cSigarNfsServerV3, "link", rb_sigar_NfsServerV3_link, 0);
|
2715
|
-
rb_define_method(rb_cSigarNfsServerV3, "readdir", rb_sigar_NfsServerV3_readdir, 0);
|
2716
|
-
rb_define_method(rb_cSigarNfsServerV3, "readdirplus", rb_sigar_NfsServerV3_readdirplus, 0);
|
2717
|
-
rb_define_method(rb_cSigarNfsServerV3, "fsstat", rb_sigar_NfsServerV3_fsstat, 0);
|
2718
|
-
rb_define_method(rb_cSigarNfsServerV3, "fsinfo", rb_sigar_NfsServerV3_fsinfo, 0);
|
2719
|
-
rb_define_method(rb_cSigarNfsServerV3, "pathconf", rb_sigar_NfsServerV3_pathconf, 0);
|
2720
|
-
rb_define_method(rb_cSigarNfsServerV3, "commit", rb_sigar_NfsServerV3_commit, 0);
|
2721
|
-
rb_cSigarProcCpu = rb_define_class_under(rclass, "ProcCpu", rb_cObject);
|
2722
|
-
rb_define_method(rb_cSigarProcCpu, "percent", rb_sigar_ProcCpu_percent, 0);
|
2723
|
-
rb_define_method(rb_cSigarProcCpu, "last_time", rb_sigar_ProcCpu_last_time, 0);
|
2724
|
-
rb_define_method(rb_cSigarProcCpu, "start_time", rb_sigar_ProcCpu_start_time, 0);
|
2725
|
-
rb_define_method(rb_cSigarProcCpu, "user", rb_sigar_ProcCpu_user, 0);
|
2726
|
-
rb_define_method(rb_cSigarProcCpu, "sys", rb_sigar_ProcCpu_sys, 0);
|
2727
|
-
rb_define_method(rb_cSigarProcCpu, "total", rb_sigar_ProcCpu_total, 0);
|
2728
|
-
rb_cSigarProcCred = rb_define_class_under(rclass, "ProcCred", rb_cObject);
|
2729
|
-
rb_define_method(rb_cSigarProcCred, "uid", rb_sigar_ProcCred_uid, 0);
|
2730
|
-
rb_define_method(rb_cSigarProcCred, "gid", rb_sigar_ProcCred_gid, 0);
|
2731
|
-
rb_define_method(rb_cSigarProcCred, "euid", rb_sigar_ProcCred_euid, 0);
|
2732
|
-
rb_define_method(rb_cSigarProcCred, "egid", rb_sigar_ProcCred_egid, 0);
|
2733
|
-
rb_cSigarProcCredName = rb_define_class_under(rclass, "ProcCredName", rb_cObject);
|
2734
|
-
rb_define_method(rb_cSigarProcCredName, "user", rb_sigar_ProcCredName_user, 0);
|
2735
|
-
rb_define_method(rb_cSigarProcCredName, "group", rb_sigar_ProcCredName_group, 0);
|
2736
|
-
rb_cSigarProcExe = rb_define_class_under(rclass, "ProcExe", rb_cObject);
|
2737
|
-
rb_define_method(rb_cSigarProcExe, "name", rb_sigar_ProcExe_name, 0);
|
2738
|
-
rb_define_method(rb_cSigarProcExe, "cwd", rb_sigar_ProcExe_cwd, 0);
|
2739
|
-
rb_cSigarProcFd = rb_define_class_under(rclass, "ProcFd", rb_cObject);
|
2740
|
-
rb_define_method(rb_cSigarProcFd, "total", rb_sigar_ProcFd_total, 0);
|
2741
|
-
rb_cSigarProcMem = rb_define_class_under(rclass, "ProcMem", rb_cObject);
|
2742
|
-
rb_define_method(rb_cSigarProcMem, "size", rb_sigar_ProcMem_size, 0);
|
2743
|
-
rb_define_method(rb_cSigarProcMem, "resident", rb_sigar_ProcMem_resident, 0);
|
2744
|
-
rb_define_method(rb_cSigarProcMem, "share", rb_sigar_ProcMem_share, 0);
|
2745
|
-
rb_define_method(rb_cSigarProcMem, "minor_faults", rb_sigar_ProcMem_minor_faults, 0);
|
2746
|
-
rb_define_method(rb_cSigarProcMem, "major_faults", rb_sigar_ProcMem_major_faults, 0);
|
2747
|
-
rb_define_method(rb_cSigarProcMem, "page_faults", rb_sigar_ProcMem_page_faults, 0);
|
2748
|
-
rb_cSigarProcStat = rb_define_class_under(rclass, "ProcStat", rb_cObject);
|
2749
|
-
rb_define_method(rb_cSigarProcStat, "total", rb_sigar_ProcStat_total, 0);
|
2750
|
-
rb_define_method(rb_cSigarProcStat, "idle", rb_sigar_ProcStat_idle, 0);
|
2751
|
-
rb_define_method(rb_cSigarProcStat, "running", rb_sigar_ProcStat_running, 0);
|
2752
|
-
rb_define_method(rb_cSigarProcStat, "sleeping", rb_sigar_ProcStat_sleeping, 0);
|
2753
|
-
rb_define_method(rb_cSigarProcStat, "stopped", rb_sigar_ProcStat_stopped, 0);
|
2754
|
-
rb_define_method(rb_cSigarProcStat, "zombie", rb_sigar_ProcStat_zombie, 0);
|
2755
|
-
rb_define_method(rb_cSigarProcStat, "threads", rb_sigar_ProcStat_threads, 0);
|
2756
|
-
rb_cSigarProcState = rb_define_class_under(rclass, "ProcState", rb_cObject);
|
2757
|
-
rb_define_method(rb_cSigarProcState, "state", rb_sigar_ProcState_state, 0);
|
2758
|
-
rb_define_method(rb_cSigarProcState, "name", rb_sigar_ProcState_name, 0);
|
2759
|
-
rb_define_method(rb_cSigarProcState, "ppid", rb_sigar_ProcState_ppid, 0);
|
2760
|
-
rb_define_method(rb_cSigarProcState, "tty", rb_sigar_ProcState_tty, 0);
|
2761
|
-
rb_define_method(rb_cSigarProcState, "nice", rb_sigar_ProcState_nice, 0);
|
2762
|
-
rb_define_method(rb_cSigarProcState, "priority", rb_sigar_ProcState_priority, 0);
|
2763
|
-
rb_define_method(rb_cSigarProcState, "threads", rb_sigar_ProcState_threads, 0);
|
2764
|
-
rb_define_method(rb_cSigarProcState, "processor", rb_sigar_ProcState_processor, 0);
|
2765
|
-
rb_cSigarProcTime = rb_define_class_under(rclass, "ProcTime", rb_cObject);
|
2766
|
-
rb_define_method(rb_cSigarProcTime, "start_time", rb_sigar_ProcTime_start_time, 0);
|
2767
|
-
rb_define_method(rb_cSigarProcTime, "user", rb_sigar_ProcTime_user, 0);
|
2768
|
-
rb_define_method(rb_cSigarProcTime, "sys", rb_sigar_ProcTime_sys, 0);
|
2769
|
-
rb_define_method(rb_cSigarProcTime, "total", rb_sigar_ProcTime_total, 0);
|
2770
|
-
rb_cSigarResourceLimit = rb_define_class_under(rclass, "ResourceLimit", rb_cObject);
|
2771
|
-
rb_define_method(rb_cSigarResourceLimit, "cpu_cur", rb_sigar_ResourceLimit_cpu_cur, 0);
|
2772
|
-
rb_define_method(rb_cSigarResourceLimit, "cpu_max", rb_sigar_ResourceLimit_cpu_max, 0);
|
2773
|
-
rb_define_method(rb_cSigarResourceLimit, "file_size_cur", rb_sigar_ResourceLimit_file_size_cur, 0);
|
2774
|
-
rb_define_method(rb_cSigarResourceLimit, "file_size_max", rb_sigar_ResourceLimit_file_size_max, 0);
|
2775
|
-
rb_define_method(rb_cSigarResourceLimit, "pipe_size_max", rb_sigar_ResourceLimit_pipe_size_max, 0);
|
2776
|
-
rb_define_method(rb_cSigarResourceLimit, "pipe_size_cur", rb_sigar_ResourceLimit_pipe_size_cur, 0);
|
2777
|
-
rb_define_method(rb_cSigarResourceLimit, "data_cur", rb_sigar_ResourceLimit_data_cur, 0);
|
2778
|
-
rb_define_method(rb_cSigarResourceLimit, "data_max", rb_sigar_ResourceLimit_data_max, 0);
|
2779
|
-
rb_define_method(rb_cSigarResourceLimit, "stack_cur", rb_sigar_ResourceLimit_stack_cur, 0);
|
2780
|
-
rb_define_method(rb_cSigarResourceLimit, "stack_max", rb_sigar_ResourceLimit_stack_max, 0);
|
2781
|
-
rb_define_method(rb_cSigarResourceLimit, "core_cur", rb_sigar_ResourceLimit_core_cur, 0);
|
2782
|
-
rb_define_method(rb_cSigarResourceLimit, "core_max", rb_sigar_ResourceLimit_core_max, 0);
|
2783
|
-
rb_define_method(rb_cSigarResourceLimit, "memory_cur", rb_sigar_ResourceLimit_memory_cur, 0);
|
2784
|
-
rb_define_method(rb_cSigarResourceLimit, "memory_max", rb_sigar_ResourceLimit_memory_max, 0);
|
2785
|
-
rb_define_method(rb_cSigarResourceLimit, "processes_cur", rb_sigar_ResourceLimit_processes_cur, 0);
|
2786
|
-
rb_define_method(rb_cSigarResourceLimit, "processes_max", rb_sigar_ResourceLimit_processes_max, 0);
|
2787
|
-
rb_define_method(rb_cSigarResourceLimit, "open_files_cur", rb_sigar_ResourceLimit_open_files_cur, 0);
|
2788
|
-
rb_define_method(rb_cSigarResourceLimit, "open_files_max", rb_sigar_ResourceLimit_open_files_max, 0);
|
2789
|
-
rb_define_method(rb_cSigarResourceLimit, "virtual_memory_cur", rb_sigar_ResourceLimit_virtual_memory_cur, 0);
|
2790
|
-
rb_define_method(rb_cSigarResourceLimit, "virtual_memory_max", rb_sigar_ResourceLimit_virtual_memory_max, 0);
|
2791
|
-
rb_cSigarSwap = rb_define_class_under(rclass, "Swap", rb_cObject);
|
2792
|
-
rb_define_method(rb_cSigarSwap, "total", rb_sigar_Swap_total, 0);
|
2793
|
-
rb_define_method(rb_cSigarSwap, "used", rb_sigar_Swap_used, 0);
|
2794
|
-
rb_define_method(rb_cSigarSwap, "free", rb_sigar_Swap_free, 0);
|
2795
|
-
rb_define_method(rb_cSigarSwap, "page_in", rb_sigar_Swap_page_in, 0);
|
2796
|
-
rb_define_method(rb_cSigarSwap, "page_out", rb_sigar_Swap_page_out, 0);
|
2797
|
-
rb_cSigarSysInfo = rb_define_class_under(rclass, "SysInfo", rb_cObject);
|
2798
|
-
rb_define_method(rb_cSigarSysInfo, "name", rb_sigar_SysInfo_name, 0);
|
2799
|
-
rb_define_method(rb_cSigarSysInfo, "version", rb_sigar_SysInfo_version, 0);
|
2800
|
-
rb_define_method(rb_cSigarSysInfo, "arch", rb_sigar_SysInfo_arch, 0);
|
2801
|
-
rb_define_method(rb_cSigarSysInfo, "machine", rb_sigar_SysInfo_machine, 0);
|
2802
|
-
rb_define_method(rb_cSigarSysInfo, "description", rb_sigar_SysInfo_description, 0);
|
2803
|
-
rb_define_method(rb_cSigarSysInfo, "patch_level", rb_sigar_SysInfo_patch_level, 0);
|
2804
|
-
rb_define_method(rb_cSigarSysInfo, "vendor", rb_sigar_SysInfo_vendor, 0);
|
2805
|
-
rb_define_method(rb_cSigarSysInfo, "vendor_version", rb_sigar_SysInfo_vendor_version, 0);
|
2806
|
-
rb_define_method(rb_cSigarSysInfo, "vendor_name", rb_sigar_SysInfo_vendor_name, 0);
|
2807
|
-
rb_define_method(rb_cSigarSysInfo, "vendor_code_name", rb_sigar_SysInfo_vendor_code_name, 0);
|
2808
|
-
rb_cSigarTcp = rb_define_class_under(rclass, "Tcp", rb_cObject);
|
2809
|
-
rb_define_method(rb_cSigarTcp, "active_opens", rb_sigar_Tcp_active_opens, 0);
|
2810
|
-
rb_define_method(rb_cSigarTcp, "passive_opens", rb_sigar_Tcp_passive_opens, 0);
|
2811
|
-
rb_define_method(rb_cSigarTcp, "attempt_fails", rb_sigar_Tcp_attempt_fails, 0);
|
2812
|
-
rb_define_method(rb_cSigarTcp, "estab_resets", rb_sigar_Tcp_estab_resets, 0);
|
2813
|
-
rb_define_method(rb_cSigarTcp, "curr_estab", rb_sigar_Tcp_curr_estab, 0);
|
2814
|
-
rb_define_method(rb_cSigarTcp, "in_segs", rb_sigar_Tcp_in_segs, 0);
|
2815
|
-
rb_define_method(rb_cSigarTcp, "out_segs", rb_sigar_Tcp_out_segs, 0);
|
2816
|
-
rb_define_method(rb_cSigarTcp, "retrans_segs", rb_sigar_Tcp_retrans_segs, 0);
|
2817
|
-
rb_define_method(rb_cSigarTcp, "in_errs", rb_sigar_Tcp_in_errs, 0);
|
2818
|
-
rb_define_method(rb_cSigarTcp, "out_rsts", rb_sigar_Tcp_out_rsts, 0);
|
2819
|
-
rb_cSigarThreadCpu = rb_define_class_under(rclass, "ThreadCpu", rb_cObject);
|
2820
|
-
rb_define_method(rb_cSigarThreadCpu, "user", rb_sigar_ThreadCpu_user, 0);
|
2821
|
-
rb_define_method(rb_cSigarThreadCpu, "sys", rb_sigar_ThreadCpu_sys, 0);
|
2822
|
-
rb_define_method(rb_cSigarThreadCpu, "total", rb_sigar_ThreadCpu_total, 0);
|
2823
|
-
rb_cSigarUptime = rb_define_class_under(rclass, "Uptime", rb_cObject);
|
2824
|
-
rb_define_method(rb_cSigarUptime, "uptime", rb_sigar_Uptime_uptime, 0);
|
2825
|
-
rb_cSigarWho = rb_define_class_under(rclass, "Who", rb_cObject);
|
2826
|
-
rb_define_method(rb_cSigarWho, "user", rb_sigar_Who_user, 0);
|
2827
|
-
rb_define_method(rb_cSigarWho, "device", rb_sigar_Who_device, 0);
|
2828
|
-
rb_define_method(rb_cSigarWho, "host", rb_sigar_Who_host, 0);
|
2829
|
-
rb_define_method(rb_cSigarWho, "time", rb_sigar_Who_time, 0);
|
2830
|
-
}
|