Code Monkey home page Code Monkey logo

Comments (46)

threez avatar threez commented on July 17, 2024 1

okay, thx for your help. I will prepare then a new release.

from ruby-vmstat.

threez avatar threez commented on July 17, 2024

do you have a proc filesystem in solaris?

from ruby-vmstat.

krzaczek avatar krzaczek commented on July 17, 2024

https://www.joyent.com/blog/smartos-proc-tools

from ruby-vmstat.

threez avatar threez commented on July 17, 2024

It seems that the solaris procfs doesn't contain the required information. Looking at NetBSD's top implementation, it seems a new kernel api (kstat.h) needs to be implemented for that.

from ruby-vmstat.

threez avatar threez commented on July 17, 2024

Could you make a gist or comment that contains the output of top -l 1 -n 0 > probe.txt or probabls it's top -n 0 > probe.txt?

from ruby-vmstat.

krzaczek avatar krzaczek commented on July 17, 2024

There is no top command in solaris.

from ruby-vmstat.

threez avatar threez commented on July 17, 2024

what do you use then?

from ruby-vmstat.

krzaczek avatar krzaczek commented on July 17, 2024

prstat is something similar to top

from ruby-vmstat.

threez avatar threez commented on July 17, 2024

could you provide the output of mpstat 1 1 and vmstat 1 1 as a comment?

from ruby-vmstat.

krzaczek avatar krzaczek commented on July 17, 2024
[root@gitlab ~]# mpstat 1 1
CPU minf mjf xcal  intr ithr  csw icsw migr smtx  srw syscl  usr sys  wt idl
  0 1491   0   14   515  150 2308    2   56  630    0 12926    3   4   0  94
  1 1420   0    8    92   39 2737    1   25  713    0 11246    3   3   0  94
  2  394   0   10    91   32 1076    1   32  432    0  2848    2   2   0  96
  3  469   0    6   400  143 1359    1   24  454    0  3728    2   2   0  96
  4  116   0    5    73   28  613    1   22  228    0  1629    1   1   0  98
  5  133   0    6   150   70  689    1   20  194    0  2298    1   1   0  98
  6   83   0    5   182   58  472    1   22  127    0  1638    1   1   0  98
  7   85   0    5   247  116  704    1   23  109    0  2375    1   1   0  98
  8  111   0    3    70   29  408    1   18  115    0  1745    1   1   0  99
  9  100   0    3   319  248  528    1   20  104    0  1984    1   1   0  98
 10   92   0    4   336  238  461    1   27  111    0  1726    1   1   0  98
 11   78   0    4   241  114  674    1   22   96    0  2268    1   1   0  98
 12  111   0   20   191   85  413    1   20  111    0  1586    1   1   0  99
 13   96   0    3   124   57  499    0   20  102    0  1897    1   1   0  99
 14   94   0    4    94   39  437    1   21  111    0  1581    1   1   0  98
 15   75   0    4   237  112  660    1   22   96    0  2183    1   1   0  98
 16  112   0    2    58   24  419    1   19  118    0  1719    1   1   0  98
 17   95   0    3   414  333  587    1   28  104    0  2035    1   1   0  98
 18   83   0    2    44   17  308    1   17  101    0  1068    1   1   0  99
 19   82   0    5   103   47  416    0   19   95    0  1558    1   1   0  99
 20   49   0    3    76   32  345    1   19   85    0  1138    1   1   0  98
 21   55   0    9   258  122  621    1   22   85    0  2040    1   1   0  98
 22   87   0    2    51   21  348    1   17   99    0  1211    1   1   0  99
 23   87   0    3   110   50  476    1   20   96    0  1749    1   1   0  99
 24   74   0    4    83   35  403    1   19  105    0  1397    1   1   0  98
 25   70   0    4   230  109  655    1   23   96    0  2128    1   1   0  98
 26  102   0    2    51   21  377    1   17  111    0  1487    1   1   0  99
 27   92   0    3   115   53  496    0   20  104    0  1837    1   1   0  99
 28   89   0    3   170   52  432    1   21  119    0  1562    1   1   0  98
 29   74   0    4   237  111  683    1   23  108    0  2207    1   1   0  98
 30  113   0    2    53   21  414    1   19  128    0  1728    1   1   0  99
 31   97   0    4   125   58  550    1   22  126    0  1941    1   1   0  99
[root@gitlab ~]# vmstat 1 1
 kthr      memory            page            disk          faults      cpu
 r b w   swap  free  re  mf pi po fr de sr rm s0 s1 s2   in   sy   cs us sy id
 0 0 36 78644532 23149256 1181 6309 0 0 0 0 12 -20715 -5 148 108 5541 80462 21566 1 1 98

