Changeset 17461d6890a91ab2aeb309939b348456f8f53fbe

Show
Ignore:
Timestamp:
07/06/11 20:12:13 (3 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1309983133 -0400
git-parent:

[5b4b5d7646bfdb94d692dbceca8dc6b3256680ab]

git-author:
Theo Schlossnagle <jesus@omniti.com> 1309983133 -0400
Message:

require libprotobuf-c
make status and metric (S and M) lines not emit in the general
case as the B lines shall replace them. immediate metric logging
still requires the M rows.

As the reconnoiter.jar and postgres_ingestor don't know what the B
lines are and most S/M lines are replaced the product is broken here.

We need the java and C implementation to decode the B lines before
things will work again.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • configure.in

    r3081176 r17461d6  
    174174AC_CHECK_LIB(posix4, sem_wait, , ) 
    175175AC_CHECK_LIB(pthread, pthread_create, , ) 
     176AC_CHECK_LIB(protobuf-c, protobuf_c_message_get_packed_size, , 
     177             [AC_MSG_ERROR(libprotobuf-c required)]) 
     178 
    176179AC_CHECK_FUNC(uuid_generate, , [ 
    177180  AC_MSG_WARN([uuid_generate not available]) 
     
    204207) 
    205208 
    206  
    207209old_LIBS="$LIBS" 
    208 #LIBS="$LIBS `pkg-config --libs thrift_c_glib`" 
    209 LIBS="$LIBS `pkg-config --libs libprotobuf-c`" 
    210 AC_CHECK_LIB(protobuf-c, protobuf_c_message_get_packed_size, 
    211         [ 
    212                 AC_DEFINE([HAVE_PROTOBUFS]) 
    213         ] 
    214         [ 
    215     NOIT_OBJS_EXTRA="$NOIT_OBJS_EXTRA bundle.pb-c.o" 
    216                 CFLAGS="$CFLAGS `pkg-config --cflags libprotobuf-c`" 
    217         ], 
    218         [ 
    219                 AC_MSG_WARN([protobuf-c not found, skipping bundled metrics]) 
    220                 LIBS=$old_LIBS 
    221         ] 
    222 
    223 AC_SUBST(NOIT_OBJS_EXTRA) 
    224  
    225 old_LIBS=$LIBS 
    226 old_CFLAGS=$CFLAGS 
     210old_CFLAGS="$CFLAGS" 
    227211AC_CHECK_LIB(pq, PQconnectdb, 
    228212        [ 
     
    239223PQICFLAGS=`pg_config --includedir` 
    240224if test -n "$PQICFLAGS" ; then 
    241   CFLAGS="$CFLAGS -I$PQICFLAGS" 
     225  PGCFLAGS="$CFLAGS -I$PQICFLAGS" 
    242226fi 
    243227 
  • src/Makefile.in

    r3081176 r17461d6  
    7272        noit_capabilities_listener.o noit_xml.o \ 
    7373        noit_jlog_listener.o noit_livestream_listener.o noit_filters.o \ 
    74         noit_http.o noit_rest.o noit_check_rest.o noit_filters_rest.o @NOIT_OBJS_EXTRA@ 
     74        noit_http.o noit_rest.o noit_check_rest.o noit_filters_rest.o \ 
     75        bundle.pb-c.o 
    7576 
    7677NOIT_LIBS=libudns libnoitedit libeventer libjlog libnoit_utils libnoitjson 
     
    8687        stratcon_realtime_http.o \ 
    8788        stratcon_jlog_streamer.o stratcon_datastore.o \ 
    88         stratcon_iep.o 
     89        stratcon_iep.o \ 
     90        bundle.pb-c.o 
    8991 
    9092STRATCON_LIBS=libudns libnoitedit libeventer libjlog libnoit_utils libnoitjson 
  • src/noit_check.c

    r3081176 r17461d6  
    11281128  /* Write out the bundled information */ 
    11291129  noit_check_log_bundle(check); 
    1130   /* Write out our status */ 
    1131   noit_check_log_status(check); 
    1132   /* Write out all metrics */ 
    1133   noit_check_log_metrics(check); 
    11341130  /* count the check as complete */ 
    11351131  check_completion_count++; 
  • src/noit_check_log.c

    r3081176 r17461d6  
    4141#include "jlog/jlog.h" 
    4242 
    43 #ifdef HAVE_PROTOBUFS 
    4443#include "bundle.pb-c.h" 
    4544#include <zlib.h> 
    4645#include "utils/noit_b64.h" 
    47 #endif 
    4846 
    4947/* Log format is tab delimited: 
     
    7371static noit_log_stream_t delete_log = NULL; 
    7472static noit_log_stream_t bundle_log = NULL; 
    75  
    76 #ifdef HAVE_PROTOBUFS 
    7773static bool use_compression = true; 
    78 #endif 
    7974 
    8075#define SECPART(a) ((unsigned long)(a)->tv_sec) 
     
    291286 
    292287 
    293 #ifdef HAVE_PROTOBUFS 
    294288static int 
    295289_noit_check_log_bundle_metric(noit_log_stream_t ls, Metric *metric, metric_t *m) { 
     
    399393  bundle.duration = c->duration; 
    400394  bundle.status = c->status; 
    401    
     395 
    402396 
    403397  // Just count 
     
    438432  return rv; 
    439433} 
    440 #endif 
    441434 
    442435static int 
    443436_noit_check_log_bundle(noit_log_stream_t ls, noit_check_t *check) { 
    444 #ifdef HAVE_PROTOBUFS 
    445   _noit_check_log_bundle_serialize(bundle_log, check); 
    446 #else  
    447   noitL(noit_error, "Trying to use bundled metrics without libprotobuf-c, recompile with support for libprotobuf-c to use bundled metrics.\n"); 
    448   abort(); 
    449 #endif 
     437  return _noit_check_log_bundle_serialize(bundle_log, check); 
    450438} 
    451439 
  • src/noit_config.h.in

    r3081176 r17461d6  
    8787#define IFS_CH '/' 
    8888#undef WORKING_SEM_INIT 
    89 #undef HAVE_PROTOBUFS 
    9089 
    9190#undef HAVE_GETPWNAM_R