3
* TOra - An Oracle Toolkit for DBA's and developers
4
* Copyright (C) 2003-2005 Quest Software, Inc
5
* Portions Copyright (C) 2005 Other Contributors
7
* This program is free software; you can redistribute it and/or
8
* modify it under the terms of the GNU General Public License
9
* as published by the Free Software Foundation; only version 2 of
10
* the License is valid for this program.
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
17
* You should have received a copy of the GNU General Public License
18
* along with this program; if not, write to the Free Software
19
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21
* As a special exception, you have permission to link this program
22
* with the Oracle Client libraries and distribute executables, as long
23
* as you follow the requirements of the GNU GPL in regard to all of the
24
* software in the executable aside from Oracle client libraries.
26
* Specifically you are not permitted to link this program with the
27
* Qt/UNIX, Qt/Windows or Qt Non Commercial products of TrollTech.
28
* And you are not permitted to distribute binaries compiled against
29
* these libraries without written consent from Quest Software, Inc.
30
* Observe that this does not disallow linking to the Qt Free Edition.
32
* You may link this product with any GPL'd Qt library such as Qt/Free
34
* All trademarks belong to their respective owners.
38
#include "tochangeconnection.h"
40
#include "toconnection.h"
42
#include "tonoblockquery.h"
43
#include "toresultbar.h"
44
#include "toresultitem.h"
45
#include "toresultline.h"
46
#include "toresultlock.h"
47
#include "toresultlong.h"
48
#include "toresultparam.h"
49
#include "toresultpie.h"
50
#include "toresultstats.h"
51
#include "toresultview.h"
55
#include "totuningsettingui.h"
56
#include "towaitevents.h"
59
# include <kmenubar.h>
65
#include <qcombobox.h>
67
#include <qgroupbox.h>
71
#include <qmessagebox.h>
72
#if QT_VERSION > 0x030000
73
# include <qobjectlist.h>
75
# include <qobjcoll.h>
78
#include <qscrollview.h>
79
#include <qsplitter.h>
80
#include <qtabwidget.h>
82
#include <qtoolbutton.h>
84
#include <qworkspace.h>
86
#include "totuning.moc"
87
#include "totuningoverviewui.moc"
88
#include "totuningsettingui.moc"
90
#include "icons/refresh.xpm"
91
#include "icons/totuning.xpm"
92
#include "icons/compile.xpm"
94
#define CONF_OVERVIEW "Overview"
95
#define CONF_FILEIO "File I/O"
96
#define CONF_WAITS "Wait events"
97
#define CONF_CHART "chart"
99
static std::list<QCString> TabList(void)
101
std::list<QCString> ret;
102
ret.insert(ret.end(), CONF_OVERVIEW);
103
std::list<QCString> val = toSQL::range("toTuning:Charts");
105
for (std::list<QCString>::iterator i = val.begin();i != val.end();i++)
107
QStringList parts = QStringList::split(QString::fromLatin1(":"), QString::fromLatin1(*i));
108
if (parts.count() == 3)
110
parts.append(parts[2]);
111
parts[2] = QString::fromLatin1("Charts");
113
if (last != parts[2])
114
ret.insert(ret.end(), parts[2].latin1());
117
ret.insert(ret.end(), CONF_WAITS);
118
ret.insert(ret.end(), CONF_FILEIO);
122
class toTuningSetup : public toTuningSettingUI, public toSettingTab
126
toTuningSetup(toTool *tool, QWidget* parent = 0, const char* name = 0)
127
: toTuningSettingUI(parent, name), toSettingTab("tuning.html#preferences"), Tool(tool)
129
std::list<QCString> tabs = TabList();
130
for (std::list<QCString>::iterator i = tabs.begin();i != tabs.end();i++)
132
QListViewItem *item = new QListViewItem(EnabledTabs, QString::fromLatin1(*i));
133
if (!tool->config(*i, "").isEmpty())
134
item->setSelected(true);
136
EnabledTabs->setSorting(0);
138
virtual void saveSetting(void)
140
for (QListViewItem *item = EnabledTabs->firstChild();item;item = item->nextSibling())
142
if (item->isSelected() || Tool->config(item->text(0).latin1(), "Undefined") != "Undefined")
143
Tool->setConfig(item->text(0).latin1(), QString::fromLatin1((item->isSelected() ? "Yes" : "")));
148
class toTuningTool : public toTool
151
virtual const char **pictureXPM(void)
153
return const_cast<const char**>(totuning_xpm);
157
: toTool(30, "Server Tuning")
159
virtual const char *menuItem()
161
return "Server Tuning";
163
virtual QWidget *toolWindow(QWidget *parent, toConnection &connection)
165
return new toTuning(parent, connection);
167
virtual QWidget *configurationTab(QWidget *parent)
169
return new toTuningSetup(this, parent);
171
virtual void closeWindow(toConnection &connection){};
174
static toTuningTool TuningTool;
176
static toSQL SQLDictionaryMiss("toTuning:Indicators:Important ratios:1DictionaryMiss",
177
"select sum(getmisses)/sum(gets)*100,' %' from v$rowcache",
178
"Data dictionary row cache miss ratio (%). < 10%-15%");
180
static toSQL SQLImportantLibraryCache("toTuning:Indicators:Important ratios:2LibraryCache",
181
"select sum(reloads)/sum(pins)*100,' %' from v$librarycache",
182
"Library cache (Shared SQL) miss ratio (%). < 1%");
184
static toSQL SQLDataCache("toTuning:Indicators:Important ratios:3DataCache",
185
"SELECT (1-SUM(DECODE(statistic#,40,value,0))/SUM(DECODE(statistic#,38,value,39,value,0)))*100,' %'\n"
187
" WHERE statistic# IN (38,39,40)",
188
"Data buffer cache hit ratio (%). > 60% - 70%",
191
static toSQL SQLDataCache9("toTuning:Indicators:Important ratios:3DataCache",
192
"SELECT (1-SUM(DECODE(statistic#,42,value,0))/SUM(DECODE(statistic#,40,value,41,value,0)))*100,' %'\n"
194
" WHERE statistic# IN (40,41,42)",
198
static toSQL SQLDataCache7("toTuning:Indicators:Important ratios:3DataCache",
199
"SELECT (1-SUM(DECODE(statistic#,39,value,0))/SUM(DECODE(statistic#,37,value,38,value,0)))*100,' %'\n"
201
" WHERE statistic# IN (37,38,39)",
205
static toSQL SQLLogRedo("toTuning:Indicators:Redo log contention:1LogSpace",
206
"select value from v$sysstat where statistic# = 108",
207
"Redo log space requests. Close to 0",
210
static toSQL SQLLogRedo9("toTuning:Indicators:Redo log contention:1LogSpace",
211
"select value from v$sysstat where statistic# = 122",
215
static toSQL SQLLogRedo7("toTuning:Indicators:Redo log contention:1LogSpace",
216
"select value from v$sysstat where statistic# = 94",
220
static toSQL SQLSystemHeadUndo("toTuning:Indicators:RBS contention:1SystemHeadUndo",
221
"SELECT count/blocks*100,' %'\n"
222
" FROM (SELECT MAX(count) count FROM v$waitstat WHERE class = 'system undo header') a,\n"
223
" (SELECT SUM(value) blocks FROM v$sysstat WHERE statistic# IN (38,39)) b",
224
"System undo header waits (%). < 1%",
227
static toSQL SQLSystemHeadUndo9("toTuning:Indicators:RBS contention:1SystemHeadUndo",
228
"SELECT count/blocks*100,' %'\n"
229
" FROM (SELECT MAX(count) count FROM v$waitstat WHERE class = 'system undo header') a,\n"
230
" (SELECT SUM(value) blocks FROM v$sysstat WHERE statistic# IN (40,41)) b",
234
static toSQL SQLSystemHeadUndo7("toTuning:Indicators:RBS contention:1SystemHeadUndo",
235
"SELECT count/blocks*100,' %'\n"
236
" FROM (SELECT MAX(count) count FROM v$waitstat WHERE class = 'system undo header') a,\n"
237
" (SELECT SUM(value) blocks FROM v$sysstat WHERE statistic# IN (37,38)) b",
241
static toSQL SQLSystemBlockUndo("toTuning:Indicators:RBS contention:2SystemBlockUndo",
242
"SELECT count/blocks*100,' %'\n"
243
" FROM (SELECT MAX(count) count FROM v$waitstat WHERE class = 'system undo block') a,\n"
244
" (SELECT SUM(value) blocks FROM v$sysstat WHERE statistic# IN (38,39)) b",
245
"System undo block waits (%). < 1%",
248
static toSQL SQLSystemBlockUndo9("toTuning:Indicators:RBS contention:2SystemBlockUndo",
249
"SELECT count/blocks*100,' %'\n"
250
" FROM (SELECT MAX(count) count FROM v$waitstat WHERE class = 'system undo block') a,\n"
251
" (SELECT SUM(value) blocks FROM v$sysstat WHERE statistic# IN (40,41)) b",
255
static toSQL SQLSystemBlockUndo7("toTuning:Indicators:RBS contention:2SystemBlockUndo",
256
"SELECT count/blocks*100,' %'\n"
257
" FROM (SELECT MAX(count) count FROM v$waitstat WHERE class = 'system undo block') a,\n"
258
" (SELECT SUM(value) blocks FROM v$sysstat WHERE statistic# IN (37,38)) b",
262
static toSQL SQLHeadUndo("toTuning:Indicators:RBS contention:3HeadUndo",
263
"SELECT count/blocks*100,' %'\n"
264
" FROM (SELECT MAX(count) count FROM v$waitstat WHERE class = 'undo header') a,\n"
265
" (SELECT SUM(value) blocks FROM v$sysstat WHERE statistic# IN (38,39)) b",
266
"Undo head waits (%). < 1%",
269
static toSQL SQLHeadUndo9("toTuning:Indicators:RBS contention:3HeadUndo",
270
"SELECT count/blocks*100,' %'\n"
271
" FROM (SELECT MAX(count) count FROM v$waitstat WHERE class = 'undo header') a,\n"
272
" (SELECT SUM(value) blocks FROM v$sysstat WHERE statistic# IN (40,41)) b",
276
static toSQL SQLHeadUndo7("toTuning:Indicators:RBS contention:3HeadUndo",
277
"SELECT count/blocks*100,' %'\n"
278
" FROM (SELECT MAX(count) count FROM v$waitstat WHERE class = 'undo header') a,\n"
279
" (SELECT SUM(value) blocks FROM v$sysstat WHERE statistic# IN (37,38)) b",
283
static toSQL SQLBlockUndo("toTuning:Indicators:RBS contention:4BlockUndo",
284
"SELECT count/blocks*100,' %'\n"
285
" FROM (SELECT MAX(count) count FROM v$waitstat WHERE class = 'undo block') a,\n"
286
" (SELECT SUM(value) blocks FROM v$sysstat WHERE statistic# IN (38,39)) b",
287
"Undo block waits (%). < 1%",
290
static toSQL SQLBlockUndo9("toTuning:Indicators:RBS contention:4BlockUndo",
291
"SELECT count/blocks*100,' %'\n"
292
" FROM (SELECT MAX(count) count FROM v$waitstat WHERE class = 'undo block') a,\n"
293
" (SELECT SUM(value) blocks FROM v$sysstat WHERE statistic# IN (40,41)) b",
297
static toSQL SQLBlockUndo7("toTuning:Indicators:RBS contention:4BlockUndo",
298
"SELECT count/blocks*100,' %'\n"
299
" FROM (SELECT MAX(count) count FROM v$waitstat WHERE class = 'undo block') a,\n"
300
" (SELECT SUM(value) blocks FROM v$sysstat WHERE statistic# IN (37,38)) b",
304
static toSQL SQLTotalWaits("toTuning:Indicators:RBS contention:5TotalWaits",
305
"select sum(waits)/sum(gets)*100,' %' from v$rollstat",
306
"Total RBS waits (%). < 1%");
308
static toSQL SQLBusyRate("toTuning:Indicators:MTS contention:1BusyRate",
309
"SELECT NVL(SUM(busy)/(SUM(busy)+SUM(idle)),0)*100,' %' FROM v$dispatcher",
310
"Busy rate for dispatchers (%). < 50%");
312
static toSQL SQLDispQueue("toTuning:Indicators:MTS contention:2DispQueue",
313
"SELECT DECODE(NVL(SUM(totalq),0),0, 'No responses', ROUND(SUM(wait)/SUM(totalq),3)) FROM v$queue WHERE type='DISPATCHER'",
314
"Dispatcher response queues waits (1/100s).");
316
static toSQL SQLServerQueue("toTuning:Indicators:MTS contention:3ServerQueue",
317
"SELECT DECODE (NVL(SUM(totalq),0),0, 'No requests', ROUND(SUM(wait)/SUM(totalq),3)) FROM v$queue WHERE type='COMMON'",
318
"Server request queue waits (1/100s).");
320
static toSQL SQLOptions("toTuning:Options",
321
"select parameter \"Parameter\",\n"
322
" decode(value,'TRUE','Enabled','Disabled') \"Enabled\"\n"
323
" from v$option order by parameter",
324
"Display options available in database");
326
static toSQL SQLLicense("toTuning:License",
327
"select * from v$license",
328
"Display licenses available for database");
330
static toSQL SQLChartsPhysical("toTuning:Charts:1BBPhysical I/O",
332
" sum(decode(statistic#,40,value,0)) \"Physical reads\",\n"
333
" sum(decode(statistic#,44,value,0)) \"Physical writes\",\n"
334
" sum(decode(statistic#,105,value,0)) \"Redo writes\"\n"
335
" from v$sysstat where statistic# in (40,44,105)",
336
"Generate chart of physical I/O of database.",
339
static toSQL SQLChartsPhysical9("toTuning:Charts:1BBPhysical I/O",
341
" sum(decode(statistic#,42,value,0)) \"Physical reads\",\n"
342
" sum(decode(statistic#,46,value,0)) \"Physical writes\",\n"
343
" sum(decode(statistic#,119,value,0)) \"Redo writes\"\n"
344
" from v$sysstat where statistic# in (42,46,119)",
348
static toSQL SQLChartsPhysical7("toTuning:Charts:1BBPhysical I/O",
350
" sum(decode(statistic#,39,value,0)) \"Physical reads\",\n"
351
" sum(decode(statistic#,40,value,0)) \"Physical writes\",\n"
352
" sum(decode(statistic#,91,value,0)) \"Redo writes\"\n"
353
" from v$sysstat where statistic# in (39,40,91)",
357
static toSQL SQLChartsLogical("toTuning:Charts:2BBLogical I/O",
359
" sum(decode(statistic#,38,value,0)) \"Block gets\",\n"
360
" sum(decode(statistic#,39,value,0)) \"Consistent gets\",\n"
361
" sum(decode(statistic#,41,value,0)) \"Block changes\",\n"
362
" sum(decode(statistic#,42,value,0)) \"Consistent changes\"\n"
363
" from v$sysstat where statistic# in (38,39,41,42)",
364
"Generate chart of physical I/O of database.",
367
static toSQL SQLChartsLogical9("toTuning:Charts:2BBLogical I/O",
369
" sum(decode(statistic#,40,value,0)) \"Block gets\",\n"
370
" sum(decode(statistic#,41,value,0)) \"Consistent gets\",\n"
371
" sum(decode(statistic#,43,value,0)) \"Block changes\",\n"
372
" sum(decode(statistic#,44,value,0)) \"Consistent changes\"\n"
373
" from v$sysstat where statistic# in (40,41,43,44)",
377
static toSQL SQLChartsLogical7("toTuning:Charts:2BBLogical I/O",
379
" sum(decode(statistic#,37,value,0)) \"Block gets\",\n"
380
" sum(decode(statistic#,38,value,0)) \"Consistent gets\",\n"
381
" sum(decode(statistic#,43,value,0)) \"Block changes\",\n"
382
" sum(decode(statistic#,45,value,0)) \"Consistent changes\"\n"
383
" from v$sysstat where statistic# in (37,38,43,45)",
387
static toSQL SQLChartsWait("toTuning:Charts:3BMWait events",
390
" parallel*10 \"Parallel execution\",\n"
391
" filewrite*10 \"DB File Write\",\n"
392
" writecomplete*10 \"Write Complete\",\n"
393
" fileread*10 \"DB File Read\",\n"
394
" singleread*10 \"DB Single File Read\",\n"
395
" control*10 \"Control File I/O\",\n"
396
" direct*10 \"Direct I/O\",\n"
397
" log*10 \"Log file\",\n"
398
" net*10 \"SQL*Net\"\n"
399
" from (select SUM(DECODE(SUBSTR(event,1,2),'PX',time_waited,0))-SUM(DECODE(event,'PX Idle Wait',time_waited,0)) parallel,\n"
400
" SUM(DECODE(event,'db file parallel write',time_waited,'db file single write',time_waited,0)) filewrite,\n"
401
" SUM(DECODE(event,'write complete waits',time_waited,NULL)) writecomplete,\n"
402
" SUM(DECODE(event,'db file parallel read',time_waited,'db file sequential read',time_waited,0)) fileread,\n"
403
" SUM(DECODE(event,'db file scattered read',time_waited,0)) singleread,\n"
404
" SUM(DECODE(SUBSTR(event,1,12),'control file',time_waited,0)) control,\n"
405
" SUM(DECODE(SUBSTR(event,1,11),'direct path',time_waited,0)) direct,\n"
406
" SUM(DECODE(SUBSTR(event,1,3),'log',time_waited,0)) log,\n"
407
" SUM(DECODE(SUBSTR(event,1,7),'SQL*Net',time_waited,0))-SUM(DECODE(event,'SQL*Net message from client',time_waited,0)) net\n"
408
" from v$system_event),\n"
409
" (select value*10 cpu from v$sysstat where statistic# = 12)",
410
"Used to generate chart for system wait time.");
412
static toSQL SQLChartsExecution("toTuning:Charts:6LNExecution",
414
" sum(decode(name,'execute count',value,0)) \"Execute\",\n"
415
" sum(decode(name,'parse count (hard)',value,0)) \"Hard parse\",\n"
416
" sum(decode(name,'parse count (total)',value,0)) \"Parse\",\n"
417
" sum(decode(name,'user calls',value,0)) \"Calls\",\n"
418
" sum(decode(name,'user commits',value,0)) \"Commit\",\n"
419
" sum(decode(name,'user rollbacks',value,0)) \"Rollbacks\"\n"
420
" from v$sysstat where name IN ('execute count','parse count (hard)','parse count (total)','user calls','user commits','user rollbacks')",
421
"Used to generate chart for execution statistics.",
425
static toSQL SQLChartsExecution7("toTuning:Charts:6LNExecution",
427
" sum(decode(statistic#,132,value,0)) \"Execute\",\n"
428
" sum(decode(statistic#,131,value,0)) \"Parse\",\n"
429
" sum(decode(statistic#,6,value,0)) \"Calls\",\n"
430
" sum(decode(statistic#,4,value,0)) \"Commit\",\n"
431
" sum(decode(statistic#,5,value,0)) \"Rollbacks\"\n"
432
" from v$sysstat where statistic# in (132,131,4,5,6)",
436
static toSQL SQLChartsExecutionPie("toTuning:Charts:8PNExecution Total",
437
"select value,decode(name,'execute count','Execute','parse count (hard)','Hard parse','parse count (total)','Parse',\n"
438
" 'user calls','Calls','user commits','Commit','user rollbacks','Rollbacks')\n"
439
" from v$sysstat where name IN ('execute count','parse count (hard)','parse count (total)','user calls','user commits','user rollbacks') order by name",
440
"Used to generate pie chart for execution statistics.",
444
static toSQL SQLChartsExecutionPie7("toTuning:Charts:8PNExecution Total",
445
"select value,decode(statistic#,132,'Execute',131,'Parse',\n"
446
" 6,'Calls',4,'Commit',5,'Rollbacks')\n"
447
" from v$sysstat where statistic# in (132,131,6,4,5) order by name",
451
static toSQL SQLChartsClients("toTuning:Charts:4BAClients",
453
" sum(decode(decode(type,'BACKGROUND','WHATEVER',status),'ACTIVE',1,0)) \"Active\",\n"
454
" sum(decode(status,'INACTIVE',1,0)) \"Inactive\",\n"
455
" sum(decode(type,'BACKGROUND',1,0)) \"System\"\n"
456
" from v$session where sid not in (select nvl(sid,0) from v$px_process)",
457
"Chart displaying connected clients");
459
static toSQL SQLChartsClients8("toTuning:Charts:4BAClients",
461
" sum(decode(decode(type,'BACKGROUND','WHATEVER',status),'ACTIVE',1,0)) \"Active\",\n"
462
" sum(decode(status,'INACTIVE',1,0)) \"Inactive\",\n"
463
" sum(decode(type,'BACKGROUND',1,0)) \"System\"\n"
468
static toSQL SQLChartsCacheMisses("toTuning:Charts:5CPCache misses",
470
" pread \"Data buffer cache\",read \"Dictionary row cache\",\n"
471
" getmiss \"Library cache\",gets \" \",\n"
472
" reloads \" \",pins \" \"\n"
473
" from (select 100*SUM(DECODE(statistic#,40,value,0)) pread,SUM(DECODE(statistic#,38,value,39,value,0)) read\n"
474
" from v$sysstat where statistic# IN (38,39,40)) \"Data buffer cache\",\n"
475
" (select 100*sum(getmisses) getmiss,sum(gets) gets from v$rowcache) \"Dictionary row cache\",\n"
476
" (select 100*sum(reloads) reloads,sum(pins) pins from v$librarycache) \"Library cache\"\n",
477
"Chart display memory allocation. This is really weird to change, especially since the column names "
478
"don't correspond exactly to the column data in the chart. Each group of two are divided with each other before drawn.",
481
static toSQL SQLChartsCacheMisses9("toTuning:Charts:5CPCache misses",
483
" pread \"Data buffer cache\",read \"Dictionary row cache\",\n"
484
" getmiss \"Library cache\",gets \" \",\n"
485
" reloads \" \",pins \" \"\n"
486
" from (select 100*SUM(DECODE(statistic#,42,value,0)) pread,SUM(DECODE(statistic#,40,value,41,value,0)) read\n"
487
" from v$sysstat where statistic# IN (40,41,42)) \"Data buffer cache\",\n"
488
" (select 100*sum(getmisses) getmiss,sum(gets) gets from v$rowcache) \"Dictionary row cache\",\n"
489
" (select 100*sum(reloads) reloads,sum(pins) pins from v$librarycache) \"Library cache\"\n",
493
static toSQL SQLChartsCacheMisses7("toTuning:Charts:5CPCache misses",
495
" pread \"Data buffer cache\",read \"Dictionary row cache\",\n"
496
" getmiss \"Library cache\",gets \" \",\n"
497
" reloads \" \",pins \" \"\n"
498
" from (select 100*SUM(DECODE(statistic#,39,value,0)) pread,SUM(DECODE(statistic#,37,value,38,value,0)) read\n"
499
" from v$sysstat where statistic# IN (37,38,39)) \"Data buffer cache\",\n"
500
" (select 100*sum(getmisses) getmiss,sum(gets) gets from v$rowcache) \"Dictionary row cache\",\n"
501
" (select 100*sum(reloads) reloads,sum(pins) pins from v$librarycache) \"Library cache\"\n",
505
static toSQL SQLChartsRedo("toTuning:Charts:7BSRedo log I/O",
507
" sum(decode(statistic#,101,value,0))/:unit<int> \"Redo size\",\n"
508
" sum(decode(statistic#,103,value,0))/:unit<int> \"Redo wastage\"\n"
509
" from v$sysstat where statistic# in (101,103)",
510
"Used to generate chart for redo I/O statistics.",
513
static toSQL SQLChartsRedo9("toTuning:Charts:7BSRedo log I/O",
515
" sum(decode(statistic#,115,value,0))/:unit<int> \"Redo size\",\n"
516
" sum(decode(statistic#,117,value,0))/:unit<int> \"Redo wastage\"\n"
517
" from v$sysstat where statistic# in (115,117)",
521
static toSQL SQLChartsRedo7("toTuning:Charts:7BSRedo log I/O",
523
" sum(decode(statistic#,85,value,0))/:unit<int> \"Redo size\",\n"
524
" sum(decode(statistic#,89,value,0))/:unit<int> \"Redo wastage\"\n"
525
" from v$sysstat where statistic# in (85,89)",
529
static toSQL SQLOverviewArchiveWrite("toTuning:Overview:ArchiveWrite",
530
"select sysdate,sum(blocks) from v$archived_log",
534
static toSQL SQLOverviewArchiveWrite7("toTuning:Overview:ArchiveWrite",
535
"select sysdate,0 from sys.dual",
539
static toSQL SQLOverviewBufferHit("toTuning:Overview:BufferHit",
540
"SELECT SYSDATE,(1-SUM(DECODE(statistic#,40,value,0))/SUM(DECODE(statistic#,38,value,39,value,0)))*100\n"
542
" WHERE statistic# IN (38,39,40)",
546
static toSQL SQLOverviewBufferHit9("toTuning:Overview:BufferHit",
547
"SELECT SYSDATE,(1-SUM(DECODE(statistic#,42,value,0))/SUM(DECODE(statistic#,40,value,41,value,0)))*100\n"
549
" WHERE statistic# IN (40,41,42)",
553
static toSQL SQLOverviewBufferHit7("toTuning:Overview:BufferHit",
554
"SELECT SYSDATE,(1-SUM(DECODE(statistic#,39,value,0))/SUM(DECODE(statistic#,37,value,38,value,0)))*100\n"
556
" WHERE statistic# IN (37,38,39)",
560
static toSQL SQLOverviewClientInput("toTuning:Overview:ClientInput",
561
"select sysdate,value/:f1<int>\n"
562
" from v$sysstat where statistic# = 182",
563
"Bytes sent to client",
566
static toSQL SQLOverviewClientInput9("toTuning:Overview:ClientInput",
567
"select sysdate,value/:f1<int>\n"
568
" from v$sysstat where statistic# = 223",
572
static toSQL SQLOverviewClientInput7("toTuning:Overview:ClientInput",
573
"select sysdate,value/:f1<int>\n"
574
" from v$sysstat where statistic# = 134",
578
static toSQL SQLOverviewClientOutput("toTuning:Overview:ClientOutput",
579
"select sysdate,value/:f1<int>\n"
580
" from v$sysstat where statistic# = 183",
581
"Bytes sent from client",
584
static toSQL SQLOverviewClientOutput9("toTuning:Overview:ClientOutput",
585
"select sysdate,value/:f1<int>\n"
586
" from v$sysstat where statistic# = 224",
590
static toSQL SQLOverviewClientOutput7("toTuning:Overview:ClientOutput",
591
"select sysdate,value/:f1<int>\n"
592
" from v$sysstat where statistic# = 133",
596
static toSQL SQLOverviewExecute("toTuning:Overview:Execute",
597
"select sysdate,value\n"
598
" from v$sysstat where statistic# = 181",
602
static toSQL SQLOverviewExecute9("toTuning:Overview:Execute",
603
"select sysdate,value\n"
604
" from v$sysstat where statistic# = 222",
608
static toSQL SQLOverviewExecute7("toTuning:Overview:Execute",
609
"select sysdate,value\n"
610
" from v$sysstat where statistic# = 132",
614
static toSQL SQLOverviewParse("toTuning:Overview:Parse",
615
"select sysdate,value\n"
616
" from v$sysstat where statistic# = 179",
620
static toSQL SQLOverviewParse9("toTuning:Overview:Parse",
621
"select sysdate,value\n"
622
" from v$sysstat where statistic# = 219",
626
static toSQL SQLOverviewParse7("toTuning:Overview:Parse",
627
"select sysdate,value\n"
628
" from v$sysstat where statistic# = 131",
632
static toSQL SQLOverviewRedoEntries("toTuning:Overview:RedoEntries",
633
"select sysdate,value\n"
634
" from v$sysstat where statistic# = 100",
638
static toSQL SQLOverviewRedoEntries9("toTuning:Overview:RedoEntries",
639
"select sysdate,value\n"
640
" from v$sysstat where statistic# = 114",
644
static toSQL SQLOverviewRedoEntries7("toTuning:Overview:RedoEntries",
645
"select sysdate,value\n"
646
" from v$sysstat where statistic# = 84",
650
static toSQL SQLOverviewRedoBlocks("toTuning:Overview:RedoBlocks",
651
"select sysdate,value\n"
652
" from v$sysstat where statistic# = 106",
653
"Redo blocks written",
656
static toSQL SQLOverviewRedoBlocks9("toTuning:Overview:RedoBlocks",
657
"select sysdate,value\n"
658
" from v$sysstat where statistic# = 120",
662
static toSQL SQLOverviewRedoBlocks7("toTuning:Overview:RedoBlocks",
663
"select sysdate,value\n"
664
" from v$sysstat where statistic# = 92",
668
static toSQL SQLOverviewLogicalRead("toTuning:Overview:LogicalRead",
669
"select sysdate,sum(value)\n"
670
" from v$sysstat where statistic# in (38,39)",
674
static toSQL SQLOverviewLogicalRead9("toTuning:Overview:LogicalRead",
675
"select sysdate,sum(value)\n"
676
" from v$sysstat where statistic# in (40,41)",
680
static toSQL SQLOverviewLogicalRead7("toTuning:Overview:LogicalRead",
681
"select sysdate,sum(value)\n"
682
" from v$sysstat where statistic# in (37,38)",
686
static toSQL SQLOverviewLogicalWrite("toTuning:Overview:LogicalWrite",
687
"select sysdate,sum(value)\n"
688
" from v$sysstat where statistic# in (41,42)",
692
static toSQL SQLOverviewLogicalWrite9("toTuning:Overview:LogicalWrite",
693
"select sysdate,sum(value)\n"
694
" from v$sysstat where statistic# in (43,44)",
698
static toSQL SQLOverviewLogicalWrite7("toTuning:Overview:LogicalWrite",
699
"select sysdate,sum(value)\n"
700
" from v$sysstat where statistic# in (43,45)",
704
static toSQL SQLOverviewPhysicalRead("toTuning:Overview:PhysicalRead",
705
"select sysdate,value\n"
706
" from v$sysstat where statistic# = 40",
707
"Blocks physically read",
710
static toSQL SQLOverviewPhysicalRead9("toTuning:Overview:PhysicalRead",
711
"select sysdate,value\n"
712
" from v$sysstat where statistic# = 42",
716
static toSQL SQLOverviewPhysicalRead7("toTuning:Overview:PhysicalRead",
717
"select sysdate,value\n"
718
" from v$sysstat where statistic# = 39",
722
static toSQL SQLOverviewPhysicalWrite("toTuning:Overview:PhysicalWrite",
723
"select sysdate,value\n"
724
" from v$sysstat where statistic# = 44",
725
"Blocks physically written",
728
static toSQL SQLOverviewPhysicalWrite9("toTuning:Overview:PhysicalWrite",
729
"select sysdate,value\n"
730
" from v$sysstat where statistic# = 46",
734
static toSQL SQLOverviewPhysicalWrite7("toTuning:Overview:PhysicalWrite",
735
"select sysdate,value\n"
736
" from v$sysstat where statistic# = 40",
740
static toSQL SQLOverviewClient("toTuning:Overview:Client",
742
" sum(decode(status,'INACTIVE',1,0)),\n"
743
" sum(decode(status,'ACTIVE',1,0))\n"
745
" where type != 'BACKGROUND' and sid not in (select nvl(sid,0) from v$px_process)",
746
"Information about active/inactive clients");
748
static toSQL SQLOverviewClient8("toTuning:Overview:Client",
750
" sum(decode(status,'INACTIVE',1,0)),\n"
751
" sum(decode(status,'ACTIVE',1,0))\n"
753
" where type != 'BACKGROUND'",
757
static toSQL SQLOverviewSGAUsed("toTuning:Overview:SGAUsed",
758
"select sysdate,100*(total-free)/total\n"
759
" from (select sum(value) total from v$sga where name in ('Fixed Size','Variable Size')),\n"
760
" (select bytes free from v$sgastat where pool = 'shared pool' and name = 'free memory')",
764
static toSQL SQLOverviewSGAUsed7("toTuning:Overview:SGAUsed",
765
"select sysdate,100*(total-free)/total\n"
766
" from (select sum(value) total from v$sga where name in ('Fixed Size','Variable Size')),\n"
767
" (select bytes free from v$sgastat where name = 'free memory')",
771
static toSQL SQLOverviewTimescale("toTuning:Overview:Timescale",
772
"select sysdate,0 from sys.dual",
773
"Get timescale of other graphs");
775
static toSQL SQLOverviewFilespace("toTuning:Overview:Filespace",
776
"select sum(bytes)/:f1<int>,'Free'\n"
777
" from sys.dba_free_space\n"
779
"select (total-free)/:f1<int>,'Used'\n"
780
" from (select sum(bytes) free from sys.dba_free_space),\n"
781
" (select sum(bytes) total from sys.dba_data_files)",
784
void toTuningOverview::setupChart(toResultLine *chart, const QString &title, const QString &postfix, const toSQL &sql)
786
chart->setMinValue(0);
788
chart->showLegend(false);
789
chart->showAxisLegend(false);
790
chart->setTitle(title);
791
chart->showLast(true);
793
if (postfix == QString::fromLatin1("b/s"))
795
QString unitStr = toConfigurationSingle::Instance().globalConfig(CONF_SIZE_UNIT, DEFAULT_SIZE_UNIT);
796
val.insert(val.end(), toQValue(toSizeDecode(unitStr)));
797
unitStr += QString::fromLatin1("/s");
798
chart->setYPostfix(unitStr);
801
chart->setYPostfix(postfix);
802
chart->query(sql, val);
805
toTuningOverview::toTuningOverview(QWidget *parent, const char *name, WFlags fl)
806
: toTuningOverviewUI(parent, name, fl)
808
BackgroundGroup->setColumnLayout(1, Horizontal);
810
setupChart(ArchiveWrite, tr("< Archive write"), " " + tr("blocks/s"), SQLOverviewArchiveWrite);
811
setupChart(BufferHit, tr("Hitrate"), QString::fromLatin1("%"), SQLOverviewBufferHit);
812
BufferHit->setMaxValue(100);
813
BufferHit->setFlow(false);
814
setupChart(ClientInput, tr("< Client input"), QString::fromLatin1("b/s"), SQLOverviewClientInput);
815
setupChart(ClientOutput, tr("Client output >"), QString::fromLatin1("b/s"), SQLOverviewClientOutput);
816
setupChart(ExecuteCount, tr("Executes >"), QString::fromLatin1("/s"), SQLOverviewExecute);
817
setupChart(LogWrite, tr("Log writer >"), " " + tr("blocks/s"), SQLOverviewRedoBlocks);
818
setupChart(LogicalChange, tr("Buffer changed >"), tr(" blocks/s"), SQLOverviewLogicalWrite);
819
setupChart(LogicalRead, tr("< Buffer gets"), tr(" blocks/s"), SQLOverviewLogicalRead);
820
setupChart(ParseCount, tr("Parse >"), QString::fromLatin1("/s"), SQLOverviewParse);
821
setupChart(PhysicalRead, tr("< Physical read"), tr(" blocks/s"), SQLOverviewPhysicalRead);
822
setupChart(PhysicalWrite, tr("Physical write >"), tr(" blocks/s"), SQLOverviewPhysicalWrite);
823
setupChart(RedoEntries, tr("Redo entries >"), QString::fromLatin1("/s"), SQLOverviewRedoEntries);
824
setupChart(Timescale, tr("Timescale"), QString::null, SQLOverviewTimescale);
825
Timescale->showAxisLegend(true);
826
Timescale->showLast(false);
828
ClientChart->showGrid(0);
829
ClientChart->showLegend(false);
830
ClientChart->showAxisLegend(false);
831
ClientChart->query(SQLOverviewClient);
832
ClientChart->setFlow(false);
834
SharedUsed->showGrid(0);
835
SharedUsed->showLegend(false);
836
SharedUsed->showAxisLegend(false);
837
SharedUsed->query(SQLOverviewSGAUsed);
838
SharedUsed->setFlow(false);
839
SharedUsed->setMaxValue(100);
840
SharedUsed->setYPostfix(QString::fromLatin1("%"));
841
SharedUsed->showLast(true);
846
val.insert(val.end(),
847
toQValue(toSizeDecode(toConfigurationSingle::Instance().globalConfig(CONF_SIZE_UNIT,
848
DEFAULT_SIZE_UNIT))));
849
FileUsed->query(toSQL::string(SQLOverviewFilespace, toCurrentConnection(this)), (const toQList)val);
852
FileUsed->showLegend(false);
855
connect(&Poll, SIGNAL(timeout()), this, SLOT(poll()));
857
// Will be called later anyway
861
toTuningOverview::~toTuningOverview()
863
if (Done.getValue() == 0)
870
void toTuningOverview::stop(void)
874
disconnect(toCurrentTool(this)->timer(), SIGNAL(timeout()), this, SLOT(refresh()));
878
ArchiveWrite->stop();
881
ClientOutput->stop();
882
ExecuteCount->stop();
884
LogicalChange->stop();
887
PhysicalRead->stop();
888
PhysicalWrite->stop();
896
void toTuningOverview::start(void)
900
connect(toCurrentTool(this)->timer(), SIGNAL(timeout()), this, SLOT(refresh()));
904
ArchiveWrite->start();
906
ClientInput->start();
907
ClientOutput->start();
908
ExecuteCount->start();
910
LogicalChange->start();
911
LogicalRead->start();
913
PhysicalRead->start();
914
PhysicalWrite->start();
915
RedoEntries->start();
917
ClientChart->start();
922
static toSQL SQLOverviewArchive("toTuning:Overview:Archive",
924
" nvl(sum(blocks*block_size),0)/:f1<int>\n"
925
" from v$archived_log where deleted = 'NO'",
926
"Information about archive logs",
929
static toSQL SQLOverviewArchive7("toTuning:Overview:Archive",
932
" from sys.dual where 0 != :f1<int>",
936
static toSQL SQLOverviewLog("toTuning:Overview:Log",
938
" max(decode(status,'CURRENT',group#,0)),\n"
939
" sum(decode(status,'CURRENT',bytes,0))/:f1<int>,\n"
940
" sum(bytes)/:f1<int> from v$log\n",
941
"Information about redo logs");
943
static toSQL SQLOverviewTablespaces("toTuning:Overview:Tablespaces",
944
"select count(1) from v$tablespace",
945
"Number of tablespaces",
948
static toSQL SQLOverviewTablespaces7("toTuning:Overview:Tablespaces",
949
"select count(1) from sys.dba_tablespaces",
953
static toSQL SQLOverviewSGA("toTuning:Overview:SGA",
954
"select name,value/:f1<int> from v$sga",
955
"Information about SGA");
957
static toSQL SQLOverviewBackground("toTuning:Overview:Background",
958
"select substr(name,1,3),count(1) from v$bgprocess where paddr != '00'\n"
959
" group by substr(name,1,3) order by substr(name,1,3)",
960
"Background processes");
962
static toSQL SQLOverviewDedicated("toTuning:Overview:Dedicated",
963
"select count(1) from v$session\n"
964
" where type = 'USER' and server = 'DEDICATED'\n"
965
" and sid not in (select nvl(sid,0) from v$px_process)",
966
"Dedicated server process",
969
static toSQL SQLOverviewDedicated7("toTuning:Overview:Dedicated",
970
"select count(1) from v$session where type = 'USER' and server = 'DEDICATED'",
974
static toSQL SQLOverviewDispatcher("toTuning:Overview:Dispatcher",
975
"select count(1) from v$dispatcher",
976
"Dispatcher processes");
978
static toSQL SQLOverviewParallell("toTuning:Overview:Parallel",
979
"select count(1) from v$px_process",
980
"Parallel processes",
983
static toSQL SQLOverviewParallell8("toTuning:Overview:Parallel",
984
"select 'N/A' from sys.dual",
988
static toSQL SQLOverviewShared("toTuning:Overview:Shared",
989
"select count(1) from v$shared_server",
992
static toSQL SQLOverviewRound("toTuning:Overview:Roundtime",
993
"select round(average_wait,2) from v$system_event\n"
994
" where event in ('SQL*Net message from client',\n"
995
" 'SQL*Net message to client') order by event",
996
"Client roundtime info");
998
static toSQL SQLOverviewClientTotal("toTuning:Overview:ClientTotal",
1000
" sum(decode(status,'ACTIVE',1,0))\n"
1002
" where type != 'BACKGROUND' and sid not in (select nvl(sid,0) from v$px_process)",
1003
"Information about total and active clients",
1006
static toSQL SQLOverviewClientTotal8("toTuning:Overview:ClientTotal",
1007
"select count(1),\n"
1008
" sum(decode(status,'ACTIVE',1,0))\n"
1010
" where type != 'BACKGROUND'",
1014
static toSQL SQLOverviewDatafiles("toTuning:Overview:Datafiles",
1015
"select (select count(1) from v$datafile)+(select count(1) from v$tempfile) from dual",
1016
"Number of datafiles",
1019
static toSQL SQLOverviewDatafiles8("toTuning:Overview:Datafiles",
1020
"select count(1) from v$datafile",
1024
static toSQL SQLOverviewDatafiles7("toTuning:Overview:Datafiles",
1025
"select count(1) from sys.dba_tablespaces",
1029
void toTuningOverview::overviewQuery::setValue(const QCString &nam, const QString &val)
1033
toLocker lock (Parent.Lock)
1035
Parent.Values[nam] = val;
1038
void toTuningOverview::overviewQuery::run(void)
1043
val.insert(val.end(), toQValue(toSizeDecode(Parent.UnitString)));
1045
toQList res = toQuery::readQuery(*Parent.Connection, SQLOverviewArchive, val);
1046
QString tmp = toShift(res);
1047
tmp += QString::fromLatin1("/");
1048
tmp += toShift(res);
1049
tmp += Parent.UnitString;
1050
setValue("ArchiveInfo", tmp);
1052
res = toQuery::readQuery(*Parent.Connection, SQLOverviewRound);
1054
tmp += QString::fromLatin1(" ms");
1055
setValue("SendFromClient", tmp);
1057
tmp += QString::fromLatin1(" ms");
1058
setValue("SendToClient", tmp);
1060
res = toQuery::readQuery(*Parent.Connection, SQLOverviewClientTotal);
1062
setValue("TotalClient", tmp);
1064
setValue("ActiveClient", tmp);
1067
res = toQuery::readQuery(*Parent.Connection, SQLOverviewDedicated);
1069
totJob += tmp.toInt();
1070
setValue("DedicatedServer", tmp);
1072
res = toQuery::readQuery(*Parent.Connection, SQLOverviewDispatcher);
1074
totJob += tmp.toInt();
1075
setValue("DispatcherServer", tmp);
1077
res = toQuery::readQuery(*Parent.Connection, SQLOverviewShared);
1079
totJob += tmp.toInt();
1080
setValue("SharedServer", tmp);
1082
res = toQuery::readQuery(*Parent.Connection, SQLOverviewParallell);
1084
totJob += tmp.toInt();
1085
setValue("ParallellServer", tmp);
1087
res = toQuery::readQuery(*Parent.Connection, SQLOverviewBackground);
1089
while (!res.empty())
1092
if (tmp == QString::fromLatin1("DBW"))
1093
tmp = QString::fromLatin1("DBWR");
1094
else if (tmp == QString::fromLatin1("PMO"))
1095
tmp = QString::fromLatin1("PMON");
1096
else if (tmp == QString::fromLatin1("ARC"))
1097
tmp = QString::fromLatin1("ARCH");
1098
else if (tmp == QString::fromLatin1("CKP"))
1099
tmp = QString::fromLatin1("CKPT");
1100
else if (tmp == QString::fromLatin1("LGW"))
1101
tmp = QString::fromLatin1("LGWR");
1102
else if (tmp == QString::fromLatin1("LMO"))
1103
tmp = QString::fromLatin1("LMON");
1104
else if (tmp == QString::fromLatin1("REC"))
1105
tmp = QString::fromLatin1("RECO");
1106
else if (tmp == QString::fromLatin1("TRW"))
1107
tmp = QString::fromLatin1("TRWR");
1108
else if (tmp == QString::fromLatin1("SMO"))
1109
tmp = QString::fromLatin1("SMON");
1111
tmp += QString::fromLatin1(": <B>");
1112
QString job = toShift(res);
1113
totJob += job.toInt();
1115
tmp += QString::fromLatin1("</B>");
1118
setValue("Background", back.join(QString::fromLatin1(",")));
1119
setValue("TotalProcess", QString::number(totJob));
1123
res = toQuery::readQuery(*Parent.Connection, SQLOverviewSGA, val);
1124
while (!res.empty())
1126
QString nam = toShift(res);
1128
if (nam == "Database Buffers" || nam == "Redo Buffers")
1129
setValue(nam.latin1(), tmp + Parent.UnitString);
1130
else if (nam == "Fixed Size" || nam == "Variable Size")
1131
sql += tmp.toDouble();
1132
tot += tmp.toDouble();
1134
tmp = toQValue::formatNumber(tot);
1135
tmp += Parent.UnitString;
1136
setValue("SGATotal", tmp);
1137
tmp = toQValue::formatNumber(sql);
1138
tmp += Parent.UnitString;
1139
setValue("SharedSize", tmp);
1141
res = toQuery::readQuery(*Parent.Connection, SQLOverviewLog, val);
1142
setValue("RedoFiles", toShift(res));
1143
setValue("ActiveRedo", toShift(res));
1145
tmp += QString::fromLatin1("/");
1146
tmp += toShift(res);
1147
tmp += Parent.UnitString;
1148
setValue("RedoSize", tmp);
1150
res = toQuery::readQuery(*Parent.Connection, SQLOverviewTablespaces);
1151
setValue("Tablespaces", toShift(res));
1153
res = toQuery::readQuery(*Parent.Connection, SQLOverviewDatafiles);
1154
setValue("Files", toShift(res));
1156
catch (const QString &str)
1158
fprintf(stderr, "Exception occured:\n\n%s\n", (const char *)str.latin1());
1165
void toTuningOverview::refresh(void)
1169
if (Done.getValue() == 1)
1173
Connection = &toCurrentConnection(this);
1174
UnitString = toConfigurationSingle::Instance().globalConfig(CONF_SIZE_UNIT, DEFAULT_SIZE_UNIT);
1175
toThread *thread = new toThread(new overviewQuery(*this));
1183
void toTuningOverview::setValue(QLabel *label, const QCString &nam)
1185
toLocker lock (Lock)
1187
std::map<QCString, QString>::iterator i = Values.find(nam);
1188
if (i != Values.end())
1190
label->setText((*i).second);
1195
void toTuningOverview::poll(void)
1199
setValue(ArchiveInfo, "ArchiveInfo");
1200
setValue(SendFromClient, "SendFromClient");
1201
setValue(SendToClient, "SendToClient");
1202
setValue(TotalClient, "TotalClient");
1203
setValue(ActiveClient, "ActiveClient");
1204
setValue(DedicatedServer, "DedicatedServer");
1205
setValue(DispatcherServer, "DispatcherServer");
1206
setValue(SharedServer, "SharedServer");
1207
setValue(ParallellServer, "ParallellServer");
1210
toLocker lock (Lock)
1212
std::map<QCString, QString>::iterator i = Values.find("Background");
1213
if (i != Values.end())
1215
std::list<QLabel *>::iterator labIt = Backgrounds.begin();
1217
QStringList lst = QStringList::split(QString::fromLatin1(","), (*i).second);
1218
for (unsigned int j = 0;j < lst.count();j++)
1221
if (labIt == Backgrounds.end() || *labIt == NULL)
1223
label = new QLabel(BackgroundGroup);
1225
if (labIt == Backgrounds.end())
1227
Backgrounds.insert(Backgrounds.end(), label);
1228
labIt = Backgrounds.end();
1241
label->setText(lst[j]);
1243
while (labIt != Backgrounds.end())
1253
setValue(TotalProcess, "TotalProcess");
1254
setValue(BufferSize, "Database Buffers");
1255
setValue(RedoBuffer, "Redo Buffers");
1256
setValue(SGATotal, "SGATotal");
1257
setValue(SharedSize, "SharedSize");
1258
setValue(RedoFiles, "RedoFiles");
1259
setValue(ActiveRedo, "ActiveRedo");
1260
setValue(RedoSize, "RedoSize");
1262
std::list<double> &values = FileUsed->values();
1263
std::list<double>::iterator j = values.begin();
1264
if (j != values.end())
1268
if (j != values.end())
1271
if (j != values.end())
1273
QString tmp = toQValue::formatNumber(used);
1274
tmp += QString::fromLatin1("/");
1275
tmp += toQValue::formatNumber(size);
1277
if (tmp != Filesize->text())
1278
Filesize->setText(tmp);
1281
setValue(Tablespaces, "Tablespaces");
1282
setValue(Files, "Files");
1283
if (Done.getValue() == 1)
1289
static toSQL SQLLibraryCache("toTuning:LibraryCache",
1290
"SELECT namespace,\n"
1292
" gethits \"Get Hits\",\n"
1293
" to_char(trunc(gethitratio*100,\n"
1294
" 1))||'%' \"-Ratio\",\n"
1296
" pinhits \"Pin Hits\",\n"
1297
" to_char(trunc(pinhitratio*100,\n"
1298
" 1))||'%' \"-Ratio\"\n"
1299
" FROM v$librarycache",
1300
"Library cache view");
1302
static toSQL SQLControlFiles("toTuning:ControlFileRecords",
1303
"SELECT type \"Type\",\n"
1304
" record_size \"Size\",\n"
1305
" records_total \"Total Records\",\n"
1306
" records_used \"Used Records\",\n"
1307
" round(record_size*records_total/:unt<int>,1)||' '||:unitstr<char[101]> \"-Allocated\",\n"
1308
" to_char(round(records_used/records_total*100,1))||'%' \"-Used\",\n"
1310
" FROM v$controlfile_record_section\n"
1313
" round(avg(record_size),1),\n"
1314
" sum(records_total),\n"
1315
" sum(records_used),\n"
1316
" round(sum(record_size*records_total/:unt<int>),1)||' '||:unitstr<char[101]>,\n"
1317
" to_char(round(sum(record_size*records_used)/sum(record_size*records_total)*100,1))||'%' \"-Used\",\n"
1318
" 'ZZZZZZZZZZZZZ'\n"
1319
" FROM v$controlfile_record_section\n"
1321
"Control file record info");
1323
toTuning::toTuning(QWidget *main, toConnection &connection)
1324
: toToolWidget(TuningTool, "tuning.html", main, connection)
1326
if (TuningTool.config(CONF_OVERVIEW, "Undefined") == "Undefined")
1328
QString def = QString::null;
1329
if (TOMessageBox::warning(toMainWidget(),
1330
tr("Enable all tuning statistics"),
1331
tr("Are you sure you want to enable all tuning features.\n"
1332
"This can put heavy strain on a database and unless you\n"
1333
"are the DBA you probably don't want this. Selecting\n"
1334
"no here will give you the option to enable or disable\n"
1335
"tabs individually as they are needed."),
1336
tr("Yes"), tr("&No"), QString::null, 1) == 0)
1340
std::list<QCString> tabs = TabList();
1341
for (std::list<QCString>::iterator i = tabs.begin();i != tabs.end();i++)
1342
TuningTool.setConfig(*i, def);
1343
toConfigurationSingle::Instance().saveConfig();
1346
QToolBar *toolbar = toAllocBar(this, tr("Server Tuning"));
1348
new QToolButton(QPixmap(const_cast<const char**>(refresh_xpm)),
1351
this, SLOT(refresh(void)),
1353
toolbar->addSeparator();
1354
new QLabel(tr("Refresh") + " ", toolbar, TO_KDE_TOOLBAR_WIDGET);
1355
Refresh = toRefreshCreate(toolbar, TO_KDE_TOOLBAR_WIDGET);
1356
connect(Refresh, SIGNAL(activated(const QString &)), this, SLOT(changeRefresh(const QString &)));
1357
toolbar->addSeparator();
1358
TabButton = new toPopupButton(QPixmap(const_cast<const char**>(compile_xpm)),
1359
tr("Enable and disable tuning tabs"),
1360
tr("Enable and disable tuning tabs"),
1362
TabMenu = new QPopupMenu(TabButton);
1363
TabButton->setPopup(TabMenu);
1364
connect(TabMenu, SIGNAL(aboutToShow()), this, SLOT(showTabMenu()));
1365
connect(TabMenu, SIGNAL(activated(int)), this, SLOT(enableTabMenu(int)));
1367
toolbar->setStretchableWidget(new QLabel(toolbar, TO_KDE_TOOLBAR_WIDGET));
1368
new toChangeConnection(toolbar, TO_KDE_TOOLBAR_WIDGET);
1370
Tabs = new QTabWidget(this);
1372
Overview = new toTuningOverview(this, "overview");
1373
Tabs->addTab(Overview, tr("&Overview"));
1377
toRefreshParse(timer());
1378
connect(timer(), SIGNAL(timeout()), Overview, SLOT(refresh()));
1382
QString unitStr = toConfigurationSingle::Instance().globalConfig(CONF_SIZE_UNIT, DEFAULT_SIZE_UNIT);
1384
unit.insert(unit.end(), toQValue(toSizeDecode(unitStr)));
1386
std::list<QCString> val = toSQL::range("toTuning:Charts");
1387
for (std::list<QCString>::iterator i = val.begin();i != val.end();i++)
1389
QStringList parts = QStringList::split(QString::fromLatin1(":"), QString::fromLatin1(*i));
1390
if (parts.count() == 3)
1392
parts.append(parts[2]);
1393
parts[2] = QString::fromLatin1("Charts");
1395
std::map<QCString, QGrid *>::iterator j = Charts.find(QCString(CONF_CHART) + parts[2].latin1());
1397
if (j == Charts.end())
1398
Charts[QCString(CONF_CHART) + parts[2].latin1()] = cchart = new QGrid(2, Tabs, QCString(CONF_CHART) + parts[2].latin1());
1400
cchart = (*j).second;
1402
if (parts[3].mid(1, 1) == QString::fromLatin1("B"))
1404
toResultBar *chart = new toResultBar(cchart);
1405
chart->setTitle(parts[3].mid(3));
1407
if (parts[3].mid(2, 1) == QString::fromLatin1("B"))
1408
chart->setYPostfix(tr(" blocks/s"));
1409
else if (parts[3].mid(2, 1) == QString::fromLatin1("M"))
1410
chart->setYPostfix(QString::fromLatin1(" ms/s"));
1411
else if (parts[3].mid(2, 1) == QString::fromLatin1("S"))
1414
QString t = unitStr;
1415
t += QString::fromLatin1("/s");
1416
chart->setYPostfix(t);
1418
else if (parts[3].mid(2, 1) == QString::fromLatin1("A"))
1419
chart->setFlow(false);
1421
chart->setYPostfix(QString::fromLatin1("/s"));
1422
chart->query(toSQL::sql(*i), par);
1424
else if (parts[3].mid(1, 1) == QString::fromLatin1("L") || parts[3].mid(1, 1) == QString::fromLatin1("C"))
1426
toResultLine *chart;
1427
if (parts[3].mid(1, 1) == QString::fromLatin1("C"))
1428
chart = new toTuningMiss(cchart);
1430
chart = new toResultLine(cchart);
1431
chart->setTitle(parts[3].mid(3));
1433
if (parts[3].mid(2, 1) == QString::fromLatin1("B"))
1434
chart->setYPostfix(tr(" blocks/s"));
1435
else if (parts[3].mid(2, 1) == QString::fromLatin1("S"))
1438
QString t = unitStr;
1439
t += QString::fromLatin1("/s");
1440
chart->setYPostfix(t);
1442
else if (parts[3].mid(2, 1) == QString::fromLatin1("P"))
1444
chart->setYPostfix(QString::fromLatin1(" %"));
1445
chart->setMinValue(0);
1448
chart->setYPostfix(QString::fromLatin1("/s"));
1449
chart->query(toSQL::sql(*i), par);
1451
else if (parts[3].mid(1, 1) == QString::fromLatin1("P"))
1453
toResultPie *chart = new toResultPie(cchart);
1454
chart->setTitle(parts[3].mid(3));
1455
if (parts[3].mid(2, 1) == QString::fromLatin1("S"))
1457
chart->query(toSQL::sql(*i), unit);
1458
chart->setPostfix(unitStr);
1461
chart->query(toSQL::sql(*i));
1464
toStatusMessage(tr("Wrong format of name on chart (%1).").arg(*i));
1468
for (std::map<QCString, QGrid *>::iterator k = Charts.begin();k != Charts.end();k++)
1469
Tabs->addTab((*k).second, tr((*k).first.mid(strlen(CONF_CHART))));
1471
FileIO = new toTuningFileIO(this, "fileio");
1472
connect(this, SIGNAL(connectionChange()), FileIO, SLOT(changeConnection()));
1474
Waits = new toWaitEvents(this, "waits");
1475
Tabs->addTab(Waits, tr("Wait events"));
1477
Tabs->addTab(FileIO, tr("&File I/O"));
1479
Indicators = new toListView(Tabs, "indicators");
1480
Indicators->setRootIsDecorated(true);
1481
Indicators->addColumn(tr("Indicator"));
1482
Indicators->addColumn(tr("Value"));
1483
Indicators->addColumn(tr("Reference"));
1484
Tabs->addTab(Indicators, tr("&Indicators"));
1486
Statistics = new toResultStats(Tabs, "stats");
1487
Tabs->addTab(Statistics, tr("&Statistics"));
1489
Parameters = new toResultParam(Tabs, "parameters");
1490
Tabs->addTab(Parameters, tr("&Parameters"));
1492
BlockingLocks = new toResultLock(Tabs, "locks");
1493
Tabs->addTab(BlockingLocks, tr("&Blocking locks"));
1495
LibraryCache = new toResultLong(true, false, toQuery::Background, Tabs, "cache");
1496
LibraryCache->setSQL(SQLLibraryCache);
1497
Tabs->addTab(LibraryCache, tr("Library C&ache"));
1499
ControlFiles = new toResultLong(true, false, toQuery::Background, Tabs, "control");
1500
ControlFiles->setSQL(SQLControlFiles);
1501
Tabs->addTab(ControlFiles, tr("Control Files"));
1503
Options = new toResultLong(true, false, toQuery::Background, Tabs, "options");
1504
Options->setSQL(SQLOptions);
1505
Tabs->addTab(Options, tr("Optio&ns"));
1507
Licenses = new toResultItem(2, true, Tabs, "licenses");
1508
Licenses->setSQL(SQLLicense);
1509
Tabs->addTab(Licenses, tr("&Licenses"));
1511
Tabs->setCurrentPage(0);
1515
connect(Tabs, SIGNAL(currentChanged(QWidget *)), this, SLOT(changeTab(QWidget *)));
1517
connect(toMainWidget()->workspace(), SIGNAL(windowActivated(QWidget *)),
1518
this, SLOT(windowActivated(QWidget *)));
1520
std::list<QCString> tabs = TabList();
1521
for (std::list<QCString>::iterator i = tabs.begin();i != tabs.end();i++)
1522
if (TuningTool.config(*i, "").isEmpty())
1523
enableTab(*i, false);
1526
setFocusProxy(Tabs);
1529
QWidget *toTuning::tabWidget(const QCString &name)
1531
QWidget *widget = NULL;
1532
if (name == CONF_OVERVIEW)
1536
else if (name == CONF_FILEIO)
1540
else if (name == CONF_WAITS)
1544
else if (Charts.find(CONF_CHART + name) != Charts.end())
1546
widget = Charts[CONF_CHART + name];
1551
void toTuning::showTabMenu(void)
1555
std::list<QCString> tab = TabList();
1556
for (std::list<QCString>::iterator i = tab.begin();i != tab.end();i++)
1559
TabMenu->insertItem(tr(*i), id);
1560
QWidget *widget = tabWidget(*i);
1561
if (widget && Tabs->isTabEnabled(widget))
1562
TabMenu->setItemChecked(id, true);
1566
void toTuning::enableTabMenu(int selid)
1568
std::list<QCString> tab = TabList();
1570
for (std::list<QCString>::iterator i = tab.begin();i != tab.end();i++)
1575
QWidget *widget = tabWidget(*i);
1577
enableTab(*i, !Tabs->isTabEnabled(widget));
1583
void toTuning::enableTab(const QCString &name, bool enable)
1585
QWidget *widget = NULL;
1586
if (name == CONF_OVERVIEW)
1594
else if (Charts.find(QCString(CONF_CHART) + name) != Charts.end())
1596
QGrid *chart = Charts[QCString(CONF_CHART) + name];
1597
QObjectList *childs = (QObjectList *)chart->children();
1598
for (unsigned int i = 0;i < childs->count();i++)
1600
toResultLine *line = dynamic_cast<toResultLine *>(childs->at(i));
1608
toResultBar *bar = dynamic_cast<toResultBar *>(childs->at(i));
1616
toResultPie *pie = dynamic_cast<toResultPie *>(childs->at(i));
1627
else if (name == CONF_WAITS)
1635
else if (name == CONF_FILEIO)
1644
Tabs->setTabEnabled(widget, enable);
1647
void toTuning::changeTab(QWidget *widget)
1649
if (LastTab == widget)
1654
void toTuning::windowActivated(QWidget *widget)
1660
ToolMenu = new QPopupMenu(this);
1661
ToolMenu->insertItem(QPixmap(const_cast<const char**>(refresh_xpm)), tr("&Refresh"), this, SLOT(refresh(void)),
1662
toKeySequence(tr("F5", "Tuning|Refresh")));
1663
ToolMenu->insertItem(tr("&Change Refresh"), Refresh, SLOT(setFocus(void)),
1664
toKeySequence(tr("Alt+R", "Tuning|Change refresh")));
1665
toMainWidget()->menuBar()->insertItem(tr("&Tuning"), ToolMenu, -1, toToolMenuIndex());
1675
void toTuning::changeRefresh(const QString &str)
1679
toRefreshParse(timer(), str);
1684
void toTuning::refresh(void)
1686
LastTab = Tabs->currentPage();
1687
if (LastTab == Overview)
1689
Overview->refresh();
1691
else if (LastTab == Indicators)
1693
Indicators->clear();
1694
std::list<QCString> val = toSQL::range("toTuning:Indicators");
1695
QListViewItem *parent = NULL;
1696
QListViewItem *last = NULL;
1697
for (std::list<QCString>::iterator i = val.begin();i != val.end();i++)
1701
toQList val = toQuery::readQuery(connection(), toSQL::string(*i, connection()));
1702
QStringList parts = QStringList::split(QString::fromLatin1(":"), *i);
1703
if (!parent || parent->text(0) != parts[2])
1705
parent = new toResultViewItem(Indicators, NULL, parts[2]);
1706
parent->setOpen(true);
1709
QStringList dsc = QStringList::split(QString::fromLatin1("."), toSQL::description(*i));
1710
QString first = dsc[0];
1711
first += QString::fromLatin1(".");
1712
last = new toResultViewItem(parent, last, first);
1714
for (toQList::iterator j = val.begin();j != val.end();j++)
1716
last->setText(1, str);
1717
if (dsc.count() > 1)
1718
last->setText(2, dsc[1]);
1723
else if (LastTab == Waits)
1725
else if (LastTab == Statistics)
1726
Statistics->refreshStats();
1727
else if (LastTab == Parameters)
1728
Parameters->refresh();
1729
else if (LastTab == BlockingLocks)
1730
BlockingLocks->refresh();
1731
else if (LastTab == LibraryCache)
1732
LibraryCache->refresh();
1733
else if (LastTab == ControlFiles)
1735
QString unit = toConfigurationSingle::Instance().globalConfig(CONF_SIZE_UNIT, DEFAULT_SIZE_UNIT);
1736
ControlFiles->changeParams(QString::number(toSizeDecode(unit)), unit);
1738
else if (LastTab == Options)
1740
else if (LastTab == Licenses)
1741
Licenses->refresh();
1744
void toTuning::exportData(std::map<QCString, QString> &data, const QCString &prefix)
1746
toToolWidget::exportData(data, prefix);
1747
std::list<QCString> ret = TabList();
1748
for (std::list<QCString>::iterator i = ret.begin();i != ret.end();i++)
1750
QWidget *widget = tabWidget(*i);
1753
if (!Tabs->isTabEnabled(widget))
1754
data[prefix + ":" + *i] = QString::fromLatin1("Disabled");
1757
data[prefix + ":Current"] = Tabs->currentPage()->name();
1759
Waits->exportData(data, prefix + ":Waits");
1762
void toTuning::importData(std::map<QCString, QString> &data, const QCString &prefix)
1764
toToolWidget::importData(data, prefix);
1765
std::list<QCString> ret = TabList();
1766
for (std::list<QCString>::iterator i = ret.begin();i != ret.end();i++)
1767
enableTab(*i, data[prefix + ":" + (*i)].isEmpty());
1768
QWidget *chld = (QWidget *)child(data[prefix + ":Current"]);
1770
Tabs->showPage(chld);
1771
Waits->importData(data, prefix + ":Waits");
1774
static toSQL SQLFileIO("toTuning:FileIO",
1775
"select a.name,b.name,sysdate,\n"
1776
" c.phyrds,c.phywrts,c.phyblkrd,c.phyblkwrt,\n"
1777
" c.avgiotim*10,c.miniotim*10,c.maxiortm*10,c.maxiowtm*10\n"
1778
" from v$tablespace a,v$datafile b,v$filestat c\n"
1779
" where a.ts# = b.ts# and b.file# = c.file#\n"
1781
"select a.name,b.name,sysdate,\n"
1782
" c.phyrds,c.phywrts,c.phyblkrd,c.phyblkwrt,\n"
1783
" c.avgiotim*10,c.miniotim*10,c.maxiortm*10,c.maxiowtm*10\n"
1784
" from v$tablespace a,v$tempfile b,v$tempstat c\n"
1785
" where a.ts# = b.ts# and b.file# = c.file#\n"
1787
"Get file for files and tablespaces. Must have same columns.",
1790
static toSQL SQLFileIO8("toTuning:FileIO",
1791
"select a.name,b.name,sysdate,\n"
1792
" c.phyrds,c.phywrts,c.phyblkrd,c.phyblkwrt,\n"
1793
" c.avgiotim*10,c.miniotim*10,c.maxiortm*10,c.maxiowtm*10\n"
1794
" from v$tablespace a,v$datafile b,v$filestat c\n"
1795
" where a.ts# = b.ts# and b.file# = c.file#\n"
1800
toTuningFileIO::toTuningFileIO(QWidget *parent, const char *name, WFlags fl)
1801
: QScrollView(parent, name, fl)
1805
connect(toCurrentTool(this)->timer(), SIGNAL(timeout()), this, SLOT(refresh()));
1807
viewport()->setBackgroundColor(qApp->palette().active().background());
1809
QVBox *Box = new QVBox(this->viewport());
1812
QComboBox *combo = new QComboBox(Box);
1813
combo->insertItem(tr("File I/O"));
1814
combo->insertItem(tr("File timing"));
1815
if (toCurrentConnection(this).version() >= "0800")
1817
combo->insertItem(tr("Tablespace I/O"));
1818
combo->insertItem(tr("Tablespace timing"));
1820
connect(combo, SIGNAL(activated(int)), this, SLOT(changeCharts(int)));
1822
FileReads = new QGrid(2, Box);
1823
FileTime = new QGrid(2, Box);
1824
TablespaceReads = new QGrid(2, Box);
1825
TablespaceTime = new QGrid(2, Box);
1827
FileReads->setFixedWidth(viewport()->width() - 30);
1828
FileTime->setFixedWidth(viewport()->width() - 30);
1829
TablespaceReads->setFixedWidth(viewport()->width() - 30);
1830
TablespaceTime->setFixedWidth(viewport()->width() - 30);
1833
connect(&Poll, SIGNAL(timeout()), this, SLOT(poll()));
1840
toTuningFileIO::~toTuningFileIO()
1845
void toTuningFileIO::changeCharts(int val)
1849
TablespaceReads->hide();
1850
TablespaceTime->hide();
1860
TablespaceReads->show();
1863
TablespaceTime->show();
1868
void toTuningFileIO::allocCharts(const QString &name)
1870
std::list<QString> labels;
1871
labels.insert(labels.end(), tr("Reads"));
1872
labels.insert(labels.end(), tr("Blocks Read"));
1873
labels.insert(labels.end(), tr("Writes"));
1874
labels.insert(labels.end(), tr("Blocks Written"));
1875
std::list<QString> labelTime;
1876
labelTime.insert(labelTime.end(), tr("Average"));
1877
labelTime.insert(labelTime.end(), tr("Minimum"));
1878
labelTime.insert(labelTime.end(), tr("Maximum Read"));
1879
labelTime.insert(labelTime.end(), tr("Maximum Write"));
1881
toResultBar *barchart;
1882
if (name.startsWith(QString::fromLatin1("tspc:")))
1883
barchart = new toResultBar(TablespaceReads);
1885
barchart = new toResultBar(FileReads);
1886
ReadsCharts[name] = barchart;
1887
barchart->setTitle(name.mid(5));
1888
barchart->setMinimumSize(200, 170);
1889
barchart->setYPostfix(tr("blocks/s"));
1890
barchart->setLabels(labels);
1891
barchart->setSQLName(QString::fromLatin1("toTuning:FileIO:Reads:" + name));
1894
toResultLine *linechart;
1895
if (name.startsWith(QString::fromLatin1("tspc:")))
1896
linechart = new toResultLine(TablespaceTime);
1898
linechart = new toResultLine(FileTime);
1899
TimeCharts[name] = linechart;
1900
linechart->setTitle(name.mid(5));
1901
linechart->setMinimumSize(200, 170);
1902
linechart->setYPostfix(QString::fromLatin1("ms"));
1903
linechart->setLabels(labelTime);
1904
linechart->setSQLName(QString::fromLatin1("toTuning:FileIO:Time:" + name));
1908
void toTuningFileIO::saveSample(const QString &name, const QString &label,
1909
double reads, double writes,
1910
double readBlk, double writeBlk,
1911
double avgTim, double minTim,
1912
double maxRead, double maxWrite)
1914
if (CurrentStamp != LastStamp)
1917
std::list<double> vals;
1918
vals.insert(vals.end(), reads);
1919
vals.insert(vals.end(), writes);
1920
vals.insert(vals.end(), readBlk);
1921
vals.insert(vals.end(), writeBlk);
1923
std::list<double> last = LastValues[name];
1924
std::list<double> dispVal;
1927
std::list<double>::iterator i = vals.begin();
1928
std::list<double>::iterator j = last.begin();
1929
while (i != vals.end() && j != last.end())
1931
dispVal.insert(dispVal.end(), (*i - *j) / (CurrentStamp - LastStamp));
1936
LastValues[name] = vals;
1938
if (ReadsCharts.find(name) == ReadsCharts.end())
1941
if (!dispVal.empty())
1943
toBarChart *chart = ReadsCharts[name];
1944
chart->addValues(dispVal, label);
1948
vals.insert(vals.end(), avgTim);
1949
vals.insert(vals.end(), minTim);
1950
vals.insert(vals.end(), maxRead);
1951
vals.insert(vals.end(), maxWrite);
1953
toLineChart *chart = TimeCharts[name];
1954
chart->addValues(vals, label);
1958
void toTuningFileIO::refresh(void)
1964
toConnection &conn = toCurrentConnection(this);
1965
if (conn.version() < "0800")
1968
LastStamp = CurrentStamp;
1969
CurrentStamp = time(NULL);
1970
Query = new toNoBlockQuery(conn, toQuery::Background, toSQL::string(SQLFileIO, conn), par);
1971
LastTablespace = QString::null;
1979
void toTuningFileIO::poll(void)
1983
if (Query && Query->poll())
1988
while (Query->poll())
1992
tablespace = Query->readValueNull();
1993
datafile = Query->readValueNull();
1994
timestr = Query->readValueNull();
1997
tablespace = QString::null;
1998
if (tablespace != LastTablespace)
2000
if (!LastTablespace.isNull())
2002
QString name = QString::fromLatin1("tspc:");
2003
name += LastTablespace;
2005
saveSample(name, timestr,
2006
TblReads, TblWrites, TblReadBlk, TblWriteBlk,
2007
TblAvg, TblMin, TblMaxRead, TblMaxWrite);
2010
TblReads = TblWrites = TblReadBlk = TblWriteBlk = TblAvg = TblMin = TblMaxRead = TblMaxWrite = 0;
2011
LastTablespace = tablespace;
2016
double reads = Query->readValueNull().toDouble();
2017
double writes = Query->readValueNull().toDouble();
2018
double readBlk = Query->readValueNull().toDouble();
2019
double writeBlk = Query->readValueNull().toDouble();
2020
double avgTim = Query->readValueNull().toDouble();
2021
double minTim = Query->readValueNull().toDouble();
2022
double maxRead = Query->readValueNull().toDouble();
2023
double maxWrite = Query->readValueNull().toDouble();
2026
TblWrites += writes;
2027
TblReadBlk += readBlk;
2028
TblWriteBlk += writeBlk;
2031
TblMaxRead += maxRead;
2032
TblMaxWrite += maxWrite;
2034
QString name = QString::fromLatin1("file:");
2037
saveSample(name, timestr,
2038
reads, writes, readBlk, writeBlk,
2039
avgTim, minTim, maxRead, maxWrite);
2052
void toTuningFileIO::resizeEvent(QResizeEvent *e)
2054
QScrollView::resizeEvent(e);
2056
FileReads->setFixedWidth(viewport()->width() - 30);
2057
FileTime->setFixedWidth(viewport()->width() - 30);
2058
TablespaceReads->setFixedWidth(viewport()->width() - 30);
2059
TablespaceTime->setFixedWidth(viewport()->width() - 30);
2062
void toTuningFileIO::changeConnection(void)
2065
for (std::map<QString, toBarChart *>::iterator i = ReadsCharts.begin();
2066
i != ReadsCharts.end();i++)
2069
ReadsCharts.clear();
2070
for (std::map<QString, toLineChart *>::iterator i = TimeCharts.begin();
2071
i != TimeCharts.end();i++)
2078
toTuningMiss::toTuningMiss(QWidget *parent, const char *name)
2079
: toResultLine(parent, name)
2082
std::list<double> toTuningMiss::transform(std::list<double> &inp)
2084
std::list<double> ret;
2085
for (std::list<double>::iterator i = inp.begin();i != inp.end();i++)
2093
ret.insert(ret.end(), 0);
2095
ret.insert(ret.end(), first / second);
2101
void toTuningFileIO::stop(void)
2105
disconnect(toCurrentTool(this)->timer(), SIGNAL(timeout()), this, SLOT(refresh()));
2110
void toTuningFileIO::start(void)
2114
connect(toCurrentTool(this)->timer(), SIGNAL(timeout()), this, SLOT(refresh()));