Compute log-based metrics as rates or counters
By default, the metrics will still be sent as rates but for Prometheus
based monitoring, they will be sent as counters.
Change-Id: Ia9e64c35b32a1fa49071d698f91fdb2a7665a225
diff --git a/tests/lua/test_lma_utils.lua b/tests/lua/test_lma_utils.lua
index 7df99d7..1dd6e14 100644
--- a/tests/lua/test_lma_utils.lua
+++ b/tests/lua/test_lma_utils.lua
@@ -97,6 +97,17 @@
assertEquals(lma_utils.convert_to_sec(2000000001), 2)
end
+ function TestLmaUtils:test_convert_to_bool()
+ assertEquals(lma_utils.convert_to_bool(true), true)
+ assertEquals(lma_utils.convert_to_bool(0), false)
+ assertEquals(lma_utils.convert_to_bool(1), true)
+ assertEquals(lma_utils.convert_to_bool("false"), false)
+ assertEquals(lma_utils.convert_to_bool("tRue"), true)
+ assertEquals(lma_utils.convert_to_bool(nil), false)
+ assertEquals(lma_utils.convert_to_bool(nil, true), true)
+ assertEquals(lma_utils.convert_to_bool("false", true), false)
+ end
+
lu = LuaUnit
lu:setVerbosity( 1 )
os.exit( lu:run() )