9#include "MantidKernel/DllConfig.h"
12#include "MantidTypes/Core/DateAndTime.h"
14#include <json/value.h>
16#include <Poco/ActiveMethod.h>
17#include <Poco/Timer.h>
47 ::Json::Value
asJson()
const;
61 void setApplicationName(
const std::string &name);
63 std::string getApplicationName()
const;
65 void setInterval(
const uint32_t seconds = 60);
67 void registerStartup();
72 void registerFeatureUsage(
const FeatureType &type,
const std::vector<std::string> &name,
const bool internal);
74 void registerFeatureUsage(
const FeatureType &type,
const std::string &name,
const bool internal);
79 void registerFeatureUsage(
const FeatureType &type, std::initializer_list<std::string> name,
const bool internal);
82 bool isEnabled()
const;
84 void setEnabled(
const bool enabled);
91 Types::Core::time_duration getUpTime();
101 virtual std::string generateStartupMessage();
103 virtual std::string generateFeatureUsageMessage();
115 void sendStartupReport();
117 void sendFeatureUsageReport(
const bool synchronous);
123 void timerCallback(Poco::Timer &);
126 ::Json::Value generateFeatureHeader();
UsageReporter : The Usage reporter is responsible for collating, and sending all usage data.
std::string featureTypeToString() const
Convert the stored feature type enum to a string.
::Json::Value asJson() const
bool operator<(const FeatureUsage &r) const
Manage the lifetime of a class intended to be a singleton.
Poco::Timer m_timer
a timer
Poco::ActiveMethod< InternetHelper::HTTPStatus, std::string, UsageServiceImpl > m_featureActiveMethod
Async method for sending feature notifications.
virtual ~UsageServiceImpl()=default
Destructor.
std::queue< FeatureUsage > m_FeatureQueue
uint32_t m_timerTicksTarget
The number of timer ticks at which to reset.
Types::Core::DateAndTime m_startTime
UsageServiceImpl & operator=(const UsageServiceImpl &)
Private, unimplemented copy assignment operator.
uint32_t m_timerTicks
The number of timer ticks since the last reset.
Poco::ActiveMethod< InternetHelper::HTTPStatus, std::string, UsageServiceImpl > m_startupActiveMethod
Async method for sending startup notifications.
UsageServiceImpl(const UsageServiceImpl &)
Private, unimplemented copy constructor.
std::string m_application
std::string m_url
Stores the base url of the usage system.
size_t m_FeatureQueueSizeThreshold
Types::Core::DateAndTime getStartTime()
Gets the start time of this mantid instance.
FeatureType
An enum specifying the 4 possible features types that can be logged in the usage service.
Helper class which provides the Collimation Length for SANS instruments.
Policy class controlling creation of the singleton Implementation classes should mark their default c...