module Development.IDE.Types.Monitoring
(Monitoring(..)
) where
import Data.Int
import Data.Text (Text)
data Monitoring = Monitoring {
Monitoring -> Text -> IO Int64 -> IO ()
registerGauge :: Text -> IO Int64 -> IO (),
Monitoring -> Text -> IO Int64 -> IO ()
registerCounter :: Text -> IO Int64 -> IO (),
Monitoring -> IO (IO ())
start :: IO (IO ())
}
instance Semigroup Monitoring where
Monitoring
a <> :: Monitoring -> Monitoring -> Monitoring
<> Monitoring
b = Monitoring {
registerGauge :: Text -> IO Int64 -> IO ()
registerGauge = \Text
n IO Int64
v -> Monitoring -> Text -> IO Int64 -> IO ()
registerGauge Monitoring
a Text
n IO Int64
v IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> Monitoring -> Text -> IO Int64 -> IO ()
registerGauge Monitoring
b Text
n IO Int64
v,
registerCounter :: Text -> IO Int64 -> IO ()
registerCounter = \Text
n IO Int64
v -> Monitoring -> Text -> IO Int64 -> IO ()
registerCounter Monitoring
a Text
n IO Int64
v IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> Monitoring -> Text -> IO Int64 -> IO ()
registerCounter Monitoring
b Text
n IO Int64
v,
start :: IO (IO ())
start = do
IO ()
a' <- Monitoring -> IO (IO ())
start Monitoring
a
IO ()
b' <- Monitoring -> IO (IO ())
start Monitoring
b
IO () -> IO (IO ())
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (IO () -> IO (IO ())) -> IO () -> IO (IO ())
forall a b. (a -> b) -> a -> b
$ IO ()
a' IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> IO ()
b'
}
instance Monoid Monitoring where
mempty :: Monitoring
mempty = Monitoring {
registerGauge :: Text -> IO Int64 -> IO ()
registerGauge = \Text
_ IO Int64
_ -> () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (),
registerCounter :: Text -> IO Int64 -> IO ()
registerCounter = \Text
_ IO Int64
_ -> () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (),
start :: IO (IO ())
start = IO () -> IO (IO ())
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (IO () -> IO (IO ())) -> IO () -> IO (IO ())
forall a b. (a -> b) -> a -> b
$ () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
}