-
Notifications
You must be signed in to change notification settings - Fork 11
/
profile.go
38 lines (34 loc) · 1.07 KB
/
profile.go
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
package chconn
// Profile detail of profile select query
type Profile struct {
Rows uint64
Blocks uint64
Bytes uint64
RowsBeforeLimit uint64
AppliedLimit uint8
CalculatedRowsBeforeLimit uint8
}
func newProfile() *Profile {
return &Profile{}
}
func (p *Profile) read(ch *conn) (err error) {
if p.Rows, err = ch.reader.Uvarint(); err != nil {
return &readError{"profile: read Rows", err}
}
if p.Blocks, err = ch.reader.Uvarint(); err != nil {
return &readError{"profile: read Blocks", err}
}
if p.Bytes, err = ch.reader.Uvarint(); err != nil {
return &readError{"profile: read Bytes", err}
}
if p.AppliedLimit, err = ch.reader.ReadByte(); err != nil {
return &readError{"profile: read AppliedLimit", err}
}
if p.RowsBeforeLimit, err = ch.reader.Uvarint(); err != nil {
return &readError{"profile: read RowsBeforeLimit", err}
}
if p.CalculatedRowsBeforeLimit, err = ch.reader.ReadByte(); err != nil {
return &readError{"profile: read CalculatedRowsBeforeLimit", err}
}
return nil
}