#include #include #include #include "newrelic.h" #include "random.h" std::unique_ptr randomSegment(Transaction& txn) { auto generator(defaultGenerator()); std::uniform_int_distribution distribution(0, 2); switch (distribution(generator)) { case 0: return std::make_unique(CustomSegment(txn, "Random", "Custom")); case 1: return std::make_unique(DatastoreSegment(txn)); case 2: return std::make_unique(ExternalSegment(txn)); default: throw std::logic_error("unexpected segment type"); } }