]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/socketengine.h
More numerics.h conversion
[user/henk/code/inspircd.git] / include / socketengine.h
index 6f5d4131ba06e8c814b08bde67e70ea32a0209a7..f16ec3fea045272c8ef99e64c6b261f77f0ba867 100644 (file)
@@ -69,6 +69,7 @@ class CoreExport EventHandler : public Extensible
         */
        int fd;
  public:
+
        /** Get the current file descriptor
         * @return The file descriptor of this handler
         */
@@ -166,9 +167,22 @@ protected:
        int CurrentSetSize;
        /** Reference table, contains all current handlers
         */
-       EventHandler* ref[MAX_DESCRIPTORS];
+       EventHandler** ref;
+
+       int MAX_DESCRIPTORS;
+
+       size_t indata;
+       size_t outdata;
+       time_t lastempty;
+
+       void UpdateStats(size_t len_in, size_t len_out);
 public:
 
+       double TotalEvents;
+       double ReadEvents;
+       double WriteEvents;
+       double ErrorEvents;
+
        /** Constructor.
         * The constructor transparently initializes
         * the socket engine which the ircd is using.
@@ -388,6 +402,10 @@ public:
         * the shell or operating system on fatal error.
         */
        virtual void RecoverFromFork();
+
+       /** Get data transfer statistics, kilobits per second in and out and total.
+        */
+       void GetStats(float &kbitpersec_in, float &kbitpersec_out, float &kbitpersec_total);
 };
 
 #endif