| 1 | #!/usr/bin/env python
|
|---|
| 2 |
|
|---|
| 3 | setXrange = """set xrange [0:]
|
|---|
| 4 | """
|
|---|
| 5 | setYrange = """set yrange [0:]
|
|---|
| 6 | """
|
|---|
| 7 | setBOTHrange = '%s%s' % (setXrange, setYrange)
|
|---|
| 8 |
|
|---|
| 9 | def readTemplate():
|
|---|
| 10 | templateFile = open('template.gnuplot')
|
|---|
| 11 | template = ''
|
|---|
| 12 | for line in templateFile:
|
|---|
| 13 | template = '%s%s' % (template, line)
|
|---|
| 14 | templateFile.close()
|
|---|
| 15 | return template
|
|---|
| 16 |
|
|---|
| 17 | if __name__ == '__main__':
|
|---|
| 18 | template = readTemplate()
|
|---|
| 19 | # Generate GnuPlot Script for MySqlSlowQueries vs Epoch
|
|---|
| 20 | print template % ('MySqlSlowQueries_vs_Epoch',
|
|---|
| 21 | 'Epoch',
|
|---|
| 22 | 'MySQL Slow Queries Count',
|
|---|
| 23 | setYrange,
|
|---|
| 24 | '(mega($2))', '3',
|
|---|
| 25 | 'MySQL Slow Queries Count vs Epoch'
|
|---|
| 26 | )
|
|---|
| 27 | # Generate GnuPlot Script for Known Nebulous Requests vs Epoch
|
|---|
| 28 | print template % ('KnownNebulousRequest_vs_Epoch',
|
|---|
| 29 | 'Epoch',
|
|---|
| 30 | 'Known Nebulous Requests',
|
|---|
| 31 | setYrange,
|
|---|
| 32 | '(mega($2))', '4',
|
|---|
| 33 | 'Known Nebulous Requests vs Epoch'
|
|---|
| 34 | )
|
|---|
| 35 | # Generate GnuPlot Script for Other Nebulous Requests vs Epoch
|
|---|
| 36 | print template % ('OtherNebulousRequest_vs_Epoch',
|
|---|
| 37 | 'Epoch',
|
|---|
| 38 | 'Other Nebulous Requests',
|
|---|
| 39 | setYrange,
|
|---|
| 40 | '(mega($2))', '11',
|
|---|
| 41 | 'Other Nebulous Requests vs Epoch'
|
|---|
| 42 | )
|
|---|
| 43 | # Generate GnuPlot Script for Non Nebulous Requests vs Epoch
|
|---|
| 44 | print template % ('NonNebulousRequest_vs_Epoch',
|
|---|
| 45 | 'Epoch',
|
|---|
| 46 | 'Non-Nebulous Requests',
|
|---|
| 47 | setYrange,
|
|---|
| 48 | '(mega($2))', '12',
|
|---|
| 49 | 'Non-Nebulous Requests vs Epoch'
|
|---|
| 50 | )
|
|---|
| 51 | # Generate GnuPlot Script for Apache Errors vs Epoch
|
|---|
| 52 | print template % ('ApacheErrors_vs_Epoch',
|
|---|
| 53 | 'Epoch',
|
|---|
| 54 | 'Apache Errors',
|
|---|
| 55 | setYrange,
|
|---|
| 56 | '(mega($2))', '5',
|
|---|
| 57 | 'Apache Errors vs Epoch'
|
|---|
| 58 | )
|
|---|
| 59 | # Generate GnuPlot Script for Apache Errors vs KnownNebulous Requests
|
|---|
| 60 | print template % ('ApacheErrors_vs_KnownNebulous',
|
|---|
| 61 | 'KnownNebulous',
|
|---|
| 62 | 'Apache Errors',
|
|---|
| 63 | setBOTHrange,
|
|---|
| 64 | '4', '5',
|
|---|
| 65 | 'Apache Errors vs KnownNebulous'
|
|---|
| 66 | )
|
|---|
| 67 | # Generate GnuPlot Script for Apache Errors vs MySQL Slow Queries
|
|---|
| 68 | print template % ('ApacheErrors_vs_MySQLSlowQueries',
|
|---|
| 69 | 'MySQLSlowQueries',
|
|---|
| 70 | 'Apache Errors',
|
|---|
| 71 | setBOTHrange,
|
|---|
| 72 | '3', '5',
|
|---|
| 73 | 'Apache Errors vs MySQLSlowQueries'
|
|---|
| 74 | )
|
|---|
| 75 | # Generate GnuPlot Script for Create vs MySQL Slow Queries
|
|---|
| 76 | print template % ('Create_vs_MySQLSlowQueries',
|
|---|
| 77 | 'MySQLSlowQueries',
|
|---|
| 78 | 'Create',
|
|---|
| 79 | setBOTHrange,
|
|---|
| 80 | '3', '6',
|
|---|
| 81 | 'Create vs MySQLSlowQueries'
|
|---|
| 82 | )
|
|---|
| 83 | # Generate GnuPlot Script for FindIns vs MySQL Slow Queries
|
|---|
| 84 | print template % ('FindIns_vs_MySQLSlowQueries',
|
|---|
| 85 | 'MySQLSlowQueries',
|
|---|
| 86 | 'FindIns',
|
|---|
| 87 | setBOTHrange,
|
|---|
| 88 | '3', '7',
|
|---|
| 89 | 'FindIns vs MySQLSlowQueries'
|
|---|
| 90 | )
|
|---|
| 91 |
|
|---|
| 92 | # Generate GnuPlot Script for Delete vs MySQL Slow Queries
|
|---|
| 93 | print template % ('Delete_vs_MySQLSlowQueries',
|
|---|
| 94 | 'MySQLSlowQueries',
|
|---|
| 95 | 'Delete',
|
|---|
| 96 | setBOTHrange,
|
|---|
| 97 | '3', '8',
|
|---|
| 98 | 'Delete vs MySQLSlowQueries'
|
|---|
| 99 | )
|
|---|
| 100 |
|
|---|
| 101 | # Generate GnuPlot Script for FailStat vs MySQL Slow Queries
|
|---|
| 102 | print template % ('FailStat_vs_MySQLSlowQueries',
|
|---|
| 103 | 'MySQLSlowQueries',
|
|---|
| 104 | 'FailStat',
|
|---|
| 105 | setBOTHrange,
|
|---|
| 106 | '3', '9',
|
|---|
| 107 | 'FailStat vs MySQLSlowQueries'
|
|---|
| 108 | )
|
|---|
| 109 |
|
|---|
| 110 | # Generate GnuPlot Script for Stat vs MySQL Slow Queries
|
|---|
| 111 | print template % ('Stat_vs_MySQLSlowQueries',
|
|---|
| 112 | 'MySQLSlowQueries',
|
|---|
| 113 | 'Stat',
|
|---|
| 114 | setBOTHrange,
|
|---|
| 115 | '3', '10',
|
|---|
| 116 | 'Stat vs MySQLSlowQueries'
|
|---|
| 117 | )
|
|---|
| 118 |
|
|---|
| 119 | # Generate GnuPlot Script for OtherNebulous vs MySQL Slow Queries
|
|---|
| 120 | print template % ('OtherNebulous_vs_MySQLSlowQueries',
|
|---|
| 121 | 'MySQLSlowQueries',
|
|---|
| 122 | 'OtherNebulous',
|
|---|
| 123 | setBOTHrange,
|
|---|
| 124 | '3', '11',
|
|---|
| 125 | 'OtherNebulous vs MySQLSlowQueries'
|
|---|
| 126 | )
|
|---|
| 127 |
|
|---|
| 128 | # Generate GnuPlot Script for NonNebulous vs MySQL Slow Queries
|
|---|
| 129 | print template % ('NonNebulous_vs_MySQLSlowQueries',
|
|---|
| 130 | 'MySQLSlowQueries',
|
|---|
| 131 | 'NonNebulous',
|
|---|
| 132 | setBOTHrange,
|
|---|
| 133 | '3', '12',
|
|---|
| 134 | 'NonNebulous vs MySQLSlowQueries'
|
|---|
| 135 | )
|
|---|
| 136 |
|
|---|