from ruby-vmstat.

threez avatar threez commented on July 17, 2024

I created a new pre release gem, https://github.com/threez/ruby-vmstat/releases/tag/v2.2.0-0
could you test if it works for you?

from ruby-vmstat.

krzaczek avatar krzaczek commented on July 17, 2024

@threez will try it today and let You know

from ruby-vmstat.

krzaczek avatar krzaczek commented on July 17, 2024

Looks like it works

[root@gitlab /tmp]# gem install vmstat-2.2.0.pre.0.gem 
Building native extensions.  This could take a while...
Successfully installed vmstat-2.2.0.pre.0
Parsing documentation for vmstat-2.2.0.pre.0
Installing ri documentation for vmstat-2.2.0.pre.0
Done installing documentation for vmstat after 0 seconds
1 gem installed

from ruby-vmstat.

threez avatar threez commented on July 17, 2024

Looks good, I enhanced the solaris metrics again and created a second pre release. Could you install that too and post the result of the ruby command below? That way I can verify if everything works as expected. If there are any errors, please post them too. If you have any privacy trouble posting the results here, make a private gist and send the link using github to me. Thx

ruby -rvmstat -rpp -e "pp Vmstat.snapshot(['/'])"

from ruby-vmstat.

krzaczek avatar krzaczek commented on July 17, 2024
[root@gitlab /tmp]# ruby -rvmstat -rpp -e "pp Vmstat.snapshot(['/'])"
/opt/local/lib/ruby/2.1.5/rubygems/core_ext/kernel_require.rb:55:in `require': /opt/local/lib/ruby/gems/2.1.5/gems/vmstat-2.2.0.pre.1/lib/vmstat/solaris.rb:9: syntax error, unexpected ']', expecting ')' (SyntaxError)
/opt/local/lib/ruby/gems/2.1.5/gems/vmstat-2.2.0.pre.1/lib/vmstat/solaris.rb:69: syntax error, unexpected end-of-input, expecting keyword_end
        from /opt/local/lib/ruby/2.1.5/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /opt/local/lib/ruby/gems/2.1.5/gems/vmstat-2.2.0.pre.1/lib/vmstat.rb:106:in `<top (required)>'
        from /opt/local/lib/ruby/2.1.5/rubygems/core_ext/kernel_require.rb:135:in `require'
        from /opt/local/lib/ruby/2.1.5/rubygems/core_ext/kernel_require.rb:135:in `rescue in require'
        from /opt/local/lib/ruby/2.1.5/rubygems/core_ext/kernel_require.rb:144:in `require'

from ruby-vmstat.

krzaczek avatar krzaczek commented on July 17, 2024

@threez looks like a ] at the end of line instead )

Cpu.new(num.to_i, user.to_i, sys.to_i, 0, idle.to_i]

from ruby-vmstat.

threez avatar threez commented on July 17, 2024

Right, wrong ] if you replaced it with ) would it then work?

from ruby-vmstat.

krzaczek avatar krzaczek commented on July 17, 2024

nope :(

[root@gitlab ~]# ruby -rvmstat -rpp -e "pp Vmstat.snapshot(['/'])"
/opt/local/lib/ruby/gems/2.1.5/gems/vmstat-2.2.0.pre.1/lib/vmstat/snapshot.rb:26:in `block in initialize': undefined method `disk' for Vmstat:Module (NoMethodError)
        from /opt/local/lib/ruby/gems/2.1.5/gems/vmstat-2.2.0.pre.1/lib/vmstat/snapshot.rb:26:in `map'
        from /opt/local/lib/ruby/gems/2.1.5/gems/vmstat-2.2.0.pre.1/lib/vmstat/snapshot.rb:26:in `initialize'
        from /opt/local/lib/ruby/gems/2.1.5/gems/vmstat-2.2.0.pre.1/lib/vmstat.rb:81:in `new'
        from /opt/local/lib/ruby/gems/2.1.5/gems/vmstat-2.2.0.pre.1/lib/vmstat.rb:81:in `snapshot'
        from -e:1:in `<main>'

from ruby-vmstat.

threez avatar threez commented on July 17, 2024

hmm, seems like there is still a problem with statvfs. man 2 statvfs works for you right?

from ruby-vmstat.

threez avatar threez commented on July 17, 2024

please also try ruby -rvmstat -rpp -e "pp Vmstat.snapshot", that avoids calling statsvfs

from ruby-vmstat.

krzaczek avatar krzaczek commented on July 17, 2024

@threez same error

/opt/local/lib/ruby/gems/2.1.5/gems/vmstat-2.2.0.pre.1/lib/vmstat/snapshot.rb:26:inblock in initialize': undefined method disk' for Vmstat:Module (NoMethodError)

from ruby-vmstat.

krzaczek avatar krzaczek commented on July 17, 2024

Yes man 2 statvfs works ok - loads man file

from ruby-vmstat.

threez avatar threez commented on July 17, 2024

okay a created another pre release, https://github.com/threez/ruby-vmstat/releases/download/v2.2.0-2/vmstat-2.2.0.pre.2.gem, please check again with

ruby -rvmstat -rpp -e "pp Vmstat.snapshot(['/'])"

from ruby-vmstat.

krzaczek avatar krzaczek commented on July 17, 2024

same

/opt/local/lib/ruby/gems/2.1.5/gems/vmstat-2.2.0.pre.2/lib/vmstat/snapshot.rb:26:in `block in initialize': undefined method `disk' for Vmstat:Module (NoMethodError)
        from /opt/local/lib/ruby/gems/2.1.5/gems/vmstat-2.2.0.pre.2/lib/vmstat/snapshot.rb:26:in `map'
        from /opt/local/lib/ruby/gems/2.1.5/gems/vmstat-2.2.0.pre.2/lib/vmstat/snapshot.rb:26:in `initialize'
        from /opt/local/lib/ruby/gems/2.1.5/gems/vmstat-2.2.0.pre.2/lib/vmstat.rb:81:in `new'
        from /opt/local/lib/ruby/gems/2.1.5/gems/vmstat-2.2.0.pre.2/lib/vmstat.rb:81:in `snapshot'
        from -e:1:in `<main>'

from ruby-vmstat.

threez avatar threez commented on July 17, 2024

Can you please try this little program (test.c)? cc -o test test.c && ./test

#include <stdio.h>
#include <sys/types.h>
#include <sys/statvfs.h>
#include <errno.h>


int main (int argc, char const *argv[])
{
  struct statvfs stat;
  if (statvfs("/", &stat) == 0) {
    printf("/ %s %lu %d %d %d\n", stat.f_basetype,
                                  stat.f_bsize,
                                  stat.f_bfree,
                                  stat.f_bavail,
                                  stat.f_blocks);
  } else {
    return errno;
  }
  return 0;
}

from ruby-vmstat.

krzaczek avatar krzaczek commented on July 17, 2024
[root@gitlab /tmp]# cc -o test test.c && ./test
/ zfs 131072 187168110 187168110 240161991

from ruby-vmstat.

threez avatar threez commented on July 17, 2024

that looks good, hope my change will detect statvfs correctly. I created another pre release: https://github.com/threez/ruby-vmstat/releases/download/v2.2.0-3/vmstat-2.2.0.pre.3.gem. Please test

from ruby-vmstat.

krzaczek avatar krzaczek commented on July 17, 2024
[root@gitlab /tmp]# ruby -rvmstat -rpp -e "pp Vmstat.snapshot(['/'])"
mdb: failed to open /dev/ksyms: No such file or directory
/opt/local/lib/ruby/gems/2.1.5/gems/vmstat-2.2.0.pre.3/lib/vmstat/solaris.rb:67:in `block in extract_solaris_mval': undefined method `grep' for "":String (NoMethodError)
        from /opt/local/lib/ruby/gems/2.1.5/gems/vmstat-2.2.0.pre.3/lib/vmstat/solaris.rb:65:in `each'
        from /opt/local/lib/ruby/gems/2.1.5/gems/vmstat-2.2.0.pre.3/lib/vmstat/solaris.rb:65:in `extract_solaris_mval'
        from /opt/local/lib/ruby/gems/2.1.5/gems/vmstat-2.2.0.pre.3/lib/vmstat/solaris.rb:33:in `memory'
        from /opt/local/lib/ruby/gems/2.1.5/gems/vmstat-2.2.0.pre.3/lib/vmstat/snapshot.rb:28:in `initialize'
        from /opt/local/lib/ruby/gems/2.1.5/gems/vmstat-2.2.0.pre.3/lib/vmstat.rb:81:in `new'
        from /opt/local/lib/ruby/gems/2.1.5/gems/vmstat-2.2.0.pre.3/lib/vmstat.rb:81:in `snapshot'
        from -e:1:in `<main>'

from ruby-vmstat.

threez avatar threez commented on July 17, 2024

Okay disk seems to work now. Memory still has a problem. Could you issue echo ::memstat | mdb -k as a user, might be available only as root?

from ruby-vmstat.

krzaczek avatar krzaczek commented on July 17, 2024

hmm ok this works on host server

[root@smartos2 ~]# echo ::memstat | mdb -k
Page Summary                Pages                MB  %Tot
------------     ----------------  ----------------  ----
Kernel                    2115096              8262   17%
ZFS File Data              752887              2940    6%
Anon                      4229677             16522   34%
Exec and libs               11331                44    0%
Page cache                  58501               228    0%
Free (cachelist)           341849              1335    3%
Free (freelist)           5059444             19763   40%

Total                    12568785             49096
Physical                 12568783             49096

but not inside a zone ( solaris vm )

[root@gitlab ~]# echo ::memstat | mdb -k
mdb: failed to open /dev/ksyms: No such file or directory

from ruby-vmstat.

threez avatar threez commented on July 17, 2024

is there another way to get the memory statistics, that you know of?

from ruby-vmstat.

krzaczek avatar krzaczek commented on July 17, 2024
[root@gitlab ~]# kstat -T d -p :::physmem :::pp_kernel zfs:::size :::pagesfree 1 1
Tue Aug  9 16:33:00 CEST 2016
unix:0:system_pages:physmem 12568785
unix:0:system_pages:pp_kernel   2869876
zfs:0:arcstats:size 3438894600
unix:0:system_pages:pagesfree   5338394

from ruby-vmstat.

krzaczek avatar krzaczek commented on July 17, 2024

or

[root@gitlab ~]# lgrpinfo
lgroup 0 (root):
    Children: 1 2
    CPUs: 0-31
    Memory: installed 48G, allocated 28G, free 20G
    Lgroup resources: 1 2 (CPU); 1 2 (memory)
    Latency: 91991
lgroup 1 (leaf):
    Children: none, Parent: 0
    CPUs: 0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30
    Memory: installed 32G, allocated 14G, free 18G
    Lgroup resources: 1 (CPU); 1 (memory)
    Load: 0.0798
    Latency: 64512
lgroup 2 (leaf):
    Children: none, Parent: 0
    CPUs: 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31
    Memory: installed 16G, allocated 14G, free 2.1G
    Lgroup resources: 2 (CPU); 2 (memory)
    Load: 0.108
    Latency: 64512

from ruby-vmstat.

krzaczek avatar krzaczek commented on July 17, 2024

Basicly kstat is always available and should return all information about the current system status

from ruby-vmstat.

threez avatar threez commented on July 17, 2024

Thx, that is very helpful, need to digest that stuff. I try to come up with something until tomorrow.

from ruby-vmstat.

threez avatar threez commented on July 17, 2024

Does dlstat -u Rwork inside the zone or is that also only available on the host?

from ruby-vmstat.

krzaczek avatar krzaczek commented on July 17, 2024

Nope - empty result inside a zone

from ruby-vmstat.

threez avatar threez commented on July 17, 2024

Okay created yet another pre release, all queries against the system status are done using kstat, https://github.com/threez/ruby-vmstat/releases/download/v2.2.0-4/vmstat-2.2.0.pre.4.gem, please test.

from ruby-vmstat.

krzaczek avatar krzaczek commented on July 17, 2024

nope

[root@gitlab /tmp]# ruby -rvmstat -rpp -e "pp Vmstat.snapshot(['/'])"
/opt/local/lib/ruby/gems/2.1.5/gems/vmstat-2.2.0.pre.4/lib/vmstat/solaris.rb:8:in `block in cpu': undefined local variable or method `values' for Vmstat:Module (NameError)
        from /opt/local/lib/ruby/gems/2.1.5/gems/vmstat-2.2.0.pre.4/lib/vmstat/solaris.rb:6:in `each'
        from /opt/local/lib/ruby/gems/2.1.5/gems/vmstat-2.2.0.pre.4/lib/vmstat/solaris.rb:6:in `cpu'
        from /opt/local/lib/ruby/gems/2.1.5/gems/vmstat-2.2.0.pre.4/lib/vmstat/snapshot.rb:25:in `initialize'
        from /opt/local/lib/ruby/gems/2.1.5/gems/vmstat-2.2.0.pre.4/lib/vmstat.rb:81:in `new'
        from /opt/local/lib/ruby/gems/2.1.5/gems/vmstat-2.2.0.pre.4/lib/vmstat.rb:81:in `snapshot'
        from -e:1:in `<main>'

