Stats: vpp_prometheus_export fixes.
[vpp.git] / src / vpp / app / vpp_get_stats.c
index c1a5acb..d500f8f 100644 (file)
@@ -19,7 +19,6 @@
 
 #include <vpp-api/client/stat_client.h>
 #include <vlib/vlib.h>
-#include <vpp/stats/stats.h>
 
 static int
 stat_poll_loop (u8 ** patterns)
@@ -193,6 +192,8 @@ reconnect:
          switch (res[i].type)
            {
            case STAT_DIR_TYPE_COUNTER_VECTOR_SIMPLE:
+             if (res[i].simple_counter_vec == 0)
+               continue;
              for (k = 0; k < vec_len (res[i].simple_counter_vec) - 1; k++)
                for (j = 0; j < vec_len (res[i].simple_counter_vec[k]); j++)
                  fformat (stdout, "[%d @ %d]: %llu packets %s\n",
@@ -201,6 +202,8 @@ reconnect:
              break;
 
            case STAT_DIR_TYPE_COUNTER_VECTOR_COMBINED:
+             if (res[i].simple_counter_vec == 0)
+               continue;
              for (k = 0; k < vec_len (res[i].combined_counter_vec); k++)
                for (j = 0; j < vec_len (res[i].combined_counter_vec[k]); j++)
                  fformat (stdout, "[%d @ %d]: %llu packets, %llu bytes %s\n",