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,84 @@
1
+ /*
2
+ * ioconf: ioconf configuration file handling code
3
+ * Original code (C) 2004 by Red Hat (Charlie Bennett <ccb@redhat.com>)
4
+ *
5
+ * Modified and maintained by Sebastien GODARD (sysstat <at> orange.fr)
6
+ */
7
+
8
+ #ifndef _IOCONF_H
9
+ #define _IOCONF_H
10
+
11
+ #include "sysconfig.h"
12
+
13
+ #define IOC_NAMELEN 31
14
+ #define IOC_DESCLEN 63
15
+ #define IOC_DEVLEN 47
16
+ #define IOC_MAXMINOR 2047
17
+ #define IOC_LINESIZ 255
18
+ #define IOC_PARTLEN 7
19
+ #define IOC_FMTLEN 15
20
+
21
+ #ifndef MAX_BLKDEV
22
+ #define MAX_BLKDEV 255
23
+ #endif
24
+
25
+ #define K_NODEV "nodev"
26
+
27
+ #define IS_WHOLE(maj,min) ((min % ioconf[maj]->blkp->pcount) == 0)
28
+
29
+ /*
30
+ * When is C going to get templates?
31
+ */
32
+ #define IOC_ALLOC(P,TYPE,SIZE) \
33
+ do { \
34
+ if (P == NULL) { \
35
+ P = (TYPE *) malloc(SIZE); \
36
+ if (P == NULL) { \
37
+ perror("malloc"); \
38
+ ioc_free(); \
39
+ return 0; \
40
+ } \
41
+ } \
42
+ } \
43
+ while (0)
44
+ /* That dummy while allows ';' on the line that invokes the macro... */
45
+
46
+
47
+ struct blk_config {
48
+ char name[IOC_NAMELEN + 1]; /* device basename */
49
+ char cfmt[IOC_FMTLEN + 1]; /* controller format string */
50
+ char dfmt[IOC_FMTLEN + 1]; /* disk format string */
51
+ char pfmt[IOC_FMTLEN + 1]; /* partition format string */
52
+ /* ctrlno is in the ioc_entry */
53
+ unsigned int ctrl_explicit; /* use "cN" in name */
54
+ unsigned int dcount; /* number of devices handled by this major */
55
+ unsigned int pcount; /* partitions per device */
56
+ char desc[IOC_DESCLEN + 1];
57
+ /* disk info unit # conversion function */
58
+ char *(*cconv)(unsigned int);
59
+
60
+ /* extension properties (all this for initrd?) */
61
+ char ext_name[IOC_NAMELEN + 1];
62
+ unsigned int ext; /* flag - this is an extension record */
63
+ unsigned int ext_minor; /* which minor does this apply to */
64
+ };
65
+
66
+ #define BLK_CONFIG_SIZE (sizeof(struct blk_config))
67
+
68
+
69
+ struct ioc_entry {
70
+ int live; /* is this a Direct entry? */
71
+ unsigned int ctrlno; /* controller number */
72
+ unsigned int basemajor; /* Major number of the template */
73
+ char *desc; /* (dynamic) per-controller description */
74
+ struct blk_config *blkp; /* the real info, may be a shared ref */
75
+ };
76
+
77
+ #define IOC_ENTRY_SIZE (sizeof(struct ioc_entry))
78
+
79
+
80
+ extern int ioc_iswhole(unsigned int, unsigned int);
81
+ extern char *ioc_name(unsigned int, unsigned int);
82
+ extern char *transform_devmapname(unsigned int, unsigned int);
83
+
84
+ #endif