from ruby-vmstat.

krzaczek avatar krzaczek commented on July 17, 2024
[root@gitlab /tmp]# kstat -p "cpu_stat:::/idle|kernel|user/"
cpu_stat:0:cpu_stat0:idle       2325343762
cpu_stat:0:cpu_stat0:idlethread 776439232
cpu_stat:0:cpu_stat0:kernel     89137335
cpu_stat:0:cpu_stat0:kernel_asflt       1
cpu_stat:0:cpu_stat0:user       64919001
cpu_stat:1:cpu_stat1:idle       2322767706
cpu_stat:1:cpu_stat1:idlethread 125993797
cpu_stat:1:cpu_stat1:kernel     78457429
cpu_stat:1:cpu_stat1:kernel_asflt       34
cpu_stat:1:cpu_stat1:user       78174710
cpu_stat:2:cpu_stat2:idle       2390178542
cpu_stat:2:cpu_stat2:idlethread 3368087417
cpu_stat:2:cpu_stat2:kernel     50617796
cpu_stat:2:cpu_stat2:kernel_asflt       0
cpu_stat:2:cpu_stat2:user       38603497
cpu_stat:3:cpu_stat3:idle       2390802861
cpu_stat:3:cpu_stat3:idlethread 1772145290
cpu_stat:3:cpu_stat3:kernel     46044221
cpu_stat:3:cpu_stat3:kernel_asflt       0
cpu_stat:3:cpu_stat3:user       42552751
cpu_stat:4:cpu_stat4:idle       2436590263
cpu_stat:4:cpu_stat4:idlethread 2145015281
cpu_stat:4:cpu_stat4:kernel     23983506
cpu_stat:4:cpu_stat4:kernel_asflt       0
cpu_stat:4:cpu_stat4:user       18826062
cpu_stat:5:cpu_stat5:idle       2435969240
cpu_stat:5:cpu_stat5:idlethread 3720145695
cpu_stat:5:cpu_stat5:kernel     25630307
cpu_stat:5:cpu_stat5:kernel_asflt       0
cpu_stat:5:cpu_stat5:user       17800281
cpu_stat:6:cpu_stat6:idle       2432659504
cpu_stat:6:cpu_stat6:idlethread 3012624014
cpu_stat:6:cpu_stat6:kernel     24414413
cpu_stat:6:cpu_stat6:kernel_asflt       0
cpu_stat:6:cpu_stat6:user       22325909
cpu_stat:7:cpu_stat7:idle       2430409364
cpu_stat:7:cpu_stat7:idlethread 1931519381
cpu_stat:7:cpu_stat7:kernel     28094309
cpu_stat:7:cpu_stat7:kernel_asflt       0
cpu_stat:7:cpu_stat7:user       20896150
cpu_stat:8:cpu_stat8:idle       2443187236
cpu_stat:8:cpu_stat8:idlethread 1900014542
cpu_stat:8:cpu_stat8:kernel     20799721
cpu_stat:8:cpu_stat8:kernel_asflt       0
cpu_stat:8:cpu_stat8:user       15412864
cpu_stat:9:cpu_stat9:idle       2440596009
cpu_stat:9:cpu_stat9:idlethread 3703869451
cpu_stat:9:cpu_stat9:kernel     23787482
cpu_stat:9:cpu_stat9:kernel_asflt       0
cpu_stat:9:cpu_stat9:user       15016328
cpu_stat:10:cpu_stat10:idle     2427567910
cpu_stat:10:cpu_stat10:idlethread       3191481058
cpu_stat:10:cpu_stat10:kernel   30059932
cpu_stat:10:cpu_stat10:kernel_asflt     5
cpu_stat:10:cpu_stat10:user     21771975
cpu_stat:11:cpu_stat11:idle     2431827979
cpu_stat:11:cpu_stat11:idlethread       1824361353
cpu_stat:11:cpu_stat11:kernel   27388335
cpu_stat:11:cpu_stat11:kernel_asflt     0
cpu_stat:11:cpu_stat11:user     20183500
cpu_stat:12:cpu_stat12:idle     2442824569
cpu_stat:12:cpu_stat12:idlethread       2037054756
cpu_stat:12:cpu_stat12:kernel   21276397
cpu_stat:12:cpu_stat12:kernel_asflt     0
cpu_stat:12:cpu_stat12:user     15298846
cpu_stat:13:cpu_stat13:idle     2443388458
cpu_stat:13:cpu_stat13:idlethread       3442886390
cpu_stat:13:cpu_stat13:kernel   22081759
cpu_stat:13:cpu_stat13:kernel_asflt     0
cpu_stat:13:cpu_stat13:user     13929592
cpu_stat:14:cpu_stat14:idle     2434768696
cpu_stat:14:cpu_stat14:idlethread       2856867656
cpu_stat:14:cpu_stat14:kernel   23352419
cpu_stat:14:cpu_stat14:kernel_asflt     0
cpu_stat:14:cpu_stat14:user     21278693
cpu_stat:15:cpu_stat15:idle     2432514522
cpu_stat:15:cpu_stat15:idlethread       1703823954
cpu_stat:15:cpu_stat15:kernel   27050642
cpu_stat:15:cpu_stat15:kernel_asflt     16
cpu_stat:15:cpu_stat15:user     19834642
cpu_stat:16:cpu_stat16:idle     2436582325
cpu_stat:16:cpu_stat16:idlethread       1983802071
cpu_stat:16:cpu_stat16:kernel   21833225
cpu_stat:16:cpu_stat16:kernel_asflt     0
cpu_stat:16:cpu_stat16:user     20984253
cpu_stat:17:cpu_stat17:idle     2432250902
cpu_stat:17:cpu_stat17:idlethread       307297399
cpu_stat:17:cpu_stat17:kernel   29580663
cpu_stat:17:cpu_stat17:kernel_asflt     0
cpu_stat:17:cpu_stat17:user     17568236
cpu_stat:18:cpu_stat18:idle     2447310538
cpu_stat:18:cpu_stat18:idlethread       1473510287
cpu_stat:18:cpu_stat18:kernel   18480841
cpu_stat:18:cpu_stat18:kernel_asflt     5
cpu_stat:18:cpu_stat18:user     13608419
cpu_stat:19:cpu_stat19:idle     2446462748
cpu_stat:19:cpu_stat19:idlethread       2882237650
cpu_stat:19:cpu_stat19:kernel   20384068
cpu_stat:19:cpu_stat19:kernel_asflt     0
cpu_stat:19:cpu_stat19:user     12552980
cpu_stat:20:cpu_stat20:idle     2439710143
cpu_stat:20:cpu_stat20:idlethread       2513415319
cpu_stat:20:cpu_stat20:kernel   20976077
cpu_stat:20:cpu_stat20:kernel_asflt     0
cpu_stat:20:cpu_stat20:user     18713575
cpu_stat:21:cpu_stat21:idle     2434565830
cpu_stat:21:cpu_stat21:idlethread       1574993351
cpu_stat:21:cpu_stat21:kernel   26063716
cpu_stat:21:cpu_stat21:kernel_asflt     0
cpu_stat:21:cpu_stat21:user     18770245
cpu_stat:22:cpu_stat22:idle     2447896586
cpu_stat:22:cpu_stat22:idlethread       1566290884
cpu_stat:22:cpu_stat22:kernel   18718466
cpu_stat:22:cpu_stat22:kernel_asflt     0
cpu_stat:22:cpu_stat22:user     12784738
cpu_stat:23:cpu_stat23:idle     2444823222
cpu_stat:23:cpu_stat23:idlethread       3286395080
cpu_stat:23:cpu_stat23:kernel   21510594
cpu_stat:23:cpu_stat23:kernel_asflt     0
cpu_stat:23:cpu_stat23:user     13065972
cpu_stat:24:cpu_stat24:idle     2437316848
cpu_stat:24:cpu_stat24:idlethread       2628739060
cpu_stat:24:cpu_stat24:kernel   22266295
cpu_stat:24:cpu_stat24:kernel_asflt     0
cpu_stat:24:cpu_stat24:user     19816643
cpu_stat:25:cpu_stat25:idle     2433451000
cpu_stat:25:cpu_stat25:idlethread       1604646150
cpu_stat:25:cpu_stat25:kernel   26748441
cpu_stat:25:cpu_stat25:kernel_asflt     0
cpu_stat:25:cpu_stat25:user     19200341
cpu_stat:26:cpu_stat26:idle     2446405472
cpu_stat:26:cpu_stat26:idlethread       1573139378
cpu_stat:26:cpu_stat26:kernel   19619834
cpu_stat:26:cpu_stat26:kernel_asflt     0
cpu_stat:26:cpu_stat26:user     13374474
cpu_stat:27:cpu_stat27:idle     2444019515
cpu_stat:27:cpu_stat27:idlethread       3275705315
cpu_stat:27:cpu_stat27:kernel   21816225
cpu_stat:27:cpu_stat27:kernel_asflt     0
cpu_stat:27:cpu_stat27:user     13564039
cpu_stat:28:cpu_stat28:idle     2435784523
cpu_stat:28:cpu_stat28:idlethread       2628201319
cpu_stat:28:cpu_stat28:kernel   23125551
cpu_stat:28:cpu_stat28:kernel_asflt     0
cpu_stat:28:cpu_stat28:user     20489701
cpu_stat:29:cpu_stat29:idle     2432230501
cpu_stat:29:cpu_stat29:idlethread       1635408506
cpu_stat:29:cpu_stat29:kernel   27198273
cpu_stat:29:cpu_stat29:kernel_asflt     0
cpu_stat:29:cpu_stat29:user     19970999
cpu_stat:30:cpu_stat30:idle     2444413183
cpu_stat:30:cpu_stat30:idlethread       1644573224
cpu_stat:30:cpu_stat30:kernel   20310412
cpu_stat:30:cpu_stat30:kernel_asflt     0
cpu_stat:30:cpu_stat30:user     14676176
cpu_stat:31:cpu_stat31:idle     2442483106
cpu_stat:31:cpu_stat31:idlethread       3345414215
cpu_stat:31:cpu_stat31:kernel   22515695
cpu_stat:31:cpu_stat31:kernel_asflt     0
cpu_stat:31:cpu_stat31:user     14400967

