|
40 | 40 |
|
41 | 41 | @Slf4j(topic = "metric") |
42 | 42 | public class PrometheusApiServiceTest extends BaseTest { |
| 43 | + |
| 44 | + private static final String MINER_LABEL = "miner"; |
| 45 | + |
43 | 46 | static LocalDateTime localDateTime = LocalDateTime.now(); |
44 | 47 | @Resource |
45 | 48 | private DposSlot dposSlot; |
@@ -87,7 +90,7 @@ protected void check(byte[] address, Map<ByteString, String> witnessAndAccount) |
87 | 90 | // Query histogram bucket le="0.0" for empty blocks |
88 | 91 | Double emptyBlock = CollectorRegistry.defaultRegistry.getSampleValue( |
89 | 92 | "tron:block_transaction_count_bucket", |
90 | | - new String[] {"miner", "le"}, new String[] {minerBase58, "0.0"}); |
| 93 | + new String[] {MINER_LABEL, "le"}, new String[] {minerBase58, "0.0"}); |
91 | 94 |
|
92 | 95 | Assert.assertNotNull("Empty block bucket should exist for miner: " + minerBase58, emptyBlock); |
93 | 96 | Assert.assertEquals("Should have 1 empty block", 1, emptyBlock.intValue()); |
@@ -125,7 +128,7 @@ protected void check(byte[] address, Map<ByteString, String> witnessAndAccount) |
125 | 128 | // Collect empty blocks count from histogram bucket |
126 | 129 | Double witnessEmptyBlock = CollectorRegistry.defaultRegistry.getSampleValue( |
127 | 130 | "tron:block_transaction_count_bucket", |
128 | | - new String[] {"miner", "le"}, new String[] {witnessBase58, "0.0"}); |
| 131 | + new String[] {MINER_LABEL, "le"}, new String[] {witnessBase58, "0.0"}); |
129 | 132 | Assert.assertNotNull("Empty block bucket should exist for witness: " + witnessBase58, |
130 | 133 | witnessEmptyBlock); |
131 | 134 | totalNewWitnessEmptyBlocks += witnessEmptyBlock; |
|
0 commit comments