Skip to content
Snippets Groups Projects
Commit 7851fa1e authored by Sergey Yakubov's avatar Sergey Yakubov
Browse files

update nomad jobs, more debug out for windows

parent 75f788a2
No related branches found
No related tags found
No related merge requests found
#include "shared_event_list.h" #include "shared_event_list.h"
#include "eventmon_logger.h"
#include <algorithm> #include <algorithm>
...@@ -13,6 +14,7 @@ FilesToSend SharedEventList::GetAndClearEvents() { ...@@ -13,6 +14,7 @@ FilesToSend SharedEventList::GetAndClearEvents() {
uint64_t elapsed_ms = std::chrono::duration_cast<std::chrono::milliseconds>( high_resolution_clock::now() - uint64_t elapsed_ms = std::chrono::duration_cast<std::chrono::milliseconds>( high_resolution_clock::now() -
it->time).count(); it->time).count();
if (!it->apply_delay || elapsed_ms > kFileDelayMs) { if (!it->apply_delay || elapsed_ms > kFileDelayMs) {
GetDefaultEventMonLogger()->Debug("file considered closed or file moved: " + it->file_name);
events.push_back(it->file_name); events.push_back(it->file_name);
it = events_.erase(it); it = events_.erase(it);
} else { } else {
......
...@@ -27,6 +27,7 @@ Error SingleFolderWatch::Init() { ...@@ -27,6 +27,7 @@ Error SingleFolderWatch::Init() {
this->log__->Error("cannot add folder watch for " + full_path + ": " + err->Explain()); this->log__->Error("cannot add folder watch for " + full_path + ": " + err->Explain());
return err; return err;
} }
GetDefaultEventMonLogger()->Debug("added folder to monitor: " + full_path);
return nullptr; return nullptr;
} }
...@@ -53,9 +54,11 @@ Error SingleFolderWatch::ProcessEvent(const WinEvent& event) { ...@@ -53,9 +54,11 @@ Error SingleFolderWatch::ProcessEvent(const WinEvent& event) {
if (watch_io__->IsDirectory(root_folder_ + kPathSeparator + fname)) { if (watch_io__->IsDirectory(root_folder_ + kPathSeparator + fname)) {
return nullptr; return nullptr;
} }
GetDefaultEventMonLogger()->Debug("file modified event: " + fname);
event_list_->AddEvent(fname, event.ShouldBeProcessedAfterDelay()); event_list_->AddEvent(fname, event.ShouldBeProcessedAfterDelay());
return nullptr; return nullptr;
} }
void SingleFolderWatch::ProcessEvents(DWORD bytes_to_read) { void SingleFolderWatch::ProcessEvents(DWORD bytes_to_read) {
for (char* p = buffer_.get(); p < buffer_.get() + bytes_to_read; ) { for (char* p = buffer_.get(); p < buffer_.get() + bytes_to_read; ) {
WinEvent event{(FILE_NOTIFY_INFORMATION*) p}; WinEvent event{(FILE_NOTIFY_INFORMATION*) p};
......
...@@ -20,9 +20,10 @@ job "asapo-test" { ...@@ -20,9 +20,10 @@ job "asapo-test" {
command = "local/filegen_win.exe" command = "local/filegen_win.exe"
args = [ args = [
"1", "1",
"1M", "10M",
"10", "10000",
"c:/tmp/asapo/test_in/test_folder/file_win"] "120",
"u:/asapo/test_folder/file_win"]
} }
artifact { artifact {
...@@ -57,9 +58,10 @@ job "asapo-test" { ...@@ -57,9 +58,10 @@ job "asapo-test" {
command = "local/filegen_linux" command = "local/filegen_linux"
args = [ args = [
"1", "1",
"1M", "10M",
"10", "10000",
"/tmp/asapo/test_in/test_folder/file_lin_"] "120",
"/tmp/asapo/test_in/test_folder/file_lin"]
} }
artifact { artifact {
...@@ -100,13 +102,13 @@ job "asapo-test" { ...@@ -100,13 +102,13 @@ job "asapo-test" {
"30000"] "30000"]
} }
resources { # resources {
cpu = 5000 # cpu = 5000
memory = 128 # memory = 128
network { # network {
mbits = 10000 # mbits = 10000
} # }
} # }
artifact { artifact {
source = "http://nims.desy.de/extra/asapo/getnext_broker" source = "http://nims.desy.de/extra/asapo/getnext_broker"
...@@ -144,13 +146,13 @@ job "asapo-test" { ...@@ -144,13 +146,13 @@ job "asapo-test" {
"yzgAcLmijSLWIm8dBiGNCbc0i42u5HSm-zR6FRqo__Y=", "yzgAcLmijSLWIm8dBiGNCbc0i42u5HSm-zR6FRqo__Y=",
"30000"] "30000"]
} }
resources { # resources {
cpu = 5000 # cpu = 5000
memory = 128 # memory = 128
network { # network {
mbits = 10000 # mbits = 10000
} # }
} # }
artifact { artifact {
source = "http://nims.desy.de/extra/asapo/getnext_broker" source = "http://nims.desy.de/extra/asapo/getnext_broker"
......
...@@ -36,7 +36,7 @@ job "asapo-filemon-producer" { ...@@ -36,7 +36,7 @@ job "asapo-filemon-producer" {
"Mode":"tcp", "Mode":"tcp",
"NThreads":8, "NThreads":8,
"LogLevel":"debug", "LogLevel":"debug",
"RootMonitoredFolder":"c:\\tmp\\asapo\\test_in", "RootMonitoredFolder":"u:\\asapo",
"MonitoredSubFolders":["test_folder"], "MonitoredSubFolders":["test_folder"],
"IgnoreExtentions":["tmp"], "IgnoreExtentions":["tmp"],
"RemoveAfterSend":true "RemoveAfterSend":true
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment