ouroboros-network:sim-tests-lib
Safe HaskellNone
LanguageHaskell2010

Test.Ouroboros.Network.PeerSelection.PeerMetric

Synopsis

Documentation

newtype TestAddress Source #

Constructors

TestAddress Int 

mkFixedScript :: Script Event -> FixedScript Source #

Order events by SlotNo

TODO: SizeInBytes should be a function of SlotNo

prop_insert_peer :: FixedScript -> Property Source #

Check that newly added peer is never in the 20% worst performing peers (if there are at least 5 results).

prop_metrics_are_bounded :: FixedScript -> Property Source #

Check that the results are always positive.

prop_bounded_size :: Positive Int -> FixedScript -> Property Source #

Check that the result are bounded.

The bound is maxEntriesToTrack times number of peers in the simulation. This could be lowered by computing number of peers in each maxEntriesToTrack slots window.

microbenchmark1GenerateInput :: Bool -> Int -> IO FixedScript Source #

microbenchmark1 n - one test of simple property on a FixedScript of length n: one input, one property, one test.

We split into generating input and running/checking it so we can more accurately measure the latter.

prop_simScript :: FixedScript -> Property Source #

one simple property (pmtUpstreamyness >= 0) checked on the trace of a script:

simulatePeerMetricScriptWithoutDelays :: MonadLabelledSTM m => Tracer m PeerMetricsTrace -> PeerMetricsConfiguration -> FixedScript -> m () Source #

similar to simulatePeerMetricScript: but we don't do in "real/simulated" time: not calling getMonotonicTime and threadDelay.