13 #ifndef ENGINE_CLIENT_CPP_HPP 14 #define ENGINE_CLIENT_CPP_HPP 17 #include <AP_Platform.h> 26 #include <sag_internal/engine_client_c.h> 68 virtual const
char* what() const throw() {
return m_message; }
77 virtual const char*
const*
getWarnings()
const {
return m_warnings; }
83 const char*
const* m_warnings;
131 AP_ENGINE_CLIENT_API
void setLogFile(
const AP_char8* filename,
bool truncate,
bool utf8 =
false);
137 AP_ENGINE_CLIENT_API
int getLogFD();
143 AP_ENGINE_CLIENT_API
void setLogMutex(
void *mutex);
153 AP_ENGINE_CLIENT_API AP_char8*
convertToUTF8(
const AP_char8* s);
161 AP_ENGINE_CLIENT_API
void char8free(
char *
string);
178 friend AP_ENGINE_CLIENT_API
Event*
createEvent(
const char* eventString,
const char* channelString);
188 virtual const char* getText()
const = 0;
198 virtual const char* getChannel()
const = 0;
210 virtual double getTime()
const = 0;
262 virtual void disconnect() = 0;
303 virtual void sendEvents(
const Event*
const* events) = 0;
331 virtual void disconnect(
const char* reason) = 0;
357 AP_ENGINE_CLIENT_API
Event*
createEvent(
const char* eventString,
const char* channelString);
403 virtual const char* getText()
const = 0;
430 std::ostream&
operator << (std::ostream& stream,
const EngineStatus& obj);
431 std::ostream&
operator << (std::ostream& stream,
const EngineStatus* obj);
452 #pragma warning (disable : 4251) 454 class AP_ENGINE_CLIENT_API
StatusIterator :
public std::iterator<std::forward_iterator_tag, int>
458 typedef pair<std::string, std::string>
pair_t;
471 if (m_status && m_opaqueState) m_status->disposeIterator(m_opaqueState);
485 return (m_status == ref.m_status) &&
486 (((0 == m_opaqueState) && (0 == ref.m_opaqueState)) ||
487 (iterPair.first == ref.iterPair.first));
496 bool valid() {
return 0 != m_opaqueState; }
500 : m_status(ref.m_status),
501 m_opaqueState(m_status->copyIterator(ref.m_opaqueState)),
502 iterPair(ref.iterPair)
517 std::swap(m_status, other.m_status);
518 std::swap(m_opaqueState, other.m_opaqueState);
519 std::swap(iterPair, other.iterPair);
714 const AP_char8* operator[] (
const char *ref)
const {
715 return getStatusValue(ref);
721 const AP_char8* operator[] (std::string &ref)
const {
722 return this->operator[](ref.c_str());
742 return userIntOr(key, alt);
752 return userFloat(key);
762 return userFloatOr(key, alt);
772 return userBool(key);
782 return userBoolOr(key, alt);
792 return userString(key);
802 return userStringOr(key, alt);
811 std::ostringstream ost;
812 ost << getStandardStatusValues();
814 if (it->first.find(
"user-") != std::string::npos)
815 ost << std::setw(32) << std::setiosflags(std::ios_base::left) << it->first.append(
":") << it->second << std::endl;
826 std::ostringstream ost;
837 std::ostringstream ost;
838 ost <<
"Uptime (ms),# Contexts,# Monitors,# Sub-monitors,# Java apps,# Listeners,";
839 ost <<
"# Sub-listeners,# Event types,Input queue,# Received events,";
840 ost <<
"Route queue,# Routed events,# Consumers,Output queue,";
841 ost <<
"# Created output events,# Sent output events,# Processed events,";
842 ost <<
"Slowest context name,Slowest context queue size,Slowest receiver,Slowest receiver queue";
852 std::ostringstream ost;
853 ost << getRawHeader();
855 if (it->first.find(
"user-") != std::string::npos)
856 ost <<
"," << it->first;
867 std::ostringstream ost;
869 <<
"," << getNumContexts()
870 <<
"," << getNumMonitors()
871 <<
"," << getNumProcesses()
872 <<
"," << getNumJavaApplications()
873 <<
"," << getNumListeners()
874 <<
"," << getNumSubListeners()
875 <<
"," << getNumEventTypes()
876 <<
"," << getNumQueuedInput()
877 <<
"," << getNumReceived()
878 <<
"," << getNumQueuedFastTrack()
879 <<
"," << getNumFastTracked()
880 <<
"," << getNumConsumers()
881 <<
"," << getNumOutEventsQueued()
882 <<
"," << getNumOutEventsCreated()
883 <<
"," << getNumOutEventsSent()
889 <<
"," << getNumProcessed()
890 <<
"," << getMostBackedUpInput()
891 <<
"," << getMostBackedUpQueueSize()
892 <<
"," << getSlowestReceiver()
893 <<
"," << getSlowestReceiverQueueSize();
903 std::ostringstream ost;
904 ost << getStandardStatusValuesRaw();
906 if (it->first.find(
"user-") != std::string::npos)
907 ost <<
"," << it->second;
918 c_status->functions->deleteStatus(reinterpret_cast<AP_EngineStatus *>(c_status));
923 : c_status(other.c_status ? reinterpret_cast<AP_EngineStatus_API*>(other.c_status->functions->copyStatus(reinterpret_cast<AP_EngineStatus *>(other.c_status))) : 0)
937 EngineStatus(AP_EngineStatus_API *api): c_status(api) {}
939 void swap(EngineStatus &other) {
940 std::swap(c_status, other.c_status);
943 void getNext(
const char *&name,
const char *&value,
void *&opaqueState)
const {
945 c_status->functions->getNextStatusItem(reinterpret_cast<AP_EngineStatus *>(c_status), &name, &value, &opaqueState);
948 const AP_char8* getStatusValue(
const char *name)
const {
949 return c_status->functions->getStatusValue(reinterpret_cast<AP_EngineStatus *>(c_status), name);
952 AP_uint64 getStatusIntValue(
const char *name)
const {
953 return c_status->functions->getStatusIntValue(reinterpret_cast<AP_EngineStatus *>(c_status), name);
956 void disposeIterator(
void *opaqueState)
const {
957 c_status->functions->disposeIterator(reinterpret_cast<AP_EngineStatus *>(c_status), opaqueState);
960 void *copyIterator(
void *opaqueState)
const {
961 return c_status->functions->copyIterator(reinterpret_cast<AP_EngineStatus *>(c_status), opaqueState);
965 AP_int64 userIntOr(
const char* key, AP_int64 alt) {
966 return c_status->functions->getUserIntOr(reinterpret_cast<AP_EngineStatus *>(c_status), key, alt);
969 AP_float64 userFloatOr(
const char* key, AP_float64 alt) {
970 return c_status->functions->getUserFloatOr(reinterpret_cast<AP_EngineStatus *>(c_status), key, alt);
973 AP_bool userBoolOr(
const char* key, AP_bool alt) {
974 return c_status->functions->getUserBoolOr(reinterpret_cast<AP_EngineStatus *>(c_status), key, alt);
977 const AP_char8* userStringOr(
const char* key,
const AP_char8* alt) {
978 return c_status->functions->getUserStringOr(reinterpret_cast<AP_EngineStatus *>(c_status), key, alt);
981 AP_int64 userInt(
const char* key) {
982 return c_status->functions->getUserInt(reinterpret_cast<AP_EngineStatus *>(c_status), key);
985 AP_float64 userFloat(
const char* key) {
986 return c_status->functions->getUserFloat(reinterpret_cast<AP_EngineStatus *>(c_status), key);
989 AP_bool userBool(
const char* key) {
990 return c_status->functions->getUserBool(reinterpret_cast<AP_EngineStatus *>(c_status), key);
993 const AP_char8* userString(
const char* key) {
994 return c_status->functions->getUserString(reinterpret_cast<AP_EngineStatus *>(c_status), key);
997 AP_EngineStatus_API *c_status;
1005 std::ostringstream ost;
1007 <<
"Uptime(ms): " << obj.
getUptime() << std::endl
1034 stream << ost.str();
1057 if (m_opaqueState) step();
1061 inline void EngineStatus::StatusIterator::step()
1063 const char *name =
nullptr;
1064 const char *value =
nullptr;
1067 m_status->getNext(name, value, m_opaqueState );
1068 if(!name || !value) {
1069 assert(!m_opaqueState);
1071 iterPair = pair_t(name, value);
1091 virtual const char* getName()
const = 0;
1097 virtual const char* getPackage()
const = 0;
1102 virtual const char* getFullyQualifiedName()
const = 0;
1127 virtual unsigned int getNumSubMonitors()
const = 0;
1152 virtual unsigned int getNumListeners()
const = 0;
1177 virtual unsigned int getNumSubMonitors()
const = 0;
1182 virtual unsigned int getQueueSize()
const = 0;
1187 virtual char const *
const *getChannels()
const = 0;
1213 virtual unsigned int getQueueSize()
const = 0;
1218 virtual char const *
const *getChannels()
const = 0;
1223 virtual const AP_char8 *getAddress()
const = 0;
1249 virtual unsigned int getQueueSize()
const = 0;
1254 virtual char const *
const *getChannels()
const = 0;
1279 virtual unsigned int getNumEventTemplates()
const = 0;
1304 virtual unsigned int getNumTimers()
const = 0;
1359 virtual unsigned int getNumMonitors()
const = 0;
1364 virtual unsigned int getNumJavaApplications()
const = 0;
1369 virtual unsigned int getNumEventTypes()
const = 0;
1374 virtual unsigned int getNumTimers()
const = 0;
1379 virtual unsigned int getNumAggregates()
const = 0;
1429 virtual unsigned int getNumContexts()
const = 0;
1443 virtual unsigned int getNumReceivers()
const = 0;
1457 virtual unsigned int getNumPluginReceivers()
const = 0;
1515 virtual void injectMonitorScript(
MonitorScript& script) = 0;
1532 virtual const char*
const* injectMonitorScriptWithWarnings(
MonitorScript& script) = 0;
1550 virtual const char*
const* injectMonitorScriptWithWarningsFilename(
MonitorScript& script,
const char *filename) = 0;
1558 virtual void deleteName(
const char * name) = 0;
1566 virtual void forceDeleteName(
const char * name) = 0;
1574 virtual void killName(
const char * name) = 0;
1579 virtual void deleteAll() = 0;
1589 virtual void injectJava(
const AP_uint8* jarbytes, AP_uint32 size) = 0;
1607 virtual const char*
const* injectJavaWithWarnings(
const AP_uint8* jarbytes, AP_uint32 size) = 0;
1623 virtual const char*
const* injectJavaWithWarningsFilename(
const AP_uint8* jarbytes, AP_uint32 size,
const char *filename) = 0;
1635 virtual void injectCDP(
const AP_uint8* cdpbytes, AP_uint32 size,
const char *filename=NULL) = 0;
1653 virtual const char*
const* injectCDPWithWarnings(
const AP_uint8* cdpbytes, AP_uint32 size) = 0;
1669 virtual const char*
const* injectCDPWithWarningsFilename(
const AP_uint8* cdpbytes, AP_uint32 size,
const char *filename) = 0;
1677 char *errmsg =
nullptr;
1678 AP_EngineStatus *es_api = engineManagement_getStatusOpaque(
this, &errmsg);
1685 return EngineStatus(reinterpret_cast<AP_EngineStatus_API *>(es_api));
1753 virtual bool attachAsEventConsumerTo(
EngineManagement* target,
const char*
const* channels,
bool disconnectSlow =
false, ConnectMode mode = CONNECT_LEGACY) = 0;
1778 virtual bool attachAsEventConsumerTo(
const char* host,
int port,
const char*
const* channels,
bool disconnectSlow =
false, ConnectMode mode = CONNECT_LEGACY) = 0;
1797 virtual void detachAsEventConsumerFrom(
EngineManagement* target,
const char*
const* channels, ConnectMode mode = CONNECT_LEGACY) = 0;
1816 virtual void detachAsEventConsumerFrom(
const char* host,
int port,
const char*
const* channels, ConnectMode mode = CONNECT_LEGACY) = 0;
1842 virtual void flushEvents() = 0;
1870 virtual void ping() = 0;
1877 virtual bool isConnected() = 0;
1894 virtual void setReceiverConnections(
const std::vector<com::apama::engine::EngineConnection>& connections) = 0;
1900 virtual const std::vector<com::apama::engine::EngineConnection> getReceiverConnections() = 0;
1923 std::vector<std::string> channels;
1924 bool disconnectSlow;
1928 if (host == NULL || channels == NULL) {
1929 throw EngineException(
"EngineConnection cannot be created with null host or channels");
1931 if (port < 0 || port > 65535) {
1932 throw EngineException(
"EngineConnection cannot be created with invalid port value");
1935 this->host = std::string(host);
1937 this->disconnectSlow = disconnectSlow;
1938 this->connectMode = connectMode;
1940 for (
const char*
const* c = channels; *c != NULL; c++) {
1941 this->channels.push_back(std::string(*c));
1957 const char *
const * channels) {
1958 init(host, port, disconnectSlow, connectMode, channels);
1969 init(host, port,
false, EngineManagement::CONNECT_LEGACY, channels);
2002 return disconnectSlow;
2015 std::ostringstream ost;
2016 ost <<
"EngineConnection to " << obj.host <<
":" << obj.port << (obj.disconnectSlow ==
true ?
" diconnectSlow" :
"") <<
" on" <<
2017 (obj.connectMode == EngineManagement::CONNECT_PARALLEL ?
" parallel" :
"") <<
" channels [";
2019 if (!obj.channels.empty()) {
2020 std::copy(obj.channels.begin(), obj.channels.end() - 1, std::ostream_iterator<std::string>(ost,
", "));
2021 ost << obj.channels.back();
2024 stream << ost.str();
2045 AP_ENGINE_CLIENT_API
void engineInit(
const char* processName =
"C++ Client");
2054 AP_ENGINE_CLIENT_API
void engineInitMessaging(
const char *processName,
bool initMessaging=
true);
2078 AP_ENGINE_CLIENT_API EngineManagement*
connectToEngine(
const char* host,
unsigned short port,
bool disconnectSlowReceiver =
false,
const char *processName =
nullptr);
2093 AP_ENGINE_CLIENT_API EngineManagement*
connectToEngineReceiveOnly(
const char* host,
unsigned short port,
const char *processName =
nullptr);
2107 AP_ENGINE_CLIENT_API EngineManagement*
connectToEngineMonitorOnly(
const char* host,
unsigned short port,
const char *processName =
nullptr);
2144 AP_ENGINE_CLIENT_API
void deleteInfo(EngineInfo* info);
2154 AP_ENGINE_CLIENT_API
void deleteWarnings(
const char*
const* warnings);
2177 #endif // ENGINE_CLIENT_CPP_HPP static char const *const PERSISTENCE_SNAPSHOT_WAIT_EWMA_SECONDS
The EWMA of time taken to wait for a snapshot, in milliseconds.
Definition: client_status_names.hpp:63
AP_uint64 getNumFastTracked() const
The number of events that have been routed across all contexts since the correlator was started.
Definition: engine_client_cpp.hpp:609
AP_uint32 getNumListeners() const
The number of listeners in all contexts.
Definition: engine_client_cpp.hpp:573
AP_uint64 getUptime() const
The time in milliseconds since the correlator was started.
Definition: engine_client_cpp.hpp:538
AP_ENGINE_CLIENT_API void deleteInfo(EngineInfo *info)
This function allows deletion of an EngineInfo object.
static char const *const PERSISTENCE_SNAPSHOTS_TOTAL
Number of snapshots since startup.
Definition: client_status_names.hpp:59
AP_ENGINE_CLIENT_API void setLogLevel(LogLevel level)
Sets the level at which the client library will log information.
virtual const char *const * getWarnings() const
Retrieve the set of warnings associated with the exception.
Definition: engine_client_cpp.hpp:77
AP_ENGINE_CLIENT_API void setEngineParams(const char *params)
Set custom parameters for this instance of the client library.
Derived class from EventConsumer which implements the disconnect API.
Definition: engine_client_cpp.hpp:321
AP_uint32 getNumJavaApplications() const
The number of Java applications and Java EPL plug-ins loaded in the correlator.
Definition: engine_client_cpp.hpp:566
Base class for a named object (i.e.
Definition: engine_client_cpp.hpp:1085
AP_uint32 getNumQueuedFastTrack() const
The sum of routed events on the route queues of all contexts.
Definition: engine_client_cpp.hpp:587
AP_uint32 getNumSubListeners() const
The number of sub-event-listeners that are active across all contexts.
Definition: engine_client_cpp.hpp:681
An EventConsumer can connect to the Engine through an EventSupplier and register to receive events.
Definition: engine_client_cpp.hpp:288
AP_float64 getUserFloatOr(const char *key, float alt)
Get a user value of type AP_float64 or the alt value if it cannot be found.
Definition: engine_client_cpp.hpp:761
virtual const char * getText() const =0
Retrieve the event's type and its contents as a string.
AP_ENGINE_CLIENT_API void engineInit(const char *processName="C++ Client")
This function must be called once per process first before any other Engine operations are carried ou...
static char const *const QUEUED_INPUT_PUBLIC_TOTAL
Total number of events on input contexts' queues.
Definition: client_status_names.hpp:35
virtual EngineManagement::ConnectMode getConnectMode() const
Get the connection mode associated with this connection.
Definition: engine_client_cpp.hpp:2009
const AP_char8 * getMostBackedUpInput() const
The name of the slowest context.
Definition: engine_client_cpp.hpp:653
AP_uint32 getNumConsumers() const
The number of external consumers/receivers connected to receive emitted events.
Definition: engine_client_cpp.hpp:616
virtual const char * getText() const =0
Retrieve the text of a MonitorScript fragment as a string.
AP_uint64 getNumOutEventsCreated() const
The number of events that have been sent or emitted to channels which have at least one external cons...
Definition: engine_client_cpp.hpp:631
~EngineStatus()
Destroy the underlying status data.
Definition: engine_client_cpp.hpp:915
EngineStatus getStatus()
Get the Engine's current operational status.
Definition: engine_client_cpp.hpp:1675
static char const *const ROUTE_TOTAL
Number of events fast tracked.
Definition: client_status_names.hpp:33
static char const *const SUB_LISTENERS_TOTAL
Number of active sub-listeners.
Definition: client_status_names.hpp:69
AP_int64 getUserIntOr(const char *key, int alt)
Get a user value of type AP_int64 or the alt value if it cannot be found.
Definition: engine_client_cpp.hpp:741
static char const *const INPUT_TOTAL
Number of events received (includes those that failed to be parsed)
Definition: client_status_names.hpp:57
AP_uint32 getNumMonitors() const
The number of EPL monitor definitions injected into the correlator.
Definition: engine_client_cpp.hpp:552
The Engine Management class acts as the interface to the Engine, and allows operations to be carried ...
Definition: engine_client_cpp.hpp:1499
static char const *const PERSISTENCE_SNAPSHOT_ROWS_CHANGED_EWMA_TOTAL
The EWMA of number of rows changed.
Definition: client_status_names.hpp:67
pair< std::string, std::string > pair_t
element type
Definition: engine_client_cpp.hpp:458
Fatal messages.
Definition: engine_client_cpp.hpp:100
AP_ENGINE_CLIENT_API void deleteMonitorScript(MonitorScript *mon)
This function allows deletion of MonitorScript objects.
AP_int64 getUserInt(const char *key)
Get a user value of type AP_int64.
Definition: engine_client_cpp.hpp:731
EngineConnection encapsulates the information related to a connection between two Apama messaging com...
Definition: engine_client_cpp.hpp:1919
Nothing logged.
Definition: engine_client_cpp.hpp:94
static char const *const CONSUMERS_TOTAL
Number of consumers attached to the correlator.
Definition: client_status_names.hpp:25
AP_bool getUserBool(const char *key)
Get a user value of type AP_bool.
Definition: engine_client_cpp.hpp:771
StatusIterator & operator=(const StatusIterator &other)
Copy assignment.
Definition: engine_client_cpp.hpp:505
AP_uint32 getNumQueuedInput() const
The number of executors on the input queues of all contexts.
Definition: engine_client_cpp.hpp:595
Information about a timer type returned by an engine inspection.
Definition: engine_client_cpp.hpp:1298
AP_ENGINE_CLIENT_API AP_char8 * convertFromUTF8(const AP_char8 *s)
Convert a string in UTF-8 to the local encoding, since most of the Apama API returns UTF-8.
Information about a context returned by an engine inspection.
Definition: engine_client_cpp.hpp:1171
static char const *const MONITORS_TOTAL
Number of monitors.
Definition: client_status_names.hpp:41
StatusIterator operator++(int dummy)
(postfix) increment this iterator
Definition: engine_client_cpp.hpp:474
std::string getStandardStatusValues()
Get the standard status values, formatted for terminal output.
Definition: engine_client_cpp.hpp:825
EngineConnection(const char *host, int port, bool disconnectSlow, EngineManagement::ConnectMode connectMode, const char *const *channels)
Definition: engine_client_cpp.hpp:1956
AP_uint32 getNumOutEventsQueued() const
The number of events waiting on output queues to be dispatched to any connected external consumers/re...
Definition: engine_client_cpp.hpp:623
static char const *const CREATED_OUTPUT_TOTAL
Number of events emitted from correlator.
Definition: client_status_names.hpp:29
AP_ENGINE_CLIENT_API void engineInitMessaging(const char *processName, bool initMessaging=true)
This function (or engineInit) must be called once per process first before any other Engine operation...
Startup and other important messages.
Definition: engine_client_cpp.hpp:96
EngineStatus & operator=(const EngineStatus &other)
Copy assignment.
Definition: engine_client_cpp.hpp:926
AP_ENGINE_CLIENT_API MonitorScript * createMonitorScript(const char *monitorString)
This function allows creation of MonitorScript objects.
StatusIterator const_iterator
Iterator type for const EngineStatus.
Definition: engine_client_cpp.hpp:533
virtual int getPort() const
Get the port associated with this connection.
Definition: engine_client_cpp.hpp:1993
An EventSupplier represents the resources created by the Engine to service a connection to an externa...
Definition: engine_client_cpp.hpp:248
static std::string getRawHeader()
Get a header for the raw output, useful for indentifying values.
Definition: engine_client_cpp.hpp:836
AP_uint32 getNumContexts() const
The number of contexts in the correlator, including the main context.
Definition: engine_client_cpp.hpp:545
static char const *const PROCESSED_TOTAL
Number of events taken of output queue.
Definition: client_status_names.hpp:49
For backwards compatibility, single serial connection.
Definition: engine_client_cpp.hpp:1505
Information about a monitor returned by an engine inspection.
Definition: engine_client_cpp.hpp:1121
static char const *const LISTENERS_TOTAL
Number of active listeners.
Definition: client_status_names.hpp:39
static char const *const SLOWEST_INPUT_QUEUE_SIZE_TOTAL
Number of executors waiting on that context's queue.
Definition: client_status_names.hpp:77
Information about a receiver returned by an engine inspection.
Definition: engine_client_cpp.hpp:1207
std::string getRawHeaderAll()
Get a header for the raw output, useful for indentifying values.
Definition: engine_client_cpp.hpp:851
AP_ENGINE_CLIENT_API void setLogFile(const AP_char8 *filename, bool truncate, bool utf8=false)
Sets the file to which the client library should log information.
ConnectMode
The mode that attachAsEventConsumerTo and detachAsEventConsumerFrom operate in.
Definition: engine_client_cpp.hpp:1503
EngineStatus()
Create a default-constructed (empty) EngineStatus.
Definition: engine_client_cpp.hpp:934
Information messages (default)
Definition: engine_client_cpp.hpp:106
Information about an aggregate function returned by an engine inspection.
Definition: engine_client_cpp.hpp:1324
Information about the monitors and types currently in an engine.
Definition: engine_client_cpp.hpp:1351
Contains the key names for all standard status values within the correlator.
virtual const std::vector< std::string > & getChannels() const
Get the channels associated with this connection.
Definition: engine_client_cpp.hpp:1977
static char const *const EVENT_TYPES_TOTAL
Number of event types defined.
Definition: client_status_names.hpp:31
std::ostream & operator<<(std::ostream &stream, const EngineStatus &obj)
Stream output operator for a reference.
Definition: engine_client_cpp.hpp:1004
AP_ENGINE_CLIENT_API void engineShutdown()
This function must be called once per process before the application closes down.
virtual const std::string & getHost() const
Get the host associated with this connection.
Definition: engine_client_cpp.hpp:1985
Information about a java application returned by an engine inspection.
Definition: engine_client_cpp.hpp:1146
AP_ENGINE_CLIENT_API void disconnectFromEngine(EngineManagement *corr)
This function allows disconnection from an Engine.
const AP_char8 * getUserString(const char *key)
Get a user value of type AP_char8*.
Definition: engine_client_cpp.hpp:791
An Event object represents an event instance.
Definition: engine_client_cpp.hpp:176
AP_uint32 getNumProcesses() const
The number of monitor instances, also known as sub-monitors.
Definition: engine_client_cpp.hpp:559
const_iterator end() const
Returns an instance of the StatusIterator which allows to iterate over all status items.
Definition: engine_client_cpp.hpp:707
Critical messages.
Definition: engine_client_cpp.hpp:98
pair_t * operator->()
Return a pointer to the element pointed to.
Definition: engine_client_cpp.hpp:494
virtual ~EngineConnection()
Destroy the underlying connection data.
Definition: engine_client_cpp.hpp:2035
AP_ENGINE_CLIENT_API EngineManagement * connectToEngineMonitorOnly(const char *host, unsigned short port, const char *processName=nullptr)
Attempt to establish a monitor-only connection to an Engine listening on the named host and port.
static char const *const QUEUED_INPUT_TOTAL
Number of events on the input queue.
Definition: client_status_names.hpp:55
static char const *const SLOWEST_INPUT_QUEUE_CONTEXT_NAME
Name of the most backlogged input context.
Definition: client_status_names.hpp:79
std::string getAllStatusValuesRaw()
Get all the status values available, formatted for parsers (values separated by ,).
Definition: engine_client_cpp.hpp:902
const_iterator begin() const
Returns an instance of the StatusIterator which allows to iterate over all status items.
Definition: engine_client_cpp.hpp:697
AP_ENGINE_CLIENT_API void reOpenLog()
Re-opens the log file.
LogLevel
Available logging levels.
Definition: engine_client_cpp.hpp:92
Information about a receiver returned by an engine inspection.
Definition: engine_client_cpp.hpp:1243
std::string getAllStatusValues()
Get all the status values available, formatted for terminal output.
Definition: engine_client_cpp.hpp:810
const AP_char8 * getSlowestReceiver() const
The name of the consumer/receiver with the largest number of incoming events waiting to be processed.
Definition: engine_client_cpp.hpp:660
AP_ENGINE_CLIENT_API EngineManagement * connectToEngineReceiveOnly(const char *host, unsigned short port, const char *processName=nullptr)
Attempt to establish a receive-only connection to an Engine listening on the named host and port.
EngineStatus(const EngineStatus &other)
Copy constructor.
Definition: engine_client_cpp.hpp:922
AP_ENGINE_CLIENT_API void deleteWarnings(const char *const *warnings)
This function allows deletion of the lists of warnings returned by injectMonitorScriptWithWarnings(),...
static char const *const OUTPUT_TOTAL
Number of events sent.
Definition: client_status_names.hpp:45
EngineConnection(const char *host, int port, const char *const *channels)
Definition: engine_client_cpp.hpp:1968
EngineStatus represents the operational status of the Engine.
Definition: engine_client_cpp.hpp:439
AP_uint32 getMostBackedUpQueueSize() const
The number of events on the slowest context's queue, as identified by the name of the slowest context...
Definition: engine_client_cpp.hpp:674
bool operator==(const StatusIterator &ref) const
Returns true if two iterators point to the same item.
Definition: engine_client_cpp.hpp:483
AP_ENGINE_CLIENT_API int getLogFD()
Get the file descriptor of this logger.
Warning messages.
Definition: engine_client_cpp.hpp:104
AP_uint32 getNumInputQueuedInput() const
The number of events on the input queues of all public contexts.
Definition: engine_client_cpp.hpp:646
AP_ENGINE_CLIENT_API AP_char8 * convertToUTF8(const AP_char8 *s)
Convert a string in local encoding to UTF-8, as required by most of the Apama API.
static char const *const QUEUED_ROUTE_TOTAL
Number of events on the fast track queue.
Definition: client_status_names.hpp:53
bool valid()
Returns true if this is a valid iterator over status data.
Definition: engine_client_cpp.hpp:496
const AP_char8 * getUserStringOr(const char *key, const char *alt)
Get a user value of type AP_char8* or the alt value if it cannot be found.
Definition: engine_client_cpp.hpp:801
AP_ENGINE_CLIENT_API Event * createEvent(const char *eventString, const char *channelString)
This function allows creation of an Event object.
static char const *const SLOWEST_OUTPUT_QUEUE_NAME
Name of the slowest receiver.
Definition: client_status_names.hpp:71
static char const *const QUEUED_OUTPUT_TOTAL
Number of events on the output queue.
Definition: client_status_names.hpp:43
std::ostream & operator<<(std::ostream &stream, const EngineStatus *obj)
Stream output operator for a pointer.
Definition: engine_client_cpp.hpp:1041
Debugging messages.
Definition: engine_client_cpp.hpp:108
AP_float64 getUserFloat(const char *key)
Get a user value of type AP_float64.
Definition: engine_client_cpp.hpp:751
Information about a event type returned by an engine inspection.
Definition: engine_client_cpp.hpp:1273
AP_ENGINE_CLIENT_API EngineManagement * connectToEngine(const char *host, unsigned short port, bool disconnectSlowReceiver=false, const char *processName=nullptr)
This function attempts to establish a connection to an Engine.
std::string getStandardStatusValuesRaw()
Get the standard status values, formatted for parsers (values separated by ,).
Definition: engine_client_cpp.hpp:866
AP_uint64 getNumProcessed() const
The number of events processed by the correlator in all contexts.
Definition: engine_client_cpp.hpp:688
StatusIterator()
Default-constructed status iterator.
Definition: engine_client_cpp.hpp:463
AP_uint64 getNumReceived() const
The number of events that the correlator has received from external sources since the correlator star...
Definition: engine_client_cpp.hpp:602
An EngineException (or instance of a derived class) is thrown by methods in this library if any probl...
Definition: engine_client_cpp.hpp:45
static char const *const PERSISTENCE_LAST_SNAPSHOT_TIMESTAMP
The clock time of the last complete snapshot.
Definition: client_status_names.hpp:61
More-verbose debug messages.
Definition: engine_client_cpp.hpp:110
A MonitorScript object encapsulates an EPL code fragment, containing package, event and monitor defin...
Definition: engine_client_cpp.hpp:390
static char const *const UPTIME_SECONDS
Uptime in ms.
Definition: client_status_names.hpp:23
AP_ENGINE_CLIENT_API void char8free(char *string)
Free any char* string returned from the client API.
A class used for the iterating through all status items.
Definition: engine_client_cpp.hpp:454
AP_ENGINE_CLIENT_API void deleteEvent(Event *ev)
This function allows deletion of an Event object.
StatusIterator iterator
Iterator type.
Definition: engine_client_cpp.hpp:531
static char const *const CONTEXTS_TOTAL
Number of contexts in the correlator.
Definition: client_status_names.hpp:27
AP_ENGINE_CLIENT_API void deleteEventSupplier(EventSupplier *evsup)
This function disconnects and deletes an EventSupplier object.
static char const *const SLOWEST_OUTPUT_QUEUE_SIZE_TOTAL
Number of events waiting on that receiver's queue.
Definition: client_status_names.hpp:73
AP_uint32 getNumEventTypes() const
The number of event types defined within the correlator.
Definition: engine_client_cpp.hpp:580
bool operator!=(const StatusIterator &ref) const
Returns false if two iterators point to the same item.
Definition: engine_client_cpp.hpp:490
~StatusIterator()
Destroy underling status iterator.
Definition: engine_client_cpp.hpp:469
static char const *const MONITOR_INSTANCES_TOTAL
Number of monitor processes.
Definition: client_status_names.hpp:51
virtual bool getDisconnectSlow() const
Get the value of disconnectSlow flag associated with this connection.
Definition: engine_client_cpp.hpp:2001
Error messages.
Definition: engine_client_cpp.hpp:102
static char const *const PERSISTENCE_COMMIT_TIME_EWMA_SECONDS
The EWMA of time taken to commit, in milliseconds.
Definition: client_status_names.hpp:65
StatusIterator(const StatusIterator &ref)
Copy constructor.
Definition: engine_client_cpp.hpp:499
AP_uint64 getNumOutEventsSent() const
The number of events that have been delivered to external consumers/receivers.
Definition: engine_client_cpp.hpp:639
AP_uint32 getSlowestReceiverQueueSize() const
The number of events on the slowest consumer's/receiver's queue, as identified by the name of the slo...
Definition: engine_client_cpp.hpp:667
AP_bool getUserBoolOr(const char *key, bool alt)
Get a user value of type AP_bool or the alt value if it cannot be found.
Definition: engine_client_cpp.hpp:781
static char const *const JAVA_APPLICATIONS_TOTAL
Number of java applications.
Definition: client_status_names.hpp:37