~ubuntu-branches/ubuntu/wily/tora/wily-proposed

« back to all changes in this revision

Viewing changes to src/totuning.h

  • Committer: Bazaar Package Importer
  • Author(s): Michael Meskes
  • Date: 2009-04-07 13:16:05 UTC
  • mfrom: (1.2.7 upstream) (3.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20090407131605-u422yigfv7jgg0l0
Tags: 2.0.0-3
* Cleaned up packaging a little bit.
* Added homepage information to control file.
* Bumped Standards-Version to 3.8.1.
* Released to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*****
2
 
*
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
6
 
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.
11
 
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.
16
 
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.
20
 
*
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.
25
 
*
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.
31
 
*
32
 
*      You may link this product with any GPL'd Qt library such as Qt/Free
33
 
*
34
 
* All trademarks belong to their respective owners.
35
 
*
36
 
*****/
 
1
 
 
2
/* BEGIN_COMMON_COPYRIGHT_HEADER
 
3
 *
 
4
 * TOra - An Oracle Toolkit for DBA's and developers
 
5
 * 
 
6
 * Shared/mixed copyright is held throughout files in this product
 
7
 * 
 
8
 * Portions Copyright (C) 2000-2001 Underscore AB
 
9
 * Portions Copyright (C) 2003-2005 Quest Software, Inc.
 
10
 * Portions Copyright (C) 2004-2008 Numerous Other Contributors
 
11
 * 
 
12
 * This program is free software; you can redistribute it and/or
 
13
 * modify it under the terms of the GNU General Public License
 
14
 * as published by the Free Software Foundation;  only version 2 of
 
15
 * the License is valid for this program.
 
16
 * 
 
17
 * This program is distributed in the hope that it will be useful,
 
18
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
19
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
20
 * GNU General Public License for more details.
 
21
 * 
 
22
 * You should have received a copy of the GNU General Public License
 
23
 * along with this program; if not, write to the Free Software
 
24
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
25
 * 
 
26
 *      As a special exception, you have permission to link this program
 
27
 *      with the Oracle Client libraries and distribute executables, as long
 
28
 *      as you follow the requirements of the GNU GPL in regard to all of the
 
29
 *      software in the executable aside from Oracle client libraries.
 
30
 * 
 
31
 *      Specifically you are not permitted to link this program with the
 
32
 *      Qt/UNIX, Qt/Windows or Qt Non Commercial products of TrollTech.
 
33
 *      And you are not permitted to distribute binaries compiled against
 
34
 *      these libraries. 
 
35
 * 
 
36
 *      You may link this product with any GPL'd Qt library.
 
37
 * 
 
38
 * All trademarks belong to their respective owners.
 
39
 *
 
40
 * END_COMMON_COPYRIGHT_HEADER */
37
41
 
38
42
#ifndef TOTUNING_H
39
43
#define TOTUNING_H
41
45
#include "config.h"
42
46
#include "tobackground.h"
43
47
#include "toresultline.h"
44
 
//#include "tothread.h"
45
48
#include "totool.h"
46
 
#include "totuningoverviewui.h"
 
49
#include "tothread.h"
 
50
#include "ui_totuningoverviewui.h"
47
51
 
48
52
#include <list>
49
53
#include <map>
50
54
 
51
 
//#include <qgrid.h>
52
 
#include <qscrollview.h>
 
55
#include <QString>
 
56
#include <QResizeEvent>
 
57
#include <QLabel>
 
58
#include <QScrollArea>
 
59
#include <QList>
53
60
 
 
61
class QAction;
 
62
class QMenu;
54
63
class QComboBox;
55
 
class QGrid;
56
 
//class QGridLayout;
 
64
class QWidget;
57
65
class QLabel;
58
 
class QPopupMenu;
59
66
class QTabWidget;
60
67
class toBarChart;
61
68
class toConnection;
62
 
//class toLegendChart;
63
69
class toListView;
64
70
class toNoBlockQuery;
65
 
//class toPieChart;
66
 
//class toResultChart;
67
71
class toResultItem;
68
72
class toResultLock;
69
 
class toResultLong;
 
73
class toResultTableView;
70
74
class toResultParam;
71
75
class toResultStats;
72
76
class toWaitEvents;
78
82
    virtual std::list<double> transform(std::list<double> &trans);
79
83
};
80
84
 
81
 
class toTuningFileIO : public QScrollView
 
