metrics: register inbound-trigger and outbound-service counters
This commit is contained in:
@@ -21,6 +21,8 @@ import HomeAssistant.Runtime.Metrics
|
||||
, metricsAction
|
||||
, parseInfoDs
|
||||
, schemaMatches
|
||||
, AppMetrics (..)
|
||||
, registerAppMetrics
|
||||
)
|
||||
import qualified System.Metrics as M (Value (..))
|
||||
import Test.Hspec
|
||||
@@ -164,6 +166,15 @@ spec = do
|
||||
schemaMatches [ds "a" Derive] [("a", Gauge)]
|
||||
`shouldBe` False
|
||||
|
||||
describe "registerAppMetrics" $ do
|
||||
it "registers both counters with the store" $ do
|
||||
store <- Metrics.newStore
|
||||
m <- registerAppMetrics store
|
||||
Counter.inc (amTriggersIn m)
|
||||
sample <- Metrics.sampleAll store
|
||||
HM.lookup "hass.trigger.in" sample `shouldBe` Just (M.Counter 1)
|
||||
HM.lookup "hass.service.out" sample `shouldBe` Just (M.Counter 0)
|
||||
|
||||
describe "end-to-end (rrdtool-gated)" $ do
|
||||
it "creates an rrd, samples, and updates it" $ do
|
||||
mRrdtool <- findExecutable "rrdtool"
|
||||
|
||||
Reference in New Issue
Block a user