-- | Increment the total data written to disk by the given number of bytes.
-- Returns True, when it actually increased the counter and otherwise False.
incrementDataWritten :: (MonadMonitor m, Real a) => a -> IcepeakMetrics -> m Bool
incrementDataWritten num_bytes metrics = do
  -- Ignore the result to silence linter.
  -- TODO: the following line can be removed after dashboard has been updated to use icepeak_data_size_bytes
  _ <- addCounter (icepeakMetricsDataWritten metrics) (realToFrac num_bytes)
  addCounter (icepeakMetricsDataWrittenTotal metrics) (realToFrac num_bytes)

-- | Increment the data written to the journal by the given number of bytes.
-- Returns True, when it actually increased the counter and otherwise False.
incrementDataWritten :: (MonadMonitor m, Real a) => a -> IcepeakMetrics -> m Bool
incrementDataWritten num_bytes metrics = do
  -- Ignore the result to silence linter.
  -- TODO: the following line can be removed after dashboard has been updated to use icepeak_data_size_bytes
  _ <- addCounter (icepeakMetricsDataWritten metrics) (realToFrac num_bytes)
  addCounter (icepeakMetricsDataWrittenTotal metrics) (realToFrac num_bytes)

-- | Increment the data written to the journal by the given number of bytes.
-- Returns True, when it actually increased the counter and otherwise False.
incrementDataWritten num_bytes metrics = do
  -- Ignore the result to silence linter.
  -- TODO: the following line can be removed after dashboard has been updated to use icepeak_data_size_bytes
  _ <- addCounter (icepeakMetricsDataWritten metrics) (realToFrac num_bytes)
  addCounter (icepeakMetricsDataWrittenTotal metrics) (realToFrac num_bytes)

-- | Increment the data written to the journal by the given number of bytes.
-- Returns True, when it actually increased the counter and otherwise False.