85
class toTuningFileIO : public QWidget
82
86
{
83
87
    Q_OBJECT
84
88
 
85
 
    QGrid *TablespaceTime;
86
 
    QGrid *TablespaceReads;
87
 
    QGrid *FileTime;
88
 
    QGrid *FileReads;
 
89
    QWidget *TablespaceTime;
 
90
    QWidget *TablespaceReads;
 
91
    QWidget *FileTime;
 
92
    QWidget *FileReads;
89
93
 
90
94
    QString LastTablespace;
91
95
    double TblReads;
103
107
    std::map<QString, toBarChart *> ReadsCharts;
104
108
    std::map<QString, toLineChart *> TimeCharts;
105
109
    std::map<QString, std::list<double> > LastValues;
106
 
    virtual void resizeEvent(QResizeEvent *e);
107
110
 
108
111
    void saveSample(const QString &, const QString &,
109
112
                    double reads, double writes,
115
118
 
116
119
    toBackground Poll;
117
120
public:
118
 
    toTuningFileIO(QWidget *parent = 0, const char *name = 0, WFlags fl = 0);
 
121
    toTuningFileIO(QWidget *parent = 0);
119
122
    ~toTuningFileIO();
120
123
 
121
124
    void stop(void);
127
130
    void poll(void);
128
131
};
129
132
 
130
 
class toTuningOverview : public toTuningOverviewUI
 
133
class toTuningOverview : public QWidget, public Ui::toTuningOverviewUI
131
134
{
132
135
    Q_OBJECT
133
136
 
134
137
    bool Quit;
135
138
    toSemaphore Done;
136
 
    std::map<QCString, QString> Values;
 
139
    std::map<QString, QString> Values;
137
140
    toConnection *Connection;
138
141
    toLock Lock;
139
142
    QString UnitString;
145
148
                : Parent(parent)
146
149
        { }
147
150
        virtual void run(void);
148
 
        void setValue(const QCString &name, const QString &val);
 
151
        void setValue(const QString &name, const QString &val);
149
152
    };
150
153
 
151
154
    friend struct overviewQuery;
154
157
 
155
158
    std::list<QLabel *> Backgrounds;
156
159
    void setupChart(toResultLine *chart, const QString &, const QString &, const toSQL &sql);
157
 
    void setValue(QLabel *label, const QCString &val);
 
160
    void setValue(QLabel *label, const QString &val);
158
161
public:
159
 
    toTuningOverview(QWidget *parent = 0, const char *name = 0, WFlags fl = 0);
 
162
    toTuningOverview(QWidget *parent = 0, const char *name = 0, Qt::WFlags fl = 0);
160
163
    ~toTuningOverview();
161
164
    void stop(void);
162
165
    void start(void);
170
173
{
171
174
    Q_OBJECT
172
175
 
173
 
    QPopupMenu *TabMenu;
174
 
    QToolButton *TabButton;
175
 
 
176
 
    QPopupMenu *ToolMenu;
177
 
    QTabWidget *Tabs;
178
 
    toListView *Indicators;
179
 
    toResultParam *Parameters;
180
 
    toResultLong *Options;
181
 
    toResultLock *BlockingLocks;
182
 
    toResultItem *Licenses;
183
 
    toResultStats *Statistics;
184
 
    toResultLong *LibraryCache;
185
 
    toResultLong *ControlFiles;
186
 
    toWaitEvents *Waits;
187
 
 
188
 
    std::map<QCString, QGrid *> Charts;
189
 
 
190
 
    QComboBox *Refresh;
 
176
    QTabWidget        *Tabs;
 
177
    toListView        *Indicators;
 
178
    toResultParam     *Parameters;
 
179
    toResultTableView *Options;
 
180
    toResultLock      *BlockingLocks;
 
181
    toResultItem      *Licenses;
 
182
    toResultStats     *Statistics;
 
183
    toResultTableView *LibraryCache;
 
184
    toResultTableView *ControlFiles;
 
185
    toWaitEvents      *Waits;
 
186
    QScrollArea       *ChartContainer;
 
187
 
 
188
    QList<QWidget *> Charts;
 
189
 
 
190
    QComboBox        *Refresh;
191
191
    toTuningOverview *Overview;
192
 
    toTuningFileIO *FileIO;
193
 
    QWidget *LastTab;
194
 
 
195
 
    virtual void enableTab(const QCString &name, bool enable);
196
 
    virtual QWidget *tabWidget(const QCString &name);
197
 
 
198
 
    virtual void exportData(std::map<QCString, QString> &data, const QCString &prefix);
199
 
    virtual void importData(std::map<QCString, QString> &data, const QCString &prefix);
 
192
    toTuningFileIO   *FileIO;
 
193
    QWidget          *LastTab;
 
194
 
 
195
    QMenu   *ToolMenu;
 
196
    QAction *refreshAct;
 
197
    QAction *changeRefreshAct;
 
198
    QMenu   *tabMenu;
 
199
 
 
200
    virtual void enableTab(const QString &name, bool enable);
 
201
    virtual QWidget *tabWidget(const QString &name);
 
202
 
 
203
    virtual void exportData(std::map<QString, QString> &data, const QString &prefix);
 
204
    virtual void importData(std::map<QString, QString> &data, const QString &prefix);
 
205
 
200
206
public:
201
207
    toTuning(QWidget *parent, toConnection &connection);
 
208
 
202
209
public slots:
203
210
    virtual void refresh(void);
204
 
    virtual void changeTab(QWidget *widget);
 
211
    virtual void changeTab(int);
205
212
    virtual void changeRefresh(const QString &str);
206
 
    virtual void windowActivated(QWidget *widget);
 
213
    virtual void windowActivated(QMdiSubWindow *widget);
207
214
 
208
215
    virtual void showTabMenu(void);
209
 
    virtual void enableTabMenu(int);
 
216
    virtual void enableTabMenu(QAction *);
210
217
};
211
218
 
212
219
#endif