@@ -269,13 +269,16 @@ func (g GroupKey) String() string {
269
269
}
270
270
271
271
type totalCounters struct {
272
- Count int
273
- Scanned float64
274
- Returned float64
275
- QueryTime float64
276
- Bytes float64
277
- DocsExamined float64
278
- KeysExamined float64
272
+ Count int
273
+ Scanned float64
274
+ Returned float64
275
+ QueryTime float64
276
+ Bytes float64
277
+ DocsExamined float64
278
+ KeysExamined float64
279
+ LocksDatabaseTimeAcquiringMicrosReadShared float64
280
+ StorageBytesRead float64
281
+ StorageTimeReadingMicros float64
279
282
}
280
283
281
284
type QueryStats struct {
@@ -389,10 +392,19 @@ func countersToStats(query QueryInfoAndCounters, uptime int64, tc totalCounters)
389
392
queryStats .Ratio = queryStats .Scanned .Total / queryStats .Returned .Total
390
393
}
391
394
if tc .DocsExamined > 0 {
392
- queryStats .DocsExamined .Pct = queryStats .DocsExamined .Total / tc .DocsExamined
395
+ queryStats .DocsExamined .Pct = queryStats .DocsExamined .Total * 100 / tc .DocsExamined
393
396
}
394
397
if tc .KeysExamined > 0 {
395
- queryStats .KeysExamined .Pct = queryStats .KeysExamined .Total / tc .KeysExamined
398
+ queryStats .KeysExamined .Pct = queryStats .KeysExamined .Total * 100 / tc .KeysExamined
399
+ }
400
+ if tc .LocksDatabaseTimeAcquiringMicrosReadShared > 0 {
401
+ queryStats .LocksDatabaseTimeAcquiringMicrosReadShared .Pct = queryStats .LocksDatabaseTimeAcquiringMicrosReadShared .Total * 100 / tc .LocksDatabaseTimeAcquiringMicrosReadShared
402
+ }
403
+ if tc .StorageBytesRead > 0 {
404
+ queryStats .StorageBytesRead .Pct = queryStats .StorageBytesRead .Total * 100 / tc .StorageBytesRead
405
+ }
406
+ if tc .StorageTimeReadingMicros > 0 {
407
+ queryStats .StorageTimeReadingMicros .Pct = queryStats .StorageTimeReadingMicros .Total * 100 / tc .StorageTimeReadingMicros
396
408
}
397
409
398
410
return queryStats
@@ -407,6 +419,9 @@ func aggregateCounters(queries []QueryInfoAndCounters) QueryInfoAndCounters {
407
419
qt .ResponseLength = append (qt .ResponseLength , query .ResponseLength ... )
408
420
qt .DocsExamined = append (qt .DocsExamined , query .DocsExamined ... )
409
421
qt .KeysExamined = append (qt .KeysExamined , query .KeysExamined ... )
422
+ qt .LocksDatabaseTimeAcquiringMicrosReadShared = append (qt .LocksDatabaseTimeAcquiringMicrosReadShared , query .LocksDatabaseTimeAcquiringMicrosReadShared ... )
423
+ qt .StorageBytesRead = append (qt .StorageBytesRead , query .StorageBytesRead ... )
424
+ qt .StorageTimeReadingMicros = append (qt .StorageTimeReadingMicros , query .StorageTimeReadingMicros ... )
410
425
}
411
426
return qt
412
427
}
@@ -431,6 +446,15 @@ func calcTotalCounters(queries []QueryInfoAndCounters) totalCounters {
431
446
432
447
keysExamined , _ := stats .Sum (query .KeysExamined )
433
448
tc .KeysExamined += keysExamined
449
+
450
+ locksDatabaseTimeAcquiringMicrosReadShared , _ := stats .Sum (query .LocksDatabaseTimeAcquiringMicrosReadShared )
451
+ tc .LocksDatabaseTimeAcquiringMicrosReadShared += locksDatabaseTimeAcquiringMicrosReadShared
452
+
453
+ storageBytesRead , _ := stats .Sum (query .StorageBytesRead )
454
+ tc .StorageBytesRead += storageBytesRead
455
+
456
+ storageTimeReadingMicros , _ := stats .Sum (query .StorageTimeReadingMicros )
457
+ tc .StorageTimeReadingMicros += storageTimeReadingMicros
434
458
}
435
459
return tc
436
460
}
0 commit comments