test_icl_core_logging_performance.cpp
Go to the documentation of this file.
1 // this is for emacs file handling -*- mode: c++; indent-tabs-mode: nil -*-
2 
3 // -- BEGIN LICENSE BLOCK ----------------------------------------------
4 // This file is part of FZIs ic_workspace.
5 //
6 // This program is free software licensed under the LGPL
7 // (GNU LESSER GENERAL PUBLIC LICENSE Version 3).
8 // You can find a copy of this license in LICENSE folder in the top
9 // directory of the source code.
10 //
11 // © Copyright 2016 FZI Forschungszentrum Informatik, Karlsruhe, Germany
12 //
13 // -- END LICENSE BLOCK ------------------------------------------------
14 
15 //----------------------------------------------------------------------
22 //----------------------------------------------------------------------
23 #include <icl_core/BaseTypes.h>
25 #include <icl_core/os_lxrt.h>
26 #include <icl_core_config/Config.h>
28 #include <icl_core_thread/Thread.h>
29 
30 DECLARE_LOG_STREAM(PerformanceTest);
31 REGISTER_LOG_STREAM(PerformanceTest)
32 
33 using icl_core::logging::Default;
34 using icl_core::logging::endl;
35 
36 int main(int argc, char *argv[])
37 {
39 
40  icl_core::config::addParameter(icl_core::config::ConfigParameter("message-count:", "c", "/TestLogging/MessageCount", "Number of messages to be logged."));
41 
43 
44  size_t message_count = icl_core::config::getDefault<size_t>("/TestLogging/MessageCount", 100000);
45 
46  LOGGING_INFO(Default, "Running performance test with " << message_count << " iterations..." << endl);
47  for (size_t i = 0; i < message_count; ++i)
48  {
49  LOGGING_INFO(PerformanceTest, "Test loop " << i << endl);
50  }
51  LOGGING_INFO(Default, "Performance test finished." << endl);
52 
53  icl_core::logging::tLoggingManager::instance().shutdown();
55 
56  return 0;
57 }
void lxrtShutdown()
Definition: os_lxrt.cpp:74
bool initialize(int &argc, char *argv[], bool remove_read_arguments)
void lxrtStartup()
Definition: os_lxrt.cpp:61
#define LOGGING_INFO(streamname, arg)
Base header file for the configuration framework.
DECLARE_LOG_STREAM(PerformanceTest)
Defines logging macros.
Contains a system independet PRINTF macro.
ThreadStream & endl(ThreadStream &stream)
Definition: ThreadStream.h:249
void addParameter(const ConfigParameter &parameter)
Definition: Config.h:541
Contains global LXRT functions.
REGISTER_LOG_STREAM(Performance)
int main(int argc, char *argv[])
Contains Interface base classes and base types.
Contains icl_core::thread::Thread.


fzi_icl_core
Author(s):
autogenerated on Mon Jun 10 2019 13:17:58