mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-16 00:03:02 +00:00
support versions less than 3.2.0
docsExamined is renamed from nscannedObjects in 3.2.0.
This commit is contained in:
@@ -2,11 +2,13 @@ package proto
|
|||||||
|
|
||||||
import "time"
|
import "time"
|
||||||
|
|
||||||
|
// docsExamined is renamed from nscannedObjects in 3.2.0
|
||||||
type SystemProfile struct {
|
type SystemProfile struct {
|
||||||
AllUsers []interface{} `bson:"allUsers"`
|
AllUsers []interface{} `bson:"allUsers"`
|
||||||
Client string `bson:"client"`
|
Client string `bson:"client"`
|
||||||
CursorExhausted bool `bson:"cursorExhausted"`
|
CursorExhausted bool `bson:"cursorExhausted"`
|
||||||
DocsExamined int `bson:"docsExamined"`
|
DocsExamined int `bson:"docsExamined"`
|
||||||
|
NscannedObjects int `bson:"nscannedObjects"`
|
||||||
ExecStats struct {
|
ExecStats struct {
|
||||||
Advanced int `bson:"advanced"`
|
Advanced int `bson:"advanced"`
|
||||||
ExecutionTimeMillisEstimate int `bson:"executionTimeMillisEstimate"`
|
ExecutionTimeMillisEstimate int `bson:"executionTimeMillisEstimate"`
|
||||||
|
@@ -91,7 +91,12 @@ func (s *Stats) Add(doc proto.SystemProfile) error {
|
|||||||
s.setQueryInfoAndCounters(key, qiac)
|
s.setQueryInfoAndCounters(key, qiac)
|
||||||
}
|
}
|
||||||
qiac.Count++
|
qiac.Count++
|
||||||
qiac.NScanned = append(qiac.NScanned, float64(doc.DocsExamined))
|
// docsExamined is renamed from nscannedObjects in 3.2.0.
|
||||||
|
if doc.NscannedObjects > 0 {
|
||||||
|
qiac.NScanned = append(qiac.NScanned, float64(doc.NscannedObjects))
|
||||||
|
} else {
|
||||||
|
qiac.NScanned = append(qiac.NScanned, float64(doc.DocsExamined))
|
||||||
|
}
|
||||||
qiac.NReturned = append(qiac.NReturned, float64(doc.Nreturned))
|
qiac.NReturned = append(qiac.NReturned, float64(doc.Nreturned))
|
||||||
qiac.QueryTime = append(qiac.QueryTime, float64(doc.Millis))
|
qiac.QueryTime = append(qiac.QueryTime, float64(doc.Millis))
|
||||||
qiac.ResponseLength = append(qiac.ResponseLength, float64(doc.ResponseLength))
|
qiac.ResponseLength = append(qiac.ResponseLength, float64(doc.ResponseLength))
|
||||||
|
Reference in New Issue
Block a user