Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add metric parser #110

Merged
merged 6 commits into from
Oct 2, 2023
Merged

feat: Add metric parser #110

merged 6 commits into from
Oct 2, 2023

Conversation

pepoviola
Copy link
Collaborator

Add metric parser (for prometheus exposed metrics implemented in the nodes) supporting the same key lookup of zombienet v1. As next step we should add an api to the node (NetworkNode) instance to allow easily query the metrics like

node.reports("metric-name") -> f64
node.assert_metric("metric-name", value) -> bool

(this should be in a follow-up pr)
Thx!

@github-actions
Copy link

Coverage after merging feat/add-metric-parser into main

78.72%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
crates/configuration/src
   global_settings.rs99.12%100%96.43%99.50%
   hrmp_channel.rs95.88%100%89.47%97.44%
   network.rs99.34%100%97.78%99.49%111, 116, 124, 80
   parachain.rs98.82%100%97.06%99.02%51–53, 67–70
   relaychain.rs98.99%100%95.38%99.44%
   utils.rs100%100%100%100%
crates/configuration/src/shared
   errors.rs50%100%50%50%
   helpers.rs100%100%100%100%
   node.rs98.32%100%92.68%98.93%124, 130
   resources.rs96.09%100%94.52%96.43%102, 114, 126–128, 147–150
   types.rs91.20%100%86.14%92.69%279–281, 350–352, 375–376, 378–380, 60–62
crates/orchestrator/src
   errors.rs0%100%0%0%8
   lib.rs0%100%0%0%100–102, 106–109, 111–117, 119, 123, 125–140, 143–168, 172–181, 184–192, 194, 196–200, 203–220, 222–227, 229–238, 241–247, 250, 253–262, 265–269, 272, 274–287, 289–291, 294–298, 300, 302–315, 317–320, 322–324, 335–336, 346, 353–355, 357–366, 368–369, 371–379, 381–388, 390–397, 399, 40, 400–409, 41, 410, 413, 42–45, 47–52, 54–60, 62–67, 70, 72–86, 92–97, 99
   network.rs0%100%0%0%100–108, 111–117, 119–127, 130–154, 156, 158–167, 170, 172–176, 185–189, 191, 193, 195–199, 201, 203, 205–213, 215, 217, 220–225, 227–229, 231–233, 235–237, 239–241, 243–245, 247–249, 251–253, 32–40, 43, 56–70, 77–82, 85–94, 96, 98–99
   network_spec.rs96.25%100%91.67%97.06%38
   spawner.rs0%100%0%0%100–103, 105, 109–111, 114–116, 118, 124–144, 146, 148–164, 17, 37–50, 52–53, 55, 57–60, 64–65, 67, 70–90, 92–99
crates/orchestrator/src/generators
   bootnode_addr.rs97.20%100%100%96.84%
   chain_spec.rs3.90%100%8.33%3.48%100–111, 113–128, 130, 135–146, 149–155, 157–159, 162–190, 192–195, 197–199, 201–214, 216–218, 221–223, 225, 227–239, 241, 244–249, 251–252, 254–267, 269, 272–277, 279–280, 283–296, 298–303, 305–307, 309–311, 315–344, 347, 350–353, 356, 358–359, 361–376, 378, 38, 380–381, 386–427, 438–446, 456–464, 466–478, 480–488, 491–493, 497–500, 502–503, 508–519, 523–539, 541, 544–545, 548, 550–556, 558–563, 569–574, 576, 578, 580–587, 589–592, 595–596, 599–601, 603–604, 606–608, 610–612, 614–616, 619–621, 624–628, 630, 632–640, 642–643, 648–655, 657–667, 671–674, 676, 678, 680–685, 687–697, 699–715, 717–724, 726, 730–749, 75, 750–751, 753, 76, 762–769, 77, 770–772, 774, 776–794, 796–800, 802, 804, 84–87, 95–99
   command.rs0%100%0%0%100–112, 114–120, 122, 125–130, 132–133, 136–148, 15, 150, 153–155, 157–158, 16, 161–169, 17, 170–179, 18, 180–189, 19, 190–197, 199, 20, 201, 203–209, 21, 210–219, 22, 220–224, 226–229, 23, 231–233, 235–239, 24, 240–243, 246–250, 252–256, 258, 261–269, 271, 274–290, 293–298, 300, 303–305, 307–308, 311–333, 335, 337, 44–62, 64–66, 68–76, 79–97
   errors.rs0%100%0%0%4
   identity.rs82.35%100%60%86.21%13
   key.rs95.05%100%84.62%96.59%31
   keystore.rs0%100%0%0%19–26, 28–31, 34–46, 48–55, 57–64, 66, 68–86
   para_artifact.rs24.64%100%40%22.03%44–46, 48–64, 66–69, 72–81, 83–88, 92–93
   port.rs93.75%100%83.33%96.15%
crates/orchestrator/src/network
   node.rs0%100%0%0%17–29, 33–41, 5
   parachain.rs0%100%0%0%15–23, 25–37, 5
   relaychain.rs0%100%0%0%14–21, 5
crates/orchestrator/src/network_spec
   node.rs40.83%100%33.33%41.23%108, 146–150, 152–153, 155, 158, 160–163, 165–168, 173–178, 180, 183, 185–215, 217, 90–91, 93–96
   parachain.rs73.91%100%75%73.86%104, 122, 127–130, 133, 144–147, 150, 68–70, 73, 75–77, 83, 92, 97
   relaychain.rs91.80%100%83.33%92.73%67, 90, 97
crates/orchestrator/src/shared
   types.rs47.37%100%38.46%52%43–47, 50
crates/prom-metrics-parser/src
   lib.rs91.94%100%80%92.98%105, 127, 55–57, 7, 81
crates/provider/src
   lib.rs25%100%0%50%
   native.rs90.35%100%81.88%91.46%1020, 1024, 1057, 1066, 1087, 1094, 1125, 1152, 1176, 1181, 1209, 1235, 1245, 1252, 1269, 1319, 132, 1376–1378, 1423, 1499–1500, 1524, 155, 1565, 190–194, 262, 281, 294, 296, 303, 305–306, 319, 341, 355–357, 359–361, 363–365, 387–389, 391–393, 41, 434, 454, 49, 503, 515, 552, 581–582, 587–589, 707, 799, 806, 811, 816, 821, 828, 841, 90, 912, 936, 941, 945, 974, 990
crates/provider/src/shared
   types.rs84.47%100%74.29%86.41%123, 140–146, 15–18, 230, 249–256, 79
crates/support/src
   fs.rs75%100%66.67%80%
   net.rs0%100%0%0%10, 4–9
crates/support/src/fs
   in_memory.rs95.55%100%96.48%95.37%149, 271, 321, 372, 424, 432, 440, 448, 470, 478, 593, 615, 643, 660, 678, 685, 704, 731, 748, 79–82, 84, 86–89, 91, 96
   local.rs98.25%100%96.30%98.75%51, 8
crates/test-runner/src
   lib.rs100%100%100%100%

@pepoviola pepoviola marked this pull request as ready for review September 29, 2023 17:23
@pepoviola pepoviola merged commit 7adc2a9 into main Oct 2, 2023
4 checks passed
@pepoviola pepoviola deleted the feat/add-metric-parser branch October 2, 2023 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants