kostya-sigar 2.0.5 → 2.0.6.test

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZjNiOTg4ZjVhOTc5OGVlZDhkZTIzMzVhNGI5OGM5ZTg4OGRlYTc3MQ==
4
+ NTYxNjIwMmE3YzJmOWJmY2ZiZWU3NjI1Yzc3YjdkMWI0N2JjN2QyZA==
5
5
  data.tar.gz: !binary |-
6
- NWEwOTJhMzY1N2U5NDA0Nzk3OTUxMjdjMTM1MWNjYjUyN2NhNDMwMg==
6
+ ZDc4ZmJkZjRiY2JkOGRkZTIyZmQ0MTkzYjRjOGViNTkxN2UzZjk0ZA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YTIzZjZjNmE0ZjQ0M2M0YTkyNDZlMGIyNTEwYmVmMmFiMjUwYjViZDcwZDFh
10
- NTI4ZGNiNTQ0MTNkYjc4ZWUyMzVmNWI3MWZkNzk0Zjg1NGQxY2VhY2E5ZjNh
11
- ZWIyOGIwZGNlZTQ4OWUyZmNlNzZiZThhNDE0YjBkOTYxMWU1MmM=
9
+ MjM1YWFhNjBkZmMwN2E3ZmMzZmM0YzgyMWQ5M2FhODYwNjRmMDBhN2I0NDc3
10
+ OGMzMzFjZjk0Mjc5NTQ2ZTdiMDdiNzA0ODEyZjY4Mzk4ODA1NDZiYzlkNmRm
11
+ OGI2ODk1ZDE1MGI4NDA1MTQzNTA1Y2FkMjAyMDY1NmYxY2JlYTE=
12
12
  data.tar.gz: !binary |-
13
- YmNkYTFlMjMwOGFjZWZmOGY0YmRlODRiYzM5YWFiMWFhNzU0NDBhODllZWJi
14
- YmIxMWQ0YzE5ZDU5YThiMGE3YTQwYjhmYzdiYThkZThiOWZmNmNmY2UyNTZh
15
- NjU2MGE2MGFmZjMwOTJhNTRlNGUwOTc5MDgxYmJiN2RmYjViN2U=
13
+ ZjFmOGEwM2UyZmJkOGY0YjY0ZDdmNTc5YzdkN2RhNjFiZThkNjJjNDY2MzAw
14
+ YTc5MzQ3YmRiMTZkZjQ5OTM3YWJjNzQ1MzcwZWVjYmU2MTU4Njk1OWQ0Yjc1
15
+ NjMxOGYzYWE3N2U4ZmY4OWMyZDUxMjY1YjA3NmNhYjg0NjA2ZDA=
data/README.md CHANGED
@@ -4,22 +4,22 @@ Fork of hyperic/sigar with some fixes. Support only ruby binding. Part of [Eye g
4
4
 
5
5
  ## Fixed:
6
6
 
7
- ### [2.0.0] 22-01-2018
8
- * sigfaulted logger, [#28](https://github.com/hyperic/sigar/pull/28)([commit](https://github.com/kostya/sigar/commit/c2a1af))
9
- * bug undefined symbol: sigar_skip_token, [#60](https://github.com/hyperic/sigar/pull/60)([commit](https://github.com/kostya/sigar/commit/dfe8fe))
10
- * bug detection boot_time on linux (now it works like gnu ps, and fix some issues with process start_time) ([commit](https://github.com/kostya/sigar/commit/660259))
7
+ ### [2.0.5] 02-12-2018
8
+ * Fix compilation with musl libc [#4](https://github.com/kostya/sigar/pull/4)([commit](https://github.com/kostya/sigar/pull/4/commits/cd07923dd2ed34aca353dfd182f2f85c13853fd9))
11
9
 
12
- ### [2.0.1] 10-04-2018
13
- * FreeBSD: don't use v_cache_min/max [#68](https://github.com/hyperic/sigar/pull/68)([commit](https://github.com/kostya/sigar/commit/800076db97bcacb1ba90805d740b4f9a5a1d3cca))
10
+ ### [2.0.4] 10-06-2018
11
+ * fix compilation with glibc 2.26, major/minor functions [#2](https://github.com/kostya/sigar/issues/2)([commit](https://github.com/kostya/sigar/commit/a2c67588d0f686e0007dadcaf0e4bbb35c0e1e83))
14
12
 
15
13
  ### [2.0.2] 30-05-2018
16
14
  * Remove obsolete rpc usage (fix compilation fail with glibc 2.27) [#213](https://github.com/kostya/eye/issues/213)([commit](https://github.com/kostya/sigar/commit/a971b9e8e1443fdf236c5ffa199c1994c05fcd4b))
17
15
 
18
- ### [2.0.4] 10-06-2018
19
- * fix compilation with glibc 2.26, major/minor functions [#2](https://github.com/kostya/sigar/issues/2)([commit](https://github.com/kostya/sigar/commit/a2c67588d0f686e0007dadcaf0e4bbb35c0e1e83))
16
+ ### [2.0.1] 10-04-2018
17
+ * FreeBSD: don't use v_cache_min/max [#68](https://github.com/hyperic/sigar/pull/68)([commit](https://github.com/kostya/sigar/commit/800076db97bcacb1ba90805d740b4f9a5a1d3cca))
20
18
 
21
- ### [2.0.5] 02-12-2018
22
- * Fix compilation with musl libc [#4](https://github.com/kostya/sigar/pull/4)([commit](https://github.com/kostya/sigar/pull/4/commits/cd07923dd2ed34aca353dfd182f2f85c13853fd9))
19
+ ### [2.0.0] 22-01-2018
20
+ * sigfaulted logger, [#28](https://github.com/hyperic/sigar/pull/28)([commit](https://github.com/kostya/sigar/commit/c2a1af))
21
+ * bug undefined symbol: sigar_skip_token, [#60](https://github.com/hyperic/sigar/pull/60)([commit](https://github.com/kostya/sigar/commit/dfe8fe))
22
+ * bug detection boot_time on linux (now it works like gnu ps, and fix some issues with process start_time) ([commit](https://github.com/kostya/sigar/commit/660259))
23
23
 
24
24
 
25
25
  ## Installation:
data/Rakefile CHANGED
@@ -20,7 +20,7 @@ MAKE = (/mswin/ =~ RUBY_PLATFORM) ? 'nmake' : 'make'
20
20
 
21
21
  spec = Gem::Specification.new do |s|
22
22
  s.name = GEM
23
- s.version = props['version.major'] + '.' + props['version.minor'] + '.' + props['version.maint']
23
+ s.version = props['version.major'] + '.' + props['version.minor'] + '.' + props['version.maint'] + '.test'
24
24
  s.summary = props['project.summary']
25
25
  s.description = s.summary
26
26
  s.author = props['project.author']
@@ -123,6 +123,69 @@
123
123
  #endif
124
124
 
125
125
  #if defined(SIGAR_FREEBSD5)
126
+ #if __FreeBSD_version >= 1200028
127
+ #define VMMETER_TYPE uint64_t
128
+ #else
129
+ #define VMMETER_TYPE u_int
130
+ #endif
131
+ struct __vmmeter {
132
+ VMMETER_TYPE v_vm_faults;
133
+ VMMETER_TYPE v_io_faults;
134
+ VMMETER_TYPE v_cow_faults;
135
+ VMMETER_TYPE v_cow_optim;
136
+ VMMETER_TYPE v_zfod;
137
+ VMMETER_TYPE v_ozfod;
138
+ VMMETER_TYPE v_swapin;
139
+ VMMETER_TYPE v_swapout;
140
+ VMMETER_TYPE v_swappgsin;
141
+ VMMETER_TYPE v_swappgsout;
142
+ VMMETER_TYPE v_vnodein;
143
+ VMMETER_TYPE v_vnodeout;
144
+ VMMETER_TYPE v_vnodepgsin;
145
+ VMMETER_TYPE v_vnodepgsout;
146
+ VMMETER_TYPE v_intrans;
147
+ VMMETER_TYPE v_reactivated;
148
+ VMMETER_TYPE v_pdwakeups;
149
+ VMMETER_TYPE v_pdpages;
150
+ VMMETER_TYPE v_pdshortfalls;
151
+ VMMETER_TYPE v_dfree;
152
+ VMMETER_TYPE v_pfree;
153
+ VMMETER_TYPE v_tfree;
154
+ VMMETER_TYPE v_forks;
155
+ VMMETER_TYPE v_vforks;
156
+ VMMETER_TYPE v_rforks;
157
+ VMMETER_TYPE v_kthreads;
158
+ VMMETER_TYPE v_forkpages;
159
+ VMMETER_TYPE v_vforkpages;
160
+ VMMETER_TYPE v_rforkpages;
161
+ VMMETER_TYPE v_kthreadpages;
162
+ VMMETER_TYPE v_swtch;
163
+ VMMETER_TYPE v_syscall;
164
+ VMMETER_TYPE v_trap;
165
+ VMMETER_TYPE v_intr;
166
+ VMMETER_TYPE v_soft;
167
+ u_int v_page_size;
168
+ u_int v_page_count;
169
+ u_int v_free_reserved;
170
+ u_int v_free_target;
171
+ u_int v_free_min;
172
+ u_int v_free_count;
173
+ u_int v_wire_count;
174
+ u_int v_active_count;
175
+ u_int v_inactive_target;
176
+ u_int v_inactive_count;
177
+ u_int v_laundry_count;
178
+ u_int v_pageout_free_min;
179
+ u_int v_interrupt_free_min;
180
+ u_int v_free_severe;
181
+ #if (__FreeBSD_version < 1200016)
182
+ u_int v_cache_count;
183
+ #endif
184
+ #if (__FreeBSD_version < 1100079)
185
+ u_int v_cache_min;
186
+ u_int v_cache_max;
187
+ #endif
188
+ };
126
189
 
127
190
  #define KI_FD ki_fd
128
191
  #define KI_PID ki_pid
@@ -342,24 +405,21 @@ static int sigar_vmstat(sigar_t *sigar, vm_statistics_data_t *vmstat)
342
405
  }
343
406
  }
344
407
  #elif defined(__FreeBSD__)
345
- static int sigar_vmstat(sigar_t *sigar, struct vmmeter *vmstat)
408
+ static int sigar_vmstat(sigar_t *sigar, struct __vmmeter *vmstat)
346
409
  {
347
- int status;
348
- size_t size = sizeof(unsigned int);
349
-
350
- status = kread(sigar, vmstat, sizeof(*vmstat),
351
- sigar->koffsets[KOFFSET_VMMETER]);
352
-
353
- if (status == SIGAR_OK) {
354
- return SIGAR_OK;
355
- }
410
+ size_t size;
356
411
 
357
412
  SIGAR_ZERO(vmstat);
358
413
 
359
414
  /* derived from src/usr.bin/vmstat/vmstat.c */
360
415
  /* only collect the ones we actually use */
361
- #define GET_VM_STATS(cat, name, used) \
362
- if (used) sysctlbyname("vm.stats." #cat "." #name, &vmstat->name, &size, NULL, 0)
416
+ #define GET_VM_STATS(cat, name, used) do { \
417
+ if (used) { \
418
+ size = sizeof(vmstat->name); \
419
+ sysctlbyname("vm.stats." #cat "." #name, &vmstat->name, \
420
+ &size, NULL, 0); \
421
+ } \
422
+ } while (0)
363
423
 
364
424
  /* sys */
365
425
  GET_VM_STATS(sys, v_swtch, 0);
@@ -399,10 +459,12 @@ static int sigar_vmstat(sigar_t *sigar, struct vmmeter *vmstat)
399
459
  GET_VM_STATS(vm, v_active_count, 0);
400
460
  GET_VM_STATS(vm, v_inactive_target, 0);
401
461
  GET_VM_STATS(vm, v_inactive_count, 1);
462
+ #if (__FreeBSD_version < 1200016 )
402
463
  GET_VM_STATS(vm, v_cache_count, 1);
403
- #if (__FreeBSD_version < 1100079)
404
- GET_VM_STATS(vm, v_cache_min, 0);
405
- GET_VM_STATS(vm, v_cache_max, 0);
464
+ #endif
465
+ #if (__FreeBSD_version < 1100079 )
466
+ GET_VM_STATS(vm, v_cache_min, 0);
467
+ GET_VM_STATS(vm, v_cache_max, 0);
406
468
  #endif
407
469
  GET_VM_STATS(vm, v_pageout_free_min, 0);
408
470
  GET_VM_STATS(vm, v_interrupt_free_min, 0);
@@ -442,7 +504,7 @@ int sigar_mem_get(sigar_t *sigar, sigar_mem_t *mem)
442
504
  unsigned long mem_total;
443
505
  #endif
444
506
  #if defined(__FreeBSD__)
445
- struct vmmeter vmstat;
507
+ struct __vmmeter vmstat;
446
508
  #elif defined(__OpenBSD__) || defined(__NetBSD__)
447
509
  struct uvmexp vmstat;
448
510
  #endif
@@ -481,7 +543,11 @@ int sigar_mem_get(sigar_t *sigar, sigar_mem_t *mem)
481
543
  kern *= sigar->pagesize;
482
544
  #elif defined(__FreeBSD__)
483
545
  if ((status = sigar_vmstat(sigar, &vmstat)) == SIGAR_OK) {
546
+ #if (__FreeBSD_version < 1200016 )
484
547
  kern = vmstat.v_cache_count + vmstat.v_inactive_count;
548
+ #else
549
+ kern = vmstat.v_inactive_count;
550
+ #endif
485
551
  kern *= sigar->pagesize;
486
552
  mem->free = vmstat.v_free_count;
487
553
  mem->free *= sigar->pagesize;
@@ -691,7 +757,7 @@ int sigar_swap_get(sigar_t *sigar, sigar_swap_t *swap)
691
757
  swap->page_out = vmstat.pageouts;
692
758
  #elif defined(__FreeBSD__)
693
759
  struct kvm_swap kswap[1];
694
- struct vmmeter vmstat;
760
+ struct __vmmeter vmstat;
695
761
 
696
762
  if (getswapinfo_sysctl(kswap, 1) != SIGAR_OK) {
697
763
  if (!sigar->kmem) {
@@ -3057,8 +3123,13 @@ static int net_connection_get(sigar_net_connection_walker_t *walker, int proto)
3057
3123
  int type, istcp = 0;
3058
3124
  char *buf;
3059
3125
  const char *mibvar;
3126
+ #if defined(__FreeBSD__) && (__FreeBSD_version >= 1200026)
3127
+ struct xtcpcb *tp = NULL;
3128
+ struct xinpcb *inp;
3129
+ #else
3060
3130
  struct tcpcb *tp = NULL;
3061
3131
  struct inpcb *inp;
3132
+ #endif
3062
3133
  struct xinpgen *xig, *oxig;
3063
3134
  struct xsocket *so;
3064
3135
  size_t len;
@@ -3096,6 +3167,15 @@ static int net_connection_get(sigar_net_connection_walker_t *walker, int proto)
3096
3167
  xig->xig_len > sizeof(struct xinpgen);
3097
3168
  xig = (struct xinpgen *)((char *)xig + xig->xig_len))
3098
3169
  {
3170
+ #if defined(__FreeBSD__) && (__FreeBSD_version >= 1200026)
3171
+ if (istcp) {
3172
+ tp = (struct xtcpcb *)xig;
3173
+ inp = &tp->xt_inp;
3174
+ } else {
3175
+ inp = (struct xinpcb *)xig;
3176
+ }
3177
+ so = &inp->xi_socket;
3178
+ #else
3099
3179
  if (istcp) {
3100
3180
  struct xtcpcb *cb = (struct xtcpcb *)xig;
3101
3181
  tp = &cb->xt_tp;
@@ -3107,6 +3187,7 @@ static int net_connection_get(sigar_net_connection_walker_t *walker, int proto)
3107
3187
  inp = &cb->xi_inp;
3108
3188
  so = &cb->xi_socket;
3109
3189
  }
3190
+ #endif
3110
3191
 
3111
3192
  if (so->xso_protocol != proto) {
3112
3193
  continue;
data/version.properties CHANGED
@@ -1,8 +1,8 @@
1
1
  copyright.year=2004-2011
2
2
  version.major=2
3
3
  version.minor=0
4
- version.maint=5
5
- version.build=0
4
+ version.maint=6
5
+ version.build=test
6
6
  project.name=kostya-sigar
7
7
  project.author=Doug MacEachern
8
8
  project.email=sigar-users@hyperic.org
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kostya-sigar
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.5
4
+ version: 2.0.6.test
5
5
  platform: ruby
6
6
  authors:
7
7
  - Doug MacEachern
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-12-02 00:00:00.000000000 Z
11
+ date: 2019-01-18 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: System Information Gatherer And Reporter
14
14
  email: sigar-users@hyperic.org
@@ -78,9 +78,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
78
78
  version: '0'
79
79
  required_rubygems_version: !ruby/object:Gem::Requirement
80
80
  requirements:
81
- - - ! '>='
81
+ - - ! '>'
82
82
  - !ruby/object:Gem::Version
83
- version: '0'
83
+ version: 1.3.1
84
84
  requirements: []
85
85
  rubyforge_project:
86
86
  rubygems_version: 2.6.6