STATS: stat_client updates.
[vpp.git] / src / vpp / stats / stats.h
index 262304e..911706c 100644 (file)
@@ -29,6 +29,9 @@
 #include <svm/queue.h>
 #include <svm/ssvm.h>
 
+/* Default socket to exchange segment fd */
+#define STAT_SEGMENT_SOCKET_FILE "/run/vpp/stats.sock"
+
 typedef struct
 {
   volatile u32 lock;
@@ -162,12 +165,17 @@ typedef struct
   ssvm_private_t stat_segment;
   uword *counter_vector_by_name;
   clib_spinlock_t *stat_segment_lockp;
+  clib_socket_t *socket;
+  u8 *socket_name;
+  uword memory_size;
+  u8 serialize_nodes;
 
   /* Pointers to scalar stats maintained by the stat thread */
   f64 *input_rate_ptr;
   f64 *last_runtime_ptr;
   f64 *last_runtime_stats_clear_ptr;
   f64 *vector_rate_ptr;
+  f64 *heartbeat_ptr;
   u64 last_input_packets;
 
   /* Pointers to vector stats maintained by the stat thread */
@@ -190,6 +198,9 @@ typedef struct
 
 extern stats_main_t stats_main;
 
+/* Default stat segment 32m */
+#define STAT_SEGMENT_DEFAULT_SIZE      (32<<20)
+
 #define STAT_SEGMENT_OPAQUE_LOCK       0
 #define STAT_SEGMENT_OPAQUE_DIR                1
 #define STAT_SEGMENT_OPAQUE_EPOCH      2
@@ -199,7 +210,8 @@ typedef enum
   STAT_DIR_TYPE_ILLEGAL = 0,
   STAT_DIR_TYPE_SCALAR_POINTER,
   STAT_DIR_TYPE_VECTOR_POINTER,
-  STAT_DIR_TYPE_COUNTER_VECTOR,
+  STAT_DIR_TYPE_COUNTER_VECTOR_SIMPLE,
+  STAT_DIR_TYPE_COUNTER_VECTOR_COMBINED,
   STAT_DIR_TYPE_ERROR_INDEX,
   STAT_DIR_TYPE_SERIALIZED_NODES,
 } stat_directory_type_t;