123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139 |
- /*
- * Copyright 2005 - 2016 Zarafa and its licensors
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License, version 3,
- * as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
- #ifndef EC_STATS_TABLES_H
- #define EC_STATS_TABLES_H
- #include <kopano/zcdefs.h>
- #include "ECGenericObjectTable.h"
- #include "ECSession.h"
- #include <string>
- #include <list>
- #include <map>
- namespace KC {
- struct statstrings {
- std::string name;
- std::string description;
- std::string value;
- };
- class ECSystemStatsTable _kc_final : public ECGenericObjectTable {
- protected:
- ECSystemStatsTable(ECSession *lpSession, unsigned int ulFlags, const ECLocale &locale);
- public:
- static ECRESULT Create(ECSession *, unsigned int flags, const ECLocale &, ECGenericObjectTable **);
- virtual ECRESULT Load();
- void load_tcmalloc(void);
- static ECRESULT QueryRowData(ECGenericObjectTable *lpThis, struct soap *soap, ECSession *lpSession, ECObjectTableList* lpRowList, struct propTagArray *lpsPropTagArray, void* lpObjectData, struct rowSet **lppRowSet, bool bCacheTableData, bool bTableLimit);
- private:
- static void GetStatsCollectorData(const std::string &name, const std::string &description, const std::string &value, void *obj);
- std::map<unsigned int, statstrings> m_mapStatData;
- unsigned int id;
- };
- struct sessiondata {
- ECSESSIONID sessionid;
- ECSESSIONGROUPID sessiongroupid;
- std::string srcaddress;
- unsigned int port;
- unsigned int idletime;
- unsigned int capability;
- bool locked;
- int peerpid;
- std::string username;
- std::list<BUSYSTATE> busystates;
- double dblUser, dblSystem, dblReal;
- std::string version;
- std::string clientapp;
- unsigned int requests;
- std::string url;
- std::string proxyhost;
- std::string client_application_version, client_application_misc;
- };
- class ECSessionStatsTable _kc_final : public ECGenericObjectTable {
- protected:
- ECSessionStatsTable(ECSession *lpSession, unsigned int ulFlags, const ECLocale &locale);
- public:
- static ECRESULT Create(ECSession *, unsigned int flags, const ECLocale &, ECGenericObjectTable **);
- virtual ECRESULT Load();
- static ECRESULT QueryRowData(ECGenericObjectTable *lpThis, struct soap *soap, ECSession *lpSession, ECObjectTableList* lpRowList, struct propTagArray *lpsPropTagArray, void* lpObjectData, struct rowSet **lppRowSet, bool bCacheTableData, bool bTableLimit);
- private:
- static void GetSessionData(ECSession *lpSession, void *obj);
- std::map<unsigned int, sessiondata> m_mapSessionData;
- unsigned int id;
- };
- class ECUserStatsTable _kc_final : public ECGenericObjectTable {
- protected:
- ECUserStatsTable(ECSession *lpSession, unsigned int ulFlags, const ECLocale &locale);
- public:
- static ECRESULT Create(ECSession *, unsigned int flags, const ECLocale &, ECGenericObjectTable **);
- virtual ECRESULT Load();
- static ECRESULT QueryRowData(ECGenericObjectTable *lpThis, struct soap *soap, ECSession *lpSession, ECObjectTableList* lpRowList, struct propTagArray *lpsPropTagArray, void* lpObjectData, struct rowSet **lppRowSet, bool bCacheTableData, bool bTableLimit);
- private:
- ECRESULT LoadCompanyUsers(ULONG ulCompanyId);
- };
- class ECCompanyStatsTable _kc_final : public ECGenericObjectTable {
- protected:
- ECCompanyStatsTable(ECSession *lpSession, unsigned int ulFlags, const ECLocale &locale);
- public:
- static ECRESULT Create(ECSession *, unsigned int flags, const ECLocale &, ECGenericObjectTable **);
- virtual ECRESULT Load();
- static ECRESULT QueryRowData(ECGenericObjectTable *lpThis, struct soap *soap, ECSession *lpSession, ECObjectTableList* lpRowList, struct propTagArray *lpsPropTagArray, void* lpObjectData, struct rowSet **lppRowSet, bool bCacheTableData, bool bTableLimit);
- private:
- };
- class ECServerStatsTable _kc_final : public ECGenericObjectTable {
- protected:
- ECServerStatsTable(ECSession *lpSession, unsigned int ulFlags, const ECLocale &locale);
- public:
- static ECRESULT Create(ECSession *, unsigned int flags, const ECLocale &, ECGenericObjectTable **);
- virtual ECRESULT Load();
- static ECRESULT QueryRowData(ECGenericObjectTable *lpThis, struct soap *soap, ECSession *lpSession, ECObjectTableList* lpRowList, struct propTagArray *lpsPropTagArray, void* lpObjectData, struct rowSet **lppRowSet, bool bCacheTableData, bool bTableLimit);
- private:
- std::map<unsigned int, std::string> m_mapServers;
- };
- // Link to provider/server
- extern _kc_export void (*kopano_get_server_stats)(unsigned int *qlen, double *qage, unsigned int *nthr, unsigned int *nidlethr);
- } /* namespace */
- #endif
|