knyar / nginx-lua-prometheus

Prometheus metric library for Nginx written in Lua
MIT License
1.46k stars 231 forks source link

Feature/allow utf8 lable value #110

Closed Gerrard-YNWA closed 3 years ago

Gerrard-YNWA commented 3 years ago

Hello, just implemented the feature and reimplemented the utf8 validation function which have a better performance compared to utf8_validator.lua

here is the benchmark code benchmark.lua and result running on my laptop:

➜  utf8_validator.lua (master) ✔ resty benchmark.lua
benchmark for plain ascii, string Hello word
465.99984169006
23.000001907349
benchmark for utf8 stuff, string ¢€𤭢
1187.0000362396
45.000076293945
benchmark for mixed stuff, string Pay in €. Thanks.
1144.9999809265
39.999961853027

close #109

Any suggestions?

coveralls commented 3 years ago

Coverage Status

Coverage increased (+0.5%) to 94.759% when pulling b6ba6f8f8af677a8c69a345e04ae95587e75c20f on Gerrard-YNWA:feature/allow-utf8-lable-value into c66eac93f073ba7016fd646619c436545cb029de on knyar:master.

knyar commented 3 years ago

Thanks! I will make a new release with this change shortly.