14 #ifndef ENGINE_CLIENT_CPP_HPP 15 #define ENGINE_CLIENT_CPP_HPP 18 #include <AP_Platform.h> 27 #include <sag_internal/engine_client_c.h> 69 virtual const
char* what() const throw() {
return m_message; }
78 virtual const char*
const*
getWarnings()
const {
return m_warnings; }
84 const char*
const* m_warnings;
132 AP_ENGINE_CLIENT_API
void setLogFile(
const AP_char8* filename,
bool truncate,
bool utf8 =
false);
138 AP_ENGINE_CLIENT_API
int getLogFD();
144 AP_ENGINE_CLIENT_API
void setLogMutex(
void *mutex);
154 AP_ENGINE_CLIENT_API AP_char8*
convertToUTF8(
const AP_char8* s);
162 AP_ENGINE_CLIENT_API
void char8free(
char *
string);
179 friend AP_ENGINE_CLIENT_API
Event*
createEvent(
const char* eventString,
const char* channelString);
189 virtual const char* getText()
const = 0;
199 virtual const char* getChannel()
const = 0;
211 virtual double getTime()
const = 0;
263 virtual void disconnect() = 0;
304 virtual void sendEvents(
const Event*
const* events) = 0;
332 virtual void disconnect(
const char* reason) = 0;
358 AP_ENGINE_CLIENT_API
Event*
createEvent(
const char* eventString,
const char* channelString);
404 virtual const char* getText()
const = 0;
431 std::ostream&
operator << (std::ostream& stream,
const EngineStatus& obj);
432 std::ostream&
operator << (std::ostream& stream,
const EngineStatus* obj);
453 #pragma warning (disable : 4251) 455 class AP_ENGINE_CLIENT_API
StatusIterator :
public std::iterator<std::forward_iterator_tag, int>
459 typedef pair<std::string, std::string>
pair_t;
472 if (m_status && m_opaqueState) m_status->disposeIterator(m_opaqueState);
486 return (m_status == ref.m_status) &&
487 (((0 == m_opaqueState) && (0 == ref.m_opaqueState)) ||
488 (iterPair.first == ref.iterPair.first));
497 bool valid() {
return 0 != m_opaqueState; }
501 : m_status(ref.m_status),
502 m_opaqueState(m_status->copyIterator(ref.m_opaqueState)),
503 iterPair(ref.iterPair)
518 std::swap(m_status, other.m_status);
519 std::swap(m_opaqueState, other.m_opaqueState);
520 std::swap(iterPair, other.iterPair);
715 const AP_char8* operator[] (
const char *ref)
const {
716 return getStatusValue(ref);
722 const AP_char8* operator[] (std::string &ref)
const {
723 return this->operator[](ref.c_str());
743 return userIntOr(key, alt);
753 return userFloat(key);
763 return userFloatOr(key, alt);
773 return userBool(key);
783 return userBoolOr(key, alt);
793 return userString(key);
803 return userStringOr(key, alt);
812 std::ostringstream ost;
813 ost << getStandardStatusValues();
815 if (it->first.find(
"user-") != std::string::npos)
816 ost << std::setw(32) << setiosflags(std::ios_base::left) << it->first.append(
":") << it->second << std::endl;
827 std::ostringstream ost;
838 std::ostringstream ost;
839 ost <<
"Uptime (ms),# Contexts,# Monitors,# Sub-monitors,# Java apps,# Listeners,";
840 ost <<
"# Sub-listeners,# Event types,Input queue,# Received events,";
841 ost <<
"Route queue,# Routed events,# Consumers,Output queue,";
842 ost <<
"# Created output events,# Sent output events,# Processed events,";
843 ost <<
"Slowest context name,Slowest context queue size,Slowest receiver,Slowest receiver queue";
853 std::ostringstream ost;
854 ost << getRawHeader();
856 if (it->first.find(
"user-") != std::string::npos)
857 ost <<
"," << it->first;
868 std::ostringstream ost;
870 <<
"," << getNumContexts()
871 <<
"," << getNumMonitors()
872 <<
"," << getNumProcesses()
873 <<
"," << getNumJavaApplications()
874 <<
"," << getNumListeners()
875 <<
"," << getNumSubListeners()
876 <<
"," << getNumEventTypes()
877 <<
"," << getNumQueuedInput()
878 <<
"," << getNumReceived()
879 <<
"," << getNumQueuedFastTrack()
880 <<
"," << getNumFastTracked()
881 <<
"," << getNumConsumers()
882 <<
"," << getNumOutEventsQueued()
883 <<
"," << getNumOutEventsCreated()
884 <<
"," << getNumOutEventsSent()
890 <<
"," << getNumProcessed()
891 <<
"," << getMostBackedUpInput()
892 <<
"," << getMostBackedUpQueueSize()
893 <<
"," << getSlowestReceiver()
894 <<
"," << getSlowestReceiverQueueSize();
904 std::ostringstream ost;
905 ost << getStandardStatusValuesRaw();
907 if (it->first.find(
"user-") != std::string::npos)
908 ost <<
"," << it->second;
919 c_status->functions->deleteStatus(reinterpret_cast<AP_EngineStatus *>(c_status));
924 : c_status(other.c_status ? reinterpret_cast<AP_EngineStatus_API*>(other.c_status->functions->copyStatus(reinterpret_cast<AP_EngineStatus *>(other.c_status))) : 0)
938 EngineStatus(AP_EngineStatus_API *api): c_status(api) {}
940 void swap(EngineStatus &other) {
941 std::swap(c_status, other.c_status);
944 void getNext(
const char *&name,
const char *&value,
void *&opaqueState)
const {
946 c_status->functions->getNextStatusItem(reinterpret_cast<AP_EngineStatus *>(c_status), &name, &value, &opaqueState);
949 const AP_char8* getStatusValue(
const char *name)
const {
950 return c_status->functions->getStatusValue(reinterpret_cast<AP_EngineStatus *>(c_status), name);
953 AP_uint64 getStatusIntValue(
const char *name)
const {
954 return c_status->functions->getStatusIntValue(reinterpret_cast<AP_EngineStatus *>(c_status), name);
957 void disposeIterator(
void *opaqueState)
const {
958 c_status->functions->disposeIterator(reinterpret_cast<AP_EngineStatus *>(c_status), opaqueState);
961 void *copyIterator(
void *opaqueState)
const {
962 return c_status->functions->copyIterator(reinterpret_cast<AP_EngineStatus *>(c_status), opaqueState);
966 AP_int64 userIntOr(
const char* key, AP_int64 alt) {
967 return c_status->functions->getUserIntOr(reinterpret_cast<AP_EngineStatus *>(c_status), key, alt);
970 AP_float64 userFloatOr(
const char* key, AP_float64 alt) {
971 return c_status->functions->getUserFloatOr(reinterpret_cast<AP_EngineStatus *>(c_status), key, alt);
974 AP_bool userBoolOr(
const char* key, AP_bool alt) {
975 return c_status->functions->getUserBoolOr(reinterpret_cast<AP_EngineStatus *>(c_status), key, alt);
978 const AP_char8* userStringOr(
const char* key,
const AP_char8* alt) {
979 return c_status->functions->getUserStringOr(reinterpret_cast<AP_EngineStatus *>(c_status), key, alt);
982 AP_int64 userInt(
const char* key) {
983 return c_status->functions->getUserInt(reinterpret_cast<AP_EngineStatus *>(c_status), key);
986 AP_float64 userFloat(
const char* key) {
987 return c_status->functions->getUserFloat(reinterpret_cast<AP_EngineStatus *>(c_status), key);
990 AP_bool userBool(
const char* key) {
991 return c_status->functions->getUserBool(reinterpret_cast<AP_EngineStatus *>(c_status), key);
994 const AP_char8* userString(
const char* key) {
995 return c_status->functions->getUserString(reinterpret_cast<AP_EngineStatus *>(c_status), key);
998 AP_EngineStatus_API *c_status;
1006 std::ostringstream ost;
1008 <<
"Uptime(ms): " << obj.
getUptime() << std::endl
1035 stream << ost.str();
1058 if (m_opaqueState) step();
1062 inline void EngineStatus::StatusIterator::step()
1064 const char *name =
nullptr;
1065 const char *value =
nullptr;
1068 m_status->getNext(name, value, m_opaqueState );
1069 if(!name || !value) {
1070 assert(!m_opaqueState);
1072 iterPair = pair_t(name, value);
1092 virtual const char* getName()
const = 0;
1098 virtual const char* getPackage()
const = 0;
1103 virtual const char* getFullyQualifiedName()
const = 0;
1128 virtual unsigned int getNumSubMonitors()
const = 0;
1153 virtual unsigned int getNumListeners()
const = 0;
1178 virtual unsigned int getNumSubMonitors()
const = 0;
1183 virtual unsigned int getQueueSize()
const = 0;
1188 virtual char const *
const *getChannels()
const = 0;
1214 virtual unsigned int getQueueSize()
const = 0;
1219 virtual char const *
const *getChannels()
const = 0;
1224 virtual const AP_char8 *getAddress()
const = 0;
1250 virtual unsigned int getQueueSize()
const = 0;
1255 virtual char const *
const *getChannels()
const = 0;
1280 virtual unsigned int getNumEventTemplates()
const = 0;
1305 virtual unsigned int getNumTimers()
const = 0;
1360 virtual unsigned int getNumMonitors()
const = 0;
1365 virtual unsigned int getNumJavaApplications()
const = 0;
1370 virtual unsigned int getNumEventTypes()
const = 0;
1375 virtual unsigned int getNumTimers()
const = 0;
1380 virtual unsigned int getNumAggregates()
const = 0;
1430 virtual unsigned int getNumContexts()
const = 0;
1444 virtual unsigned int getNumReceivers()
const = 0;
1458 virtual unsigned int getNumPluginReceivers()
const = 0;
1516 virtual void injectMonitorScript(
MonitorScript& script) = 0;
1533 virtual const char*
const* injectMonitorScriptWithWarnings(
MonitorScript& script) = 0;
1551 virtual const char*
const* injectMonitorScriptWithWarningsFilename(
MonitorScript& script,
const char *filename) = 0;
1559 virtual void deleteName(
const char * name) = 0;
1567 virtual void forceDeleteName(
const char * name) = 0;
1575 virtual void killName(
const char * name) = 0;
1580 virtual void deleteAll() = 0;
1590 virtual void injectJava(
const AP_uint8* jarbytes, AP_uint32 size) = 0;
1608 virtual const char*
const* injectJavaWithWarnings(
const AP_uint8* jarbytes, AP_uint32 size) = 0;
1624 virtual const char*
const* injectJavaWithWarningsFilename(
const AP_uint8* jarbytes, AP_uint32 size,
const char *filename) = 0;
1636 virtual void injectCDP(
const AP_uint8* cdpbytes, AP_uint32 size,
const char *filename=NULL) = 0;
1654 virtual const char*
const* injectCDPWithWarnings(
const AP_uint8* cdpbytes, AP_uint32 size) = 0;
1670 virtual const char*
const* injectCDPWithWarningsFilename(
const AP_uint8* cdpbytes, AP_uint32 size,
const char *filename) = 0;
1678 char *errmsg =
nullptr;
1679 AP_EngineStatus *es_api = engineManagement_getStatusOpaque(
this, &errmsg);
1686 return EngineStatus(reinterpret_cast<AP_EngineStatus_API *>(es_api));
1754 virtual bool attachAsEventConsumerTo(
EngineManagement* target,
const char*
const* channels,
bool disconnectSlow =
false, ConnectMode mode = CONNECT_LEGACY) = 0;
1779 virtual bool attachAsEventConsumerTo(
const char* host,
int port,
const char*
const* channels,
bool disconnectSlow =
false, ConnectMode mode = CONNECT_LEGACY) = 0;
1798 virtual void detachAsEventConsumerFrom(
EngineManagement* target,
const char*
const* channels, ConnectMode mode = CONNECT_LEGACY) = 0;
1817 virtual void detachAsEventConsumerFrom(
const char* host,
int port,
const char*
const* channels, ConnectMode mode = CONNECT_LEGACY) = 0;
1843 virtual void flushEvents() = 0;
1871 virtual void ping() = 0;
1878 virtual bool isConnected() = 0;
1895 virtual void setReceiverConnections(
const std::vector<com::apama::engine::EngineConnection>& connections) = 0;
1901 virtual const std::vector<com::apama::engine::EngineConnection> getReceiverConnections() = 0;
1924 std::vector<std::string> channels;
1925 bool disconnectSlow;
1929 if (host == NULL || channels == NULL) {
1930 throw EngineException(
"EngineConnection cannot be created with null host or channels");
1932 if (port < 0 || port > 65535) {
1933 throw EngineException(
"EngineConnection cannot be created with invalid port value");
1936 this->host = std::string(host);
1938 this->disconnectSlow = disconnectSlow;
1939 this->connectMode = connectMode;
1941 for (
const char*
const* c = channels; *c != NULL; c++) {
1942 this->channels.push_back(std::string(*c));
1958 const char *
const * channels) {
1959 init(host, port, disconnectSlow, connectMode, channels);
1970 init(host, port,
false, EngineManagement::CONNECT_LEGACY, channels);
2003 return disconnectSlow;
2016 std::ostringstream ost;
2017 ost <<
"EngineConnection to " << obj.host <<
":" << obj.port << (obj.disconnectSlow ==
true ?
" diconnectSlow" :
"") <<
" on" <<
2018 (obj.connectMode == EngineManagement::CONNECT_PARALLEL ?
" parallel" :
"") <<
" channels [";
2020 if (!obj.channels.empty()) {
2021 std::copy(obj.channels.begin(), obj.channels.end() - 1, std::ostream_iterator<std::string>(ost,
", "));
2022 ost << obj.channels.back();
2025 stream << ost.str();
2046 AP_ENGINE_CLIENT_API
void engineInit(
const char* processName =
"C++ Client");
2055 AP_ENGINE_CLIENT_API
void engineInitMessaging(
const char *processName,
bool initMessaging=
true);
2079 AP_ENGINE_CLIENT_API EngineManagement*
connectToEngine(
const char* host,
unsigned short port,
bool disconnectSlowReceiver =
false,
const char *processName =
nullptr);
2094 AP_ENGINE_CLIENT_API EngineManagement*
connectToEngineReceiveOnly(
const char* host,
unsigned short port,
const char *processName =
nullptr);
2108 AP_ENGINE_CLIENT_API EngineManagement*
connectToEngineMonitorOnly(
const char* host,
unsigned short port,
const char *processName =
nullptr);
2145 AP_ENGINE_CLIENT_API
void deleteInfo(EngineInfo* info);
2155 AP_ENGINE_CLIENT_API
void deleteWarnings(
const char*
const* warnings);
2178 #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:610
AP_uint32 getNumListeners() const
The number of listeners in all contexts.
Definition: engine_client_cpp.hpp:574
AP_uint64 getUptime() const
The time in milliseconds since the correlator was started.
Definition: engine_client_cpp.hpp:539
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:78
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:322
AP_uint32 getNumJavaApplications() const
The number of Java applications and Java EPL plug-ins loaded in the correlator.
Definition: engine_client_cpp.hpp:567
Base class for a named object (i.e.
Definition: engine_client_cpp.hpp:1086
AP_uint32 getNumQueuedFastTrack() const
The sum of routed events on the route queues of all contexts.
Definition: engine_client_cpp.hpp:588
AP_uint32 getNumSubListeners() const
The number of sub-event-listeners that are active across all contexts.
Definition: engine_client_cpp.hpp:682
An EventConsumer can connect to the Engine through an EventSupplier and register to receive events.
Definition: engine_client_cpp.hpp:289
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:762
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:2010
const AP_char8 * getMostBackedUpInput() const
The name of the slowest context.
Definition: engine_client_cpp.hpp:654
AP_uint32 getNumConsumers() const
The number of external consumers/receivers connected to receive emitted events.
Definition: engine_client_cpp.hpp:617
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:632
~EngineStatus()
Destroy the underlying status data.
Definition: engine_client_cpp.hpp:916
EngineStatus getStatus()
Get the Engine's current operational status.
Definition: engine_client_cpp.hpp:1676
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:742
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:553
The Engine Management class acts as the interface to the Engine, and allows operations to be carried ...
Definition: engine_client_cpp.hpp:1500
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:459
Fatal messages.
Definition: engine_client_cpp.hpp:101
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:732
EngineConnection encapsulates the information related to a connection between two Apama messaging com...
Definition: engine_client_cpp.hpp:1920
Nothing logged.
Definition: engine_client_cpp.hpp:95
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:772
StatusIterator & operator=(const StatusIterator &other)
Copy assignment.
Definition: engine_client_cpp.hpp:506
AP_uint32 getNumQueuedInput() const
The number of executors on the input queues of all contexts.
Definition: engine_client_cpp.hpp:596
Information about a timer type returned by an engine inspection.
Definition: engine_client_cpp.hpp:1299
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:1172
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:475
std::string getStandardStatusValues()
Get the standard status values, formatted for terminal output.
Definition: engine_client_cpp.hpp:826
EngineConnection(const char *host, int port, bool disconnectSlow, EngineManagement::ConnectMode connectMode, const char *const *channels)
Definition: engine_client_cpp.hpp:1957
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:624
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:97
EngineStatus & operator=(const EngineStatus &other)
Copy assignment.
Definition: engine_client_cpp.hpp:927
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:534
virtual int getPort() const
Get the port associated with this connection.
Definition: engine_client_cpp.hpp:1994
An EventSupplier represents the resources created by the Engine to service a connection to an externa...
Definition: engine_client_cpp.hpp:249
static std::string getRawHeader()
Get a header for the raw output, useful for indentifying values.
Definition: engine_client_cpp.hpp:837
AP_uint32 getNumContexts() const
The number of contexts in the correlator, including the main context.
Definition: engine_client_cpp.hpp:546
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:1506
Information about a monitor returned by an engine inspection.
Definition: engine_client_cpp.hpp:1122
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:1208
std::string getRawHeaderAll()
Get a header for the raw output, useful for indentifying values.
Definition: engine_client_cpp.hpp:852
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:1504
EngineStatus()
Create a default-constructed (empty) EngineStatus.
Definition: engine_client_cpp.hpp:935
Information messages (default)
Definition: engine_client_cpp.hpp:107
Information about an aggregate function returned by an engine inspection.
Definition: engine_client_cpp.hpp:1325
Information about the monitors and types currently in an engine.
Definition: engine_client_cpp.hpp:1352
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:1978
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:1005
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:1986
Information about a java application returned by an engine inspection.
Definition: engine_client_cpp.hpp:1147
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:792
An Event object represents an event instance.
Definition: engine_client_cpp.hpp:177
AP_uint32 getNumProcesses() const
The number of monitor instances, also known as sub-monitors.
Definition: engine_client_cpp.hpp:560
const_iterator end() const
Returns an instance of the StatusIterator which allows to iterate over all status items.
Definition: engine_client_cpp.hpp:708
Critical messages.
Definition: engine_client_cpp.hpp:99
pair_t * operator->()
Return a pointer to the element pointed to.
Definition: engine_client_cpp.hpp:495
virtual ~EngineConnection()
Destroy the underlying connection data.
Definition: engine_client_cpp.hpp:2036
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:903
const_iterator begin() const
Returns an instance of the StatusIterator which allows to iterate over all status items.
Definition: engine_client_cpp.hpp:698
AP_ENGINE_CLIENT_API void reOpenLog()
Re-opens the log file.
LogLevel
Available logging levels.
Definition: engine_client_cpp.hpp:93
Information about a receiver returned by an engine inspection.
Definition: engine_client_cpp.hpp:1244
std::string getAllStatusValues()
Get all the status values available, formatted for terminal output.
Definition: engine_client_cpp.hpp:811
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:661
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:923
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:1969
EngineStatus represents the operational status of the Engine.
Definition: engine_client_cpp.hpp:440
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:675
bool operator==(const StatusIterator &ref) const
Returns true if two iterators point to the same item.
Definition: engine_client_cpp.hpp:484
AP_ENGINE_CLIENT_API int getLogFD()
Get the file descriptor of this logger.
Warning messages.
Definition: engine_client_cpp.hpp:105
AP_uint32 getNumInputQueuedInput() const
The number of events on the input queues of all public contexts.
Definition: engine_client_cpp.hpp:647
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:497
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:802
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:1042
Debugging messages.
Definition: engine_client_cpp.hpp:109
AP_float64 getUserFloat(const char *key)
Get a user value of type AP_float64.
Definition: engine_client_cpp.hpp:752
Information about a event type returned by an engine inspection.
Definition: engine_client_cpp.hpp:1274
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:867
AP_uint64 getNumProcessed() const
The number of events processed by the correlator in all contexts.
Definition: engine_client_cpp.hpp:689
StatusIterator()
Default-constructed status iterator.
Definition: engine_client_cpp.hpp:464
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:603
An EngineException (or instance of a derived class) is thrown by methods in this library if any probl...
Definition: engine_client_cpp.hpp:46
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:111
A MonitorScript object encapsulates an EPL code fragment, containing package, event and monitor defin...
Definition: engine_client_cpp.hpp:391
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:455
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:532
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:581
bool operator!=(const StatusIterator &ref) const
Returns false if two iterators point to the same item.
Definition: engine_client_cpp.hpp:491
~StatusIterator()
Destroy underling status iterator.
Definition: engine_client_cpp.hpp:470
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:2002
Error messages.
Definition: engine_client_cpp.hpp:103
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:500
AP_uint64 getNumOutEventsSent() const
The number of events that have been delivered to external consumers/receivers.
Definition: engine_client_cpp.hpp:640
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:668
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:782
static char const *const JAVA_APPLICATIONS_TOTAL
Number of java applications.
Definition: client_status_names.hpp:37