RTBKit  0.9
Open-source framework to create real-time ad bidding systems.
plugins/data_logger/data_logger.h
00001 /* data_logger.h                                 -*- C++ -*-
00002    Jeremy Barnes, March 2011
00003    Wolfgang Sourdeau, February 2013
00004    Copyright (c) 2012, 2013 Datacratic.  All rights reserved.
00005 
00006    DataLogger class
00007 */
00008 
00009 #pragma once
00010 
00011 #include <string>
00012 #include <boost/function.hpp>
00013 #include <boost/shared_ptr.hpp>
00014 
00015 #include "soa/service/service_base.h"
00016 #include "soa/service/zmq_named_pub_sub.h"
00017 #include "rtbkit/core/monitor/monitor_provider.h"
00018 
00019 #include "soa/logger/logger.h"
00020 
00021 namespace RTBKIT {
00022 
00023 struct DataLogger : public Datacratic::ServiceBase,
00024                     public MonitorProvider,
00025                     public Datacratic::Logger {
00026     DataLogger(std::shared_ptr<Datacratic::ServiceProxies> proxies);
00027     ~DataLogger();
00028 
00029     void init();
00030     void shutdown();
00031 
00032     void start(std::function<void ()> onStop = 0);
00033 
00034     void connectAllServiceProviders(const std::string & serviceClass,
00035                                     const std::string & epName);
00036 
00037     // Subscription object to the named services
00038     Datacratic::ZmqNamedMultipleSubscriber multipleSubscriber;
00039 
00040     MonitorProviderClient monitorProviderClient;
00041 
00042     /* MonitorProvider interface */
00043     std::string getProviderName() const;
00044     Json::Value getProviderIndicators() const;
00045 };
00046 
00047 } // namespace RTKBIT
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator