@@ -19,10 +19,6 @@ import (
19
19
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/mysqlreceiver/internal/metadata"
20
20
)
21
21
22
- const (
23
- picosecondsInNanoseconds int64 = 1000
24
- )
25
-
26
22
type mySQLScraper struct {
27
23
sqlclient client
28
24
logger * zap.Logger
@@ -451,16 +447,16 @@ func (m *mySQLScraper) scrapeTableIoWaitsStats(now pcommon.Timestamp, errs *scra
451
447
452
448
// times
453
449
m .mb .RecordMysqlTableIoWaitTimeDataPoint (
454
- now , s .timeDelete / picosecondsInNanoseconds , metadata .AttributeIoWaitsOperationsDelete , s .name , s .schema ,
450
+ now , s .timeDelete , metadata .AttributeIoWaitsOperationsDelete , s .name , s .schema ,
455
451
)
456
452
m .mb .RecordMysqlTableIoWaitTimeDataPoint (
457
- now , s .timeFetch / picosecondsInNanoseconds , metadata .AttributeIoWaitsOperationsFetch , s .name , s .schema ,
453
+ now , s .timeFetch , metadata .AttributeIoWaitsOperationsFetch , s .name , s .schema ,
458
454
)
459
455
m .mb .RecordMysqlTableIoWaitTimeDataPoint (
460
- now , s .timeInsert / picosecondsInNanoseconds , metadata .AttributeIoWaitsOperationsInsert , s .name , s .schema ,
456
+ now , s .timeInsert , metadata .AttributeIoWaitsOperationsInsert , s .name , s .schema ,
461
457
)
462
458
m .mb .RecordMysqlTableIoWaitTimeDataPoint (
463
- now , s .timeUpdate / picosecondsInNanoseconds , metadata .AttributeIoWaitsOperationsUpdate , s .name , s .schema ,
459
+ now , s .timeUpdate , metadata .AttributeIoWaitsOperationsUpdate , s .name , s .schema ,
464
460
)
465
461
}
466
462
}
@@ -483,16 +479,16 @@ func (m *mySQLScraper) scrapeIndexIoWaitsStats(now pcommon.Timestamp, errs *scra
483
479
484
480
// times
485
481
m .mb .RecordMysqlIndexIoWaitTimeDataPoint (
486
- now , s .timeDelete / picosecondsInNanoseconds , metadata .AttributeIoWaitsOperationsDelete , s .name , s .schema , s .index ,
482
+ now , s .timeDelete , metadata .AttributeIoWaitsOperationsDelete , s .name , s .schema , s .index ,
487
483
)
488
484
m .mb .RecordMysqlIndexIoWaitTimeDataPoint (
489
- now , s .timeFetch / picosecondsInNanoseconds , metadata .AttributeIoWaitsOperationsFetch , s .name , s .schema , s .index ,
485
+ now , s .timeFetch , metadata .AttributeIoWaitsOperationsFetch , s .name , s .schema , s .index ,
490
486
)
491
487
m .mb .RecordMysqlIndexIoWaitTimeDataPoint (
492
- now , s .timeInsert / picosecondsInNanoseconds , metadata .AttributeIoWaitsOperationsInsert , s .name , s .schema , s .index ,
488
+ now , s .timeInsert , metadata .AttributeIoWaitsOperationsInsert , s .name , s .schema , s .index ,
493
489
)
494
490
m .mb .RecordMysqlIndexIoWaitTimeDataPoint (
495
- now , s .timeUpdate / picosecondsInNanoseconds , metadata .AttributeIoWaitsOperationsUpdate , s .name , s .schema , s .index ,
491
+ now , s .timeUpdate , metadata .AttributeIoWaitsOperationsUpdate , s .name , s .schema , s .index ,
496
492
)
497
493
}
498
494
}
@@ -518,7 +514,7 @@ func (m *mySQLScraper) scrapeStatementEventsStats(now pcommon.Timestamp, errs *s
518
514
m .mb .RecordMysqlStatementEventCountDataPoint (now , s .countSortRows , s .schema , s .digest , s .digestText , metadata .AttributeEventStateSortRows )
519
515
m .mb .RecordMysqlStatementEventCountDataPoint (now , s .countWarnings , s .schema , s .digest , s .digestText , metadata .AttributeEventStateWarnings )
520
516
521
- m .mb .RecordMysqlStatementEventWaitTimeDataPoint (now , s .sumTimerWait / picosecondsInNanoseconds , s .schema , s .digest , s .digestText )
517
+ m .mb .RecordMysqlStatementEventWaitTimeDataPoint (now , s .sumTimerWait , s .schema , s .digest , s .digestText )
522
518
}
523
519
}
524
520
@@ -540,11 +536,11 @@ func (m *mySQLScraper) scrapeTableLockWaitEventStats(now pcommon.Timestamp, errs
540
536
m .mb .RecordMysqlTableLockWaitReadCountDataPoint (now , s .countReadExternal , s .schema , s .name , metadata .AttributeReadLockTypeExternal )
541
537
542
538
// read time data points
543
- m .mb .RecordMysqlTableLockWaitReadTimeDataPoint (now , s .sumTimerReadNormal / picosecondsInNanoseconds , s .schema , s .name , metadata .AttributeReadLockTypeNormal )
544
- m .mb .RecordMysqlTableLockWaitReadTimeDataPoint (now , s .sumTimerReadWithSharedLocks / picosecondsInNanoseconds , s .schema , s .name , metadata .AttributeReadLockTypeWithSharedLocks )
545
- m .mb .RecordMysqlTableLockWaitReadTimeDataPoint (now , s .sumTimerReadHighPriority / picosecondsInNanoseconds , s .schema , s .name , metadata .AttributeReadLockTypeHighPriority )
546
- m .mb .RecordMysqlTableLockWaitReadTimeDataPoint (now , s .sumTimerReadNoInsert / picosecondsInNanoseconds , s .schema , s .name , metadata .AttributeReadLockTypeNoInsert )
547
- m .mb .RecordMysqlTableLockWaitReadTimeDataPoint (now , s .sumTimerReadExternal / picosecondsInNanoseconds , s .schema , s .name , metadata .AttributeReadLockTypeExternal )
539
+ m .mb .RecordMysqlTableLockWaitReadTimeDataPoint (now , s .sumTimerReadNormal , s .schema , s .name , metadata .AttributeReadLockTypeNormal )
540
+ m .mb .RecordMysqlTableLockWaitReadTimeDataPoint (now , s .sumTimerReadWithSharedLocks , s .schema , s .name , metadata .AttributeReadLockTypeWithSharedLocks )
541
+ m .mb .RecordMysqlTableLockWaitReadTimeDataPoint (now , s .sumTimerReadHighPriority , s .schema , s .name , metadata .AttributeReadLockTypeHighPriority )
542
+ m .mb .RecordMysqlTableLockWaitReadTimeDataPoint (now , s .sumTimerReadNoInsert , s .schema , s .name , metadata .AttributeReadLockTypeNoInsert )
543
+ m .mb .RecordMysqlTableLockWaitReadTimeDataPoint (now , s .sumTimerReadExternal , s .schema , s .name , metadata .AttributeReadLockTypeExternal )
548
544
549
545
// write data points
550
546
m .mb .RecordMysqlTableLockWaitWriteCountDataPoint (now , s .countWriteAllowWrite , s .schema , s .name , metadata .AttributeWriteLockTypeAllowWrite )
@@ -554,11 +550,11 @@ func (m *mySQLScraper) scrapeTableLockWaitEventStats(now pcommon.Timestamp, errs
554
550
m .mb .RecordMysqlTableLockWaitWriteCountDataPoint (now , s .countWriteExternal , s .schema , s .name , metadata .AttributeWriteLockTypeExternal )
555
551
556
552
// write time data points
557
- m .mb .RecordMysqlTableLockWaitWriteTimeDataPoint (now , s .sumTimerWriteAllowWrite / picosecondsInNanoseconds , s .schema , s .name , metadata .AttributeWriteLockTypeAllowWrite )
558
- m .mb .RecordMysqlTableLockWaitWriteTimeDataPoint (now , s .sumTimerWriteConcurrentInsert / picosecondsInNanoseconds , s .schema , s .name , metadata .AttributeWriteLockTypeConcurrentInsert )
559
- m .mb .RecordMysqlTableLockWaitWriteTimeDataPoint (now , s .sumTimerWriteLowPriority / picosecondsInNanoseconds , s .schema , s .name , metadata .AttributeWriteLockTypeLowPriority )
560
- m .mb .RecordMysqlTableLockWaitWriteTimeDataPoint (now , s .sumTimerWriteNormal / picosecondsInNanoseconds , s .schema , s .name , metadata .AttributeWriteLockTypeNormal )
561
- m .mb .RecordMysqlTableLockWaitWriteTimeDataPoint (now , s .sumTimerWriteExternal / picosecondsInNanoseconds , s .schema , s .name , metadata .AttributeWriteLockTypeExternal )
553
+ m .mb .RecordMysqlTableLockWaitWriteTimeDataPoint (now , s .sumTimerWriteAllowWrite , s .schema , s .name , metadata .AttributeWriteLockTypeAllowWrite )
554
+ m .mb .RecordMysqlTableLockWaitWriteTimeDataPoint (now , s .sumTimerWriteConcurrentInsert , s .schema , s .name , metadata .AttributeWriteLockTypeConcurrentInsert )
555
+ m .mb .RecordMysqlTableLockWaitWriteTimeDataPoint (now , s .sumTimerWriteLowPriority , s .schema , s .name , metadata .AttributeWriteLockTypeLowPriority )
556
+ m .mb .RecordMysqlTableLockWaitWriteTimeDataPoint (now , s .sumTimerWriteNormal , s .schema , s .name , metadata .AttributeWriteLockTypeNormal )
557
+ m .mb .RecordMysqlTableLockWaitWriteTimeDataPoint (now , s .sumTimerWriteExternal , s .schema , s .name , metadata .AttributeWriteLockTypeExternal )
562
558
}
563
559
}
564
560
0 commit comments