paritytech / zombienet-sdk

ZombieNet SDK
https://paritytech.github.io/zombienet-sdk/zombienet_sdk/
GNU General Public License v3.0
28 stars 8 forks source link

Refactor `metrics` helpers #196

Open pepoviola opened 4 months ago

pepoviola commented 4 months ago

At the moment the Node instance you get from the running network expose two methods assert and assert_with (the first assert the equality and the latest accept a closure as predicate), at first the naming is not great and those can be changed to clearly express what are the goal of them. Also, a couple of methods to add are:

 // expose a _wait_ method to allow users to wait until the condition is met.
 async fn wait_for_metric(metric, predicate, [timeout]) -> Result<bool>  
// expose the raw metrics from prometheus with the labels as hashmap
// RawMetricHash should hold both labels (as inner hashMap) and value
async fn raw_metrics() -> Result<RawMetricHash>