perfmonger 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. checksums.yaml +15 -0
  2. data/.dir-locals.el +2 -0
  3. data/.gitignore +4 -0
  4. data/.rspec +1 -0
  5. data/.travis.yml +12 -0
  6. data/COPYING +674 -0
  7. data/Gemfile +5 -0
  8. data/HOWTO.md +15 -0
  9. data/NEWS +115 -0
  10. data/README.md +61 -0
  11. data/Rakefile +8 -0
  12. data/bin/perfmonger +6 -0
  13. data/data/NOTICE +8 -0
  14. data/data/Twitter_Bootstrap_LICENSE.txt +176 -0
  15. data/data/assets/css/bootstrap-responsive.css +1109 -0
  16. data/data/assets/css/bootstrap.css +6167 -0
  17. data/data/assets/css/perfmonger.css +17 -0
  18. data/data/assets/dashboard.erb +319 -0
  19. data/data/assets/img/glyphicons-halflings-white.png +0 -0
  20. data/data/assets/img/glyphicons-halflings.png +0 -0
  21. data/data/assets/js/bootstrap.js +2280 -0
  22. data/data/assets/js/bootstrap.min.js +6 -0
  23. data/data/assets/js/canvasjs.js +9042 -0
  24. data/data/assets/js/canvasjs.min.js +271 -0
  25. data/data/sysstat.ioconf +268 -0
  26. data/ext/perfmonger/extconf.rb +19 -0
  27. data/ext/perfmonger/perfmonger.h +58 -0
  28. data/ext/perfmonger/perfmonger_record.c +754 -0
  29. data/ext/perfmonger/sysstat/common.c +627 -0
  30. data/ext/perfmonger/sysstat/common.h +207 -0
  31. data/ext/perfmonger/sysstat/ioconf.c +515 -0
  32. data/ext/perfmonger/sysstat/ioconf.h +84 -0
  33. data/ext/perfmonger/sysstat/iostat.c +1100 -0
  34. data/ext/perfmonger/sysstat/iostat.h +121 -0
  35. data/ext/perfmonger/sysstat/libsysstat.h +19 -0
  36. data/ext/perfmonger/sysstat/mpstat.c +953 -0
  37. data/ext/perfmonger/sysstat/mpstat.h +79 -0
  38. data/ext/perfmonger/sysstat/rd_stats.c +2388 -0
  39. data/ext/perfmonger/sysstat/rd_stats.h +651 -0
  40. data/ext/perfmonger/sysstat/sysconfig.h +13 -0
  41. data/lib/perfmonger/cli.rb +115 -0
  42. data/lib/perfmonger/command/base_command.rb +39 -0
  43. data/lib/perfmonger/command/fingerprint.rb +453 -0
  44. data/lib/perfmonger/command/plot.rb +429 -0
  45. data/lib/perfmonger/command/record.rb +32 -0
  46. data/lib/perfmonger/command/record_option.rb +149 -0
  47. data/lib/perfmonger/command/server.rb +294 -0
  48. data/lib/perfmonger/command/stat.rb +60 -0
  49. data/lib/perfmonger/command/stat_option.rb +29 -0
  50. data/lib/perfmonger/command/summary.rb +402 -0
  51. data/lib/perfmonger/config.rb +6 -0
  52. data/lib/perfmonger/version.rb +5 -0
  53. data/lib/perfmonger.rb +12 -0
  54. data/misc/release-howto.txt +17 -0
  55. data/misc/sample-cpu.png +0 -0
  56. data/misc/sample-read-iops.png +0 -0
  57. data/perfmonger.gemspec +44 -0
  58. data/test/run-test.sh +39 -0
  59. data/test/spec/bin_spec.rb +37 -0
  60. data/test/spec/data/2devices.expected +42 -0
  61. data/test/spec/data/2devices.output +42 -0
  62. data/test/spec/spec_helper.rb +20 -0
  63. data/test/spec/summary_spec.rb +193 -0
  64. data/test/test-perfmonger.c +145 -0
  65. data/test/test.h +9 -0
  66. metadata +154 -0
@@ -0,0 +1,268 @@
1
+ #
2
+ # sysstat.ioconf
3
+ #
4
+ # Copyright (C) 2004, Red Hat, Inc.
5
+ #
6
+ # Maintained by Sebastien Godard (sysstat [at] orange.fr)
7
+ #
8
+ # This file gives iostat and sadc a clue about how to find whole
9
+ # disk devices in /proc/partitions and /proc/diskstats
10
+ # Authoritative source is: linux/Documentation/devices.txt
11
+ #
12
+ # line format, general record:
13
+ # major:name:ctrlpre:ctrlno:devfmt:devcnt:partpre:partcnt:description
14
+ #
15
+ # major: major # for device
16
+ # name: base of device name
17
+ # ctrlpre: string to use in generating controller designators
18
+ # eg: the c in c0d2p6, decimal formatting implied
19
+ # '*' means none or irrelevant
20
+ # ctrlno: which controller of this type is this
21
+ # devfmt: type of device naming convention
22
+ # a: alpha: xxa, xxb, ... xxaa, xxab, ... xxzz
23
+ # x: exception... record contains a specific name
24
+ # for a specific minor #, stored in the devcnt field
25
+ # %string: string to use in generating drive designators,
26
+ # eg: the 'd' in c0d2p6 , decimal formatting implied
27
+ # d: no special translations (decimal formatting)
28
+ # devcnt: how many whole devs per major number
29
+ # partpre: appended to whole dev before part designator
30
+ # eg. the p in c0d2p6, decimal formatting implied
31
+ # '*' means none
32
+ # partcnt: number of partitions per volume
33
+ # or minor # for exception records
34
+ # description: informative text
35
+ #
36
+ # line format, indirect record:
37
+ # major:base_major:ctrlno[:[desc]]
38
+ #
39
+ # major: major number of the device
40
+ # base_major: major number of the template for this type,
41
+ # 0 for not supported
42
+ # ctrlno: controller number of this type
43
+ # desc: controller-specific description
44
+ # if absent the desc from base_major will be
45
+ # used in sprintf( buf, desc, ctrlno )
46
+
47
+
48
+ 1:ram:*:0:d:256:*:1:RAM disks (ram0..ram255)
49
+ 1:initrd:x:250:d:256:*:1:Initial RAM Disk (initrd)
50
+
51
+ #2:0:0:Floppy Devices
52
+ 2:fd:*:0:d:4:*:1:Floppy Devices fd0,fd1,fd2,fd3
53
+
54
+ 3:hd:*:0:a:2:*:64:IDE - Controller %d
55
+ 22:3:1:
56
+ 33:3:2:
57
+ 34:3:3:
58
+ 56:3:4:
59
+ 57:3:5:
60
+ 88:3:6:
61
+ 89:3:7:
62
+ 90:3:8:
63
+ 91:3:9:
64
+
65
+ #4:0:0:NODEV
66
+ #5:0:0:NODEV
67
+ #6:0:0:NODEV
68
+ 7:loop:*:0:d:256:*:1:Loop Devices
69
+
70
+ 8:sd:*:0:a:16:*:16:SCSI - Controller %d
71
+ 65:8:1:
72
+ 66:8:2:
73
+ 67:8:3:
74
+ 68:8:4:
75
+ 69:8:5:
76
+ 70:8:6:
77
+ 71:8:7:
78
+ 128:8:8:
79
+ 129:8:9:
80
+ 130:8:10:
81
+ 131:8:11:
82
+ 132:8:12:
83
+ 133:8:13:
84
+ 134:8:14:
85
+ 135:8:15:
86
+
87
+ 9:md:*:0:d:256:*:1:Metadisk (Software RAID) devices (md0..md255)
88
+
89
+ #10:0:0:NODEV
90
+
91
+ #11:sr:*:0:d:256:*:1:CDROM - CDROM (sr0..sr255) (deprecated)
92
+ 11:scd:*:0:d:256:*:1:CDROM - CDROM (scd0..scd255)
93
+
94
+ #12:0:0:MSCDEX CD-ROM Callback
95
+
96
+ 13:xd:*:0:a:2:*:64:8-bit MFM/RLL/IDE controller (xda, xdb)
97
+
98
+ #14:0:0:BIOS Hard Drive Callback
99
+ #15:0:0:CDROM - Sony CDU-31A/CDU-33A
100
+ #16:0:0:CDROM - Goldstar
101
+ #17:0:0:CDROM - Optics Storage
102
+ #18:0:0:CDROM - Sanyo
103
+
104
+ 19:double:*:0:d:256:*:1:Compressed Disk (double0..double255)
105
+
106
+ #20:0:0:CDROM - Hitachi
107
+
108
+ 21:mfm:*:0:a:2:*:64:Acorn MFM Hard Drive (mfma, mfmb)
109
+
110
+ # 22: see IDE, dev 3
111
+
112
+ #23:0:0:CDROM - Mistumi Proprietary
113
+ #24:0:0:CDROM - Sony CDU-535
114
+ #25:0:0:CDROM - Matsushita (Panasonic/Soundblaster) #1
115
+ #26:0:1:CDROM - Matsushita (Panasonic/Soundblaster) #2
116
+ #27:0:2:CDROM - Matsushita (Panasonic/Soundblaster) #3
117
+ #28:0:3:CDROM - Matsushita (Panasonic/Soundblaster) #4
118
+ # 28:0:0:! ACSI (Atari) Disk Not Supported
119
+ #29:0:0:CDROM - Aztech/Orchid/Okano/Wearnes
120
+ #30:0:0:CDROM - Philips LMS CM-205
121
+ #31:0:0:ROM/flash Memory Card
122
+ #32:0:0:CDROM - Phillips LMS CM-206
123
+
124
+ # 33: See IDE, dev 3
125
+ # 34: See IDE, dev 3
126
+
127
+ #35:0:0:Slow Memory RAM Disk
128
+
129
+ 36:ed:*:0:a:2:*:64:MCA ESDI Hard Disk (eda, edb)
130
+
131
+ #37:0:0:Zorro II Ram Disk
132
+ #38:0:0:Reserved For Linux/AP+
133
+ #39:0:0:Reserved For Linux/AP+
134
+ #40:0:0:Syquest EZ135 Parallel Port Drive
135
+ #41:0:0:CDROM - MicroSolutions Parallel Port BackPack
136
+ #42:0:0:For DEMO Use Only
137
+
138
+ 43:nb:*:0:d:256:*:1:Network Block devices (nb0..nb255)
139
+ 44:ftl:*:0:a:16:*:16:Flash Translation Layer (ftla..ftlp)
140
+ 45:pd:*:0:a:4:*:16:Parallel Port IDE (pda..pdd)
141
+
142
+ #46:0:0:CDROM - Parallel Port ATAPI
143
+
144
+ 47:pf:*:0:d:256:*:1:Parallel Port ATAPI Disk Devices (pf0..pf255)
145
+
146
+ 48:rd:/c:0:%d:32:p:8:Mylex DAC960 RAID, Controller %d
147
+ 49:48:1:
148
+ 50:48:2:
149
+ 51:48:3:
150
+ 52:48:4:
151
+ 53:48:5:
152
+ 54:48:6:
153
+ 55:48:7:
154
+ 136:48:8:
155
+ 137:48:9:
156
+ 138:48:10:
157
+ 139:48:11:
158
+ 140:48:12:
159
+ 141:48:13:
160
+ 142:48:14:
161
+ 143:48:15:
162
+
163
+ # 56, 57: see IDE, dev 3:
164
+
165
+ 58:lvm:*:0:d:256:*:1:Logical Volume Manager (lvm0..lvm255)
166
+
167
+ #59:0:0:PDA Filesystem Device
168
+ #60:0:0:Local/Experimental Use
169
+ #61:0:0:Local/Experimental Use
170
+ #62:0:0:Local/Experimental Use
171
+ #63:0:0:Local/Experimental Use
172
+ #64:0:0:NODEV
173
+
174
+ # 65..71: See SCSI, dev 8:
175
+
176
+ 72:ida/:c:0:%d:16:p:16:Compaq Intelligent Drive Array - Controller %d
177
+ 73:72:1:
178
+ 74:72:2:
179
+ 75:72:3:
180
+ 76:72:4:
181
+ 77:72:5:
182
+ 78:72:6:
183
+ 79:72:7:
184
+
185
+ 80:i2o/hd:*:0:a:16:*:16:I2O Disk - Controller %d
186
+ 81:80:1:
187
+ 82:80:2:
188
+ 83:80:3:
189
+ 84:80:4:
190
+ 85:80:5:
191
+ 86:80:6:
192
+ 87:80:7:
193
+
194
+ # 88..91: see IDE, dev 3:
195
+
196
+ #92:0:0:PPDD Encrypted Disk
197
+ #93:0:0:NAND Flash Translation Layer not supported
198
+
199
+ 94:dasd:*:0:a:64:*:4:IBM S/390 DASD Block Storage (dasda, dasdb, ...)
200
+
201
+ #95:0:0:IBM S/390 VM/ESA Minidisk
202
+ #96:0:0:NODEV
203
+ #97:0:0:CD/DVD packed writing devices not supported
204
+
205
+ 98:ubd:*:0:d:256:*:1:User-mode Virtual Block Devices (ubd0..ubd256)
206
+
207
+ #99:0:0:JavaStation Flash Disk
208
+ #100:0:0:NODEV
209
+
210
+ 101:amiraid/ar:*:0:d:16:p:16:AMI HyperDisk RAID (amiraid/ar0 - amiraid/ar15)
211
+
212
+ #102:0:0:Compressed Block Device
213
+ #103:0:0:Audit Block Device
214
+
215
+ 104:cciss:/c:0:%d:16:p:16:HP SA 5xxx/6xxx (cciss) Controller %d
216
+ 105:104:1:
217
+ 106:104:2:
218
+ 107:104:3:
219
+ 108:104:4:
220
+ 109:104:5:
221
+ 110:104:6:
222
+ 111:104:7:
223
+
224
+ 112:iseries/vd:*:0:a:32:*:8:IBM iSeries Virtual Disk (.../vda - .../vdaf)
225
+
226
+ #113:0:0:CDROM - IBM iSeries Virtual
227
+
228
+ # 114..159 NODEV
229
+
230
+ 120:emcpower:*:0:a:16:*:16:EMC PowerPath Unit %d
231
+
232
+ #160:sx8/:*:0:d:8:p:32:Promise SATA SX8 Unit %d
233
+ #161:160:1:
234
+ 160:carmel/:*:0:d:8:p:32:Carmel 8-port SATA Disks (carmel/0 - carmel/7)
235
+ 161:160:1:
236
+
237
+ # 162..198 UNUSED
238
+
239
+ 180:ub:*:0:a:32:p:8:USB block devices
240
+
241
+ #199:0:0:Veritas Volume Manager (VxVM) Volumes
242
+ #200:0:0:NODEV
243
+ #201:0:0:Veritas VxVM Dynamic Multipathing Driver
244
+
245
+ 202:xvd:*:0:a:16:p:16:Xen Virtual Block Device
246
+
247
+ # 203..230: UNUSED
248
+
249
+ 232:emcpower:*:0:a:16:*:16:EMC PowerPath Unit %d
250
+ 233:232:1:
251
+ 234:232:2:
252
+ 235:232:3:
253
+ 236:232:4:
254
+ 237:232:5:
255
+ 238:232:6:
256
+ 239:232:7:
257
+ 240:232:8:
258
+ 241:232:9:
259
+ 242:232:10:
260
+ 243:232:11:
261
+ 244:232:12:
262
+ 245:232:13:
263
+ 246:232:14:
264
+ 247:232:15:
265
+
266
+ # 240..254: LOCAL/Experimental
267
+ # 255: reserved for big dev_t expansion
268
+
@@ -0,0 +1,19 @@
1
+ #!/usr/bin/env ruby
2
+ # coding: utf-8
3
+
4
+ require 'mkmf'
5
+
6
+ $objs = ["perfmonger_record.o", "sysstat/common.o", "sysstat/ioconf.o", "sysstat/iostat.o", "sysstat/mpstat.o", "sysstat/rd_stats.o"]
7
+
8
+ $cleanfiles += ["perfmonger_record.o", "sysstat/common.o", "sysstat/ioconf.o", "sysstat/iostat.o", "sysstat/mpstat.o", "sysstat/rd_stats.o"]
9
+
10
+ create_makefile 'perfmonger/perfmonger_record'
11
+
12
+ mk = open('Makefile').read
13
+
14
+ mk.gsub!(/^LDSHARED = .*$/, "LDSHARED = $(CC)")
15
+ mk.gsub!(/^DLLIB = .*$/, "DLLIB = $(TARGET)")
16
+
17
+ open('Makefile', 'w') do |f|
18
+ f.write(mk)
19
+ end
@@ -0,0 +1,58 @@
1
+ /* -*- indent-tabs-mode: nil -*- */
2
+
3
+ #ifndef PERFMONGER_H
4
+ #define PERFMONGER_H
5
+
6
+ #include <unistd.h>
7
+ #include <stdio.h>
8
+ #include <stdlib.h>
9
+ #include <stdarg.h>
10
+ #include <string.h>
11
+ #include <math.h>
12
+ #include <ctype.h>
13
+ #include <limits.h>
14
+ #include <stdbool.h>
15
+ #include <pthread.h>
16
+ #include <sys/socket.h>
17
+ #include <netinet/in.h>
18
+ #include <arpa/inet.h>
19
+ #include <sys/time.h>
20
+ #include <signal.h>
21
+
22
+ #include "sysstat/libsysstat.h"
23
+
24
+
25
+ typedef struct {
26
+ // switches
27
+ bool report_cpu;
28
+ bool report_io;
29
+ bool report_ctxsw;
30
+
31
+ // device nr and list
32
+ int nr_dev;
33
+ char **dev_list;
34
+ bool all_devices;
35
+
36
+ // OUTPUT FILE
37
+ FILE *output;
38
+
39
+ // data collection interval
40
+ double interval;
41
+ bool interval_backoff;
42
+
43
+ double start_delay;
44
+
45
+ double timeout;
46
+
47
+ bool verbose;
48
+ } option_t;
49
+
50
+ int parse_args(int argc, char **argv, option_t *opt);
51
+ void print_help(void);
52
+ void init_subsystem(option_t *opt);
53
+ void destroy_subsystem(option_t *opt);
54
+
55
+ void collector_loop(option_t *opt);
56
+ void output_stat(option_t *opt, int curr);
57
+
58
+ #endif