-
Notifications
You must be signed in to change notification settings - Fork 9
/
query.hpp
38 lines (34 loc) · 1.06 KB
/
query.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#ifndef QUERY_H
#define QUERY_H
#include <QObject>
#include <QHash>
#include <QRegExp>
#include <QStringList>
class Query : public QObject{
public:
Query(QString normalized_statement, QString statement, QString user, QString database, uint duration);
void setStatement(QString statement);
void setUser(QString user);
void setDatabase(QString database);
void addStatement(uint duration, QString statement);
QString getStatement(){return statement;}
QString getUser(){return user;}
QString getDatabase(){return database;}
QList<uint> getDurations(){return durations;}
QStringList getExamples(){return examples;}
uint getTotalDuration(){return totalDuration;}
uint getAverageDuration();
uint getExecutions(){return executions;}
static QString normalize(QString statement);
static QString format(QString statement);
private:
QString statement;
QString user;
QString database;
QList<uint> durations;
QStringList examples;
uint executions;
uint totalDuration;
void init();
};
#endif // QUERY_H