eclipse-zenoh / zenoh

zenoh unifies data in motion, data in-use, data at rest and computations. It carefully blends traditional pub/sub with geo-distributed storages, queries and computations, while retaining a level of time and space efficiency that is well beyond any of the mainstream stacks.
https://zenoh.io
Other
1.36k stars 142 forks source link

Downsampling don't work with wildcards in key expression #1202

Open sashacmc opened 1 week ago

sashacmc commented 1 week ago

Describe the bug

Seems that the method weight_at from the KeyExprTree works only with key expression without wildcards, it should be replaced with something other. https://github.com/eclipse-zenoh/zenoh/blob/2500e5a62d8940cbfbc36f27c07360f91ba28c2d/zenoh/src/net/routing/interceptor/downsampling.rs#L125

To reproduce

Run z_pub in router mode Run z_sub in client mode with config

      "downsampling": [
          {
              "flow": "ingress",
              "rules": [
                  {
                      "freq": 0.1,
                      "key_expr": "demo/**"
                  }
              ]
          },
      ],

Downsampling not work.

When replacing demo/** with demo/example/zenoh-rs-pub everything works as expected

System info

Any platform