@@ -335,7 +335,7 @@ func makeMetrics(prefix string, m bson.M, labels map[string]string, compatibleMo
335
335
336
336
metrics := []* rawMetric {rm }
337
337
338
- if renamedMetrics := metricRenameAndLabel (rm , specialConversions () ); renamedMetrics != nil {
338
+ if renamedMetrics := metricRenameAndLabel (rm , specialConversions ); renamedMetrics != nil {
339
339
metrics = renamedMetrics
340
340
}
341
341
@@ -435,62 +435,60 @@ func metricRenameAndLabel(rm *rawMetric, convs []conversion) []*rawMetric {
435
435
436
436
// specialConversions returns a list of special conversions we want to implement.
437
437
// See: https://jira.percona.com/browse/PMM-6506
438
- func specialConversions () []conversion {
439
- return []conversion {
440
- {
441
- oldName : "mongodb_ss_opLatencies_ops" ,
442
- prefix : "mongodb_ss_opLatencies" ,
443
- suffixLabel : "op_type" ,
444
- suffixMapping : map [string ]string {
445
- "commands_ops" : "commands" ,
446
- "reads_ops" : "reads" ,
447
- "transactions_ops" : "transactions" ,
448
- "writes_ops" : "writes" ,
449
- },
438
+ var specialConversions = []conversion { //nolint:gochecknoglobals
439
+ {
440
+ oldName : "mongodb_ss_opLatencies_ops" ,
441
+ prefix : "mongodb_ss_opLatencies" ,
442
+ suffixLabel : "op_type" ,
443
+ suffixMapping : map [string ]string {
444
+ "commands_ops" : "commands" ,
445
+ "reads_ops" : "reads" ,
446
+ "transactions_ops" : "transactions" ,
447
+ "writes_ops" : "writes" ,
450
448
},
451
- {
452
- oldName : "mongodb_ss_opLatencies_latency" ,
453
- prefix : "mongodb_ss_opLatencies " ,
454
- suffixLabel : "op_type " ,
455
- suffixMapping : map [ string ] string {
456
- "commands_latency" : "commands" ,
457
- "reads_latency " : "reads " ,
458
- "transactions_latency " : "transactions " ,
459
- "writes_latency " : "writes " ,
460
- } ,
449
+ },
450
+ {
451
+ oldName : "mongodb_ss_opLatencies_latency " ,
452
+ prefix : "mongodb_ss_opLatencies " ,
453
+ suffixLabel : "op_type" ,
454
+ suffixMapping : map [ string ] string {
455
+ "commands_latency " : "commands " ,
456
+ "reads_latency " : "reads " ,
457
+ "transactions_latency " : "transactions " ,
458
+ "writes_latency" : "writes" ,
461
459
},
462
- // mongodb_ss_wt_concurrentTransactions_read_out
463
- // mongodb_ss_wt_concurrentTransactions_write_out
464
- {
465
- oldName : "mongodb_ss_wt_concurrentTransactions_out" ,
466
- prefix : "mongodb_ss_wt_concurrentTransactions " ,
467
- suffixLabel : "txn_rw " ,
468
- suffixMapping : map [ string ] string {
469
- "read_out" : "read" ,
470
- "write_out " : "write " ,
471
- } ,
460
+ },
461
+ // mongodb_ss_wt_concurrentTransactions_read_out
462
+ // mongodb_ss_wt_concurrentTransactions_write_out
463
+ {
464
+ oldName : "mongodb_ss_wt_concurrentTransactions_out " ,
465
+ prefix : "mongodb_ss_wt_concurrentTransactions " ,
466
+ suffixLabel : "txn_rw" ,
467
+ suffixMapping : map [ string ] string {
468
+ "read_out " : "read " ,
469
+ "write_out" : "write" ,
472
470
},
473
- // mongodb_ss_wt_concurrentTransactions_read_available
474
- // mongodb_ss_wt_concurrentTransactions_write_available
475
- {
476
- oldName : "mongodb_ss_wt_concurrentTransactions_available" ,
477
- prefix : "mongodb_ss_wt_concurrentTransactions " ,
478
- suffixLabel : "txn_rw " ,
479
- suffixMapping : map [ string ] string {
480
- "read_available" : "read" ,
481
- "write_available " : "write " ,
482
- } ,
471
+ },
472
+ // mongodb_ss_wt_concurrentTransactions_read_available
473
+ // mongodb_ss_wt_concurrentTransactions_write_available
474
+ {
475
+ oldName : "mongodb_ss_wt_concurrentTransactions_available " ,
476
+ prefix : "mongodb_ss_wt_concurrentTransactions " ,
477
+ suffixLabel : "txn_rw" ,
478
+ suffixMapping : map [ string ] string {
479
+ "read_available " : "read " ,
480
+ "write_available" : "write" ,
483
481
},
484
- // mongodb_ss_wt_concurrentTransactions_read_totalTickets
485
- // mongodb_ss_wt_concurrentTransactions_write_totalTickets
486
- {
487
- oldName : "mongodb_ss_wt_concurrentTransactions_totalTickets" ,
488
- prefix : "mongodb_ss_wt_concurrentTransactions " ,
489
- suffixLabel : "txn_rw " ,
490
- suffixMapping : map [ string ] string {
491
- "read_totalTickets" : "read" ,
492
- "write_totalTickets " : "write " ,
493
- } ,
482
+ },
483
+ // mongodb_ss_wt_concurrentTransactions_read_totalTickets
484
+ // mongodb_ss_wt_concurrentTransactions_write_totalTickets
485
+ {
486
+ oldName : "mongodb_ss_wt_concurrentTransactions_totalTickets " ,
487
+ prefix : "mongodb_ss_wt_concurrentTransactions " ,
488
+ suffixLabel : "txn_rw" ,
489
+ suffixMapping : map [ string ] string {
490
+ "read_totalTickets " : "read " ,
491
+ "write_totalTickets" : "write" ,
494
492
},
495
- }
493
+ },
496
494
}
0 commit comments