aboutsummaryrefslogtreecommitdiff
path: root/src/p2p/data_logger.cpp
diff options
context:
space:
mode:
authorrfree2monero <rfreemonero@op.pl>2015-04-01 19:00:45 +0200
committerrfree2monero <rfreemonero@op.pl>2015-04-01 19:00:45 +0200
commitc511abf0058b8c1d020255faaad418b0ffd2eb26 (patch)
tree26c4cd88d16e79d5dc59fb3bfc43d399fb2239a3 /src/p2p/data_logger.cpp
parentMerge remote-tracking branch 'monero-official/master' into network-1.6-work1 (diff)
downloadmonero-c511abf0058b8c1d020255faaad418b0ffd2eb26.tar.xz
remerged; commands JSON. logging upgrade. doxygen
Diffstat (limited to 'src/p2p/data_logger.cpp')
-rw-r--r--src/p2p/data_logger.cpp19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/p2p/data_logger.cpp b/src/p2p/data_logger.cpp
index 69e50141a..bbb9fba3e 100644
--- a/src/p2p/data_logger.cpp
+++ b/src/p2p/data_logger.cpp
@@ -43,6 +43,7 @@ namespace net_utils
mFilesMap["sleep_up"] = data_logger::fileData("log/dr-monero/up_sleep_log.data");
mFilesMap["calc_time"] = data_logger::fileData("log/dr-monero/get_objects_calc_time.data");
mFilesMap["blockchain_processing_time"] = data_logger::fileData("log/dr-monero/blockchain_log.data");
+ mFilesMap["block_processing"] = data_logger::fileData("log/dr-monero/block_proc.data");
mFilesMap["peers_limit"] = data_logger::fileData("log/dr-monero/peers_limit.info");
mFilesMap["download_limit"] = data_logger::fileData("log/dr-monero/limit_down.info");
@@ -109,6 +110,15 @@ namespace net_utils
mFilesMap[filename].mDataToSave += data; // this holds a number that should be sum of all accumulated samples
}
}
+
+ bool data_logger::is_dying() {
+ if (m_state == data_logger_state::state_dying) {
+ return true;
+ }
+ else {
+ return false;
+ }
+ }
void data_logger::saveToFile() {
_dbg2_c("dbg/data","saving to files");
@@ -125,10 +135,13 @@ namespace net_utils
// the inner class:
double data_logger::fileData::get_current_time() {
- using namespace boost::chrono;
- auto point = steady_clock::now();
+ #if defined(__APPLE__)
+ auto point = std::chrono::system_clock::now();
+ #else
+ auto point = std::chrono::steady_clock::now();
+ #endif
auto time_from_epoh = point.time_since_epoch();
- auto ms = duration_cast< milliseconds >( time_from_epoh ).count();
+ auto ms = std::chrono::duration_cast< std::chrono::milliseconds >( time_from_epoh ).count();
double ms_f = ms;
return ms_f / 1000.;
}