from ruby-vmstat.

threez avatar threez commented on July 17, 2024

Thx, I created a test for the solaris module and build a new pre release: https://github.com/threez/ruby-vmstat/releases/download/v2.2.0-5/vmstat-2.2.0.pre.5.gem

from ruby-vmstat.

krzaczek avatar krzaczek commented on July 17, 2024
/opt/local/lib/ruby/gems/2.1.5/gems/vmstat-2.2.0.pre.5/lib/vmstat/solaris.rb:35:in `memory': undefined local variable or method `pagesize' for Vmstat::Solaris:Module (NameError)
        from /opt/local/lib/ruby/gems/2.1.5/gems/vmstat-2.2.0.pre.5/lib/vmstat/solaris.rb:70:in `memory'
        from /opt/local/lib/ruby/gems/2.1.5/gems/vmstat-2.2.0.pre.5/lib/vmstat/snapshot.rb:28:in `initialize'
        from /opt/local/lib/ruby/gems/2.1.5/gems/vmstat-2.2.0.pre.5/lib/vmstat.rb:82:in `new'
        from /opt/local/lib/ruby/gems/2.1.5/gems/vmstat-2.2.0.pre.5/lib/vmstat.rb:82:in `snapshot'
        from -e:1:in `<main>'

from ruby-vmstat.

threez avatar threez commented on July 17, 2024

Does this work? ruby -rvmstat -e 'p Vmstat.pagesize'

from ruby-vmstat.

krzaczek avatar krzaczek commented on July 17, 2024

Yes

[root@gitlab ~]# ruby -rvmstat -e 'p Vmstat.pagesize'
4096

from ruby-vmstat.

threez avatar threez commented on July 17, 2024

Okay, think it's fixed. https://github.com/threez/ruby-vmstat/releases/download/v2.2.0-6/vmstat-2.2.0.pre.6.gem. Debugging/testing remotely is really fun :-)

from ruby-vmstat.

krzaczek avatar krzaczek commented on July 17, 2024

Works

[root@gitlab /tmp]# ruby -rvmstat -rpp -e "pp Vmstat.snapshot(['/'])"
#<Vmstat::Snapshot:0x00000000c76bb8
 @at=2016-08-10 20:50:18 +0200,
 @boot_time=2016-08-03 20:50:51 +0200,
 @cpus=
  [#<struct Vmstat::Cpu
    num=0,
    user=64973989,
    system=89226830,
    nice=0,
    idle=2328234987>,
   #<struct Vmstat::Cpu
    num=1,
    user=78274183,
    system=78562105,
    nice=0,
    idle=2325599266>,
   #<struct Vmstat::Cpu
    num=2,
    user=38633736,
    system=50669851,
    nice=0,
    idle=2393131956>,
   #<struct Vmstat::Cpu
    num=3,
    user=42593601,
    system=46096625,
    nice=0,
    idle=2393745315>,
   #<struct Vmstat::Cpu
    num=4,
    user=18840731,
    system=24009558,
    nice=0,
    idle=2439585250>,
   #<struct Vmstat::Cpu
    num=5,
    user=17816227,
    system=25658051,
    nice=0,
    idle=2438961258>,
   #<struct Vmstat::Cpu
    num=6,
    user=22344067,
    system=24442161,
    nice=0,
    idle=2435649306>,
   #<struct Vmstat::Cpu
    num=7,
    user=20915384,
    system=28124997,
    nice=0,
    idle=2433395151>,
   #<struct Vmstat::Cpu
    num=8,
    user=15426568,
    system=20824214,
    nice=0,
    idle=2446184747>,
   #<struct Vmstat::Cpu
    num=9,
    user=15029879,
    system=23813787,
    nice=0,
    idle=2443591861>,
   #<struct Vmstat::Cpu
    num=10,
    user=21789968,
    system=30093730,
    nice=0,
    idle=2430551827>,
   #<struct Vmstat::Cpu
    num=11,
    user=20201769,
    system=27418499,
    nice=0,
    idle=2434815254>,
   #<struct Vmstat::Cpu
    num=12,
    user=15312979,
    system=21302587,
    nice=0,
    idle=2445819955>,
   #<struct Vmstat::Cpu
    num=13,
    user=13942451,
    system=22106133,
    nice=0,
    idle=2446386934>,
   #<struct Vmstat::Cpu
    num=14,
    user=21296732,
    system=23379847,
    nice=0,
    idle=2437758937>,
   #<struct Vmstat::Cpu
    num=15,
    user=19853222,
    system=27080895,
    nice=0,
    idle=2435501397>,
   #<struct Vmstat::Cpu
    num=16,
    user=21003876,
    system=21859342,
    nice=0,
    idle=2439572293>,
   #<struct Vmstat::Cpu
    num=17,
    user=17583386,
    system=29611795,
    nice=0,
    idle=2435240328>,
   #<struct Vmstat::Cpu
    num=18,
    user=13620439,
    system=18502249,
    nice=0,
    idle=2450312819>,
   #<struct Vmstat::Cpu
    num=19,
    user=12564153,
    system=20406347,
    nice=0,
    idle=2449465005>,
   #<struct Vmstat::Cpu
    num=20,
    user=18729363,
    system=20999703,
    nice=0,
    idle=2442706436>,
   #<struct Vmstat::Cpu
    num=21,
    user=18787055,
    system=26092352,
    nice=0,
    idle=2437556093>,
   #<struct Vmstat::Cpu
    num=22,
    user=12796399,
    system=18740784,
    nice=0,
    idle=2450898315>,
   #<struct Vmstat::Cpu
    num=23,
    user=13077860,
    system=21534613,
    nice=0,
    idle=2447823023>,
   #<struct Vmstat::Cpu
    num=24,
    user=19833602,
    system=22291988,
    nice=0,
    idle=2440309903>,
   #<struct Vmstat::Cpu
    num=25,
    user=19217789,
    system=26778166,
    nice=0,
    idle=2436439536>,
   #<struct Vmstat::Cpu
    num=26,
    user=13387146,
    system=19643532,
    nice=0,
    idle=2449404811>,
   #<struct Vmstat::Cpu
    num=27,
    user=13576456,
    system=21840667,
    nice=0,
    idle=2447018363>,
   #<struct Vmstat::Cpu
    num=28,
    user=20506881,
    system=23152337,
    nice=0,
    idle=2438776266>,
   #<struct Vmstat::Cpu
    num=29,
    user=19989557,
    system=27228336,
    nice=0,
    idle=2435217589>,
   #<struct Vmstat::Cpu
    num=30,
    user=14689616,
    system=20334412,
    nice=0,
    idle=2447411451>,
   #<struct Vmstat::Cpu
    num=31,
    user=14414367,
    system=22541226,
    nice=0,
    idle=2445479884>],
 @disks=
  [#<struct Vmstat::LinuxDisk
    type=nil,
    origin="/",
    mount="/",
    block_size=131072,
    free_blocks=181855047,
    available_blocks=181855047,
    total_blocks=234681456>],
 @load_average=
  #<struct Vmstat::LoadAverage
   one_minute=0.08984375,
   five_minutes=0.03515625,
   fifteen_minutes=0.0234375>,
 @memory=
  #<struct Vmstat::Memory
   pagesize=4096,
   wired=4994291,
   active=2257869,
   inactive=0,
   free=5316623,
   pageins=0,
   pageouts=0>,
 @network_interfaces=
  [#<struct Vmstat::NetworkInterface
    name=:net0,
    in_bytes=4613406330,
    in_errors=0,
    in_drops=0,
    out_bytes=26563972625,
    out_errors=0,
    type=6>]>

from ruby-vmstat.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.