Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Anders Wäänänen
arc
Commits
f4177f18
Commit
f4177f18
authored
Jun 09, 2017
by
Aleksandr Konstantinov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding dedicated time format for Elasticsearch.
parent
fa7a3f29
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
1 deletion
+28
-1
src/hed/daemon/unix/main_unix.cpp
src/hed/daemon/unix/main_unix.cpp
+2
-0
src/hed/libs/common/DateTime.cpp
src/hed/libs/common/DateTime.cpp
+20
-0
src/hed/libs/common/DateTime.h
src/hed/libs/common/DateTime.h
+2
-1
src/services/gridftpd/listener.cpp
src/services/gridftpd/listener.cpp
+4
-0
No files found.
src/hed/daemon/unix/main_unix.cpp
View file @
f4177f18
...
...
@@ -315,6 +315,8 @@ int main(int argc, char **argv)
Arc
::
Time
::
SetFormat
(
Arc
::
UserTime
);
}
else
if
(
strcmp
(
log_time_format
,
"USEREXT"
)
==
0
)
{
Arc
::
Time
::
SetFormat
(
Arc
::
UserExtTime
);
}
else
if
(
strcmp
(
log_time_format
,
"ELASTIC"
)
==
0
)
{
Arc
::
Time
::
SetFormat
(
Arc
::
ElasticTime
);
}
else
if
(
strcmp
(
log_time_format
,
"MDS"
)
==
0
)
{
Arc
::
Time
::
SetFormat
(
Arc
::
MDSTime
);
}
else
if
(
strcmp
(
log_time_format
,
"ASC"
)
==
0
)
{
...
...
src/hed/libs/common/DateTime.cpp
View file @
f4177f18
...
...
@@ -401,6 +401,26 @@ namespace Arc {
return
ss
.
str
();
}
case
ElasticTime
:
{
tm
tmtime
;
localtime_r
(
&
gtime
,
&
tmtime
);
std
::
stringstream
ss
;
ss
<<
std
::
setfill
(
'0'
);
ss
<<
std
::
setw
(
4
)
<<
tmtime
.
tm_year
+
1900
<<
'-'
<<
std
::
setw
(
2
)
<<
tmtime
.
tm_mon
+
1
<<
'-'
<<
std
::
setw
(
2
)
<<
tmtime
.
tm_mday
<<
' '
<<
std
::
setw
(
2
)
<<
tmtime
.
tm_hour
<<
':'
<<
std
::
setw
(
2
)
<<
tmtime
.
tm_min
<<
':'
<<
std
::
setw
(
2
)
<<
tmtime
.
tm_sec
<<
'.'
<<
std
::
setw
(
3
)
<<
gnano
/
1000000
;
return
ss
.
str
();
}
case
MDSTime
:
{
tm
tmtime
;
...
...
src/hed/libs/common/DateTime.h
View file @
f4177f18
...
...
@@ -24,7 +24,8 @@ namespace Arc {
UTCTime
,
///< YYYY-MM-DDTHH:MM:SSZ
RFC1123Time
,
///< Day, DD Mon YYYY HH:MM:SS GMT
EpochTime
,
///< 1234567890
UserExtTime
///< YYYY-MM-DD HH:MM:SS.mmmmmm
UserExtTime
,
///< YYYY-MM-DD HH:MM:SS.mmmmmm (microseconds resolution)
ElasticTime
,
///< YYYY-MM-DD HH:MM:SS.mmm (milliseconds resolution, suitable for Elasticsearch)
};
/// Base to use when constructing a new Period.
...
...
src/services/gridftpd/listener.cpp
View file @
f4177f18
...
...
@@ -128,6 +128,8 @@ int main(int argc,char** argv) {
Arc
::
Time
::
SetFormat
(
Arc
::
UserTime
);
}
else
if
(
strcmp
(
log_time_format
,
"USEREXT"
)
==
0
)
{
Arc
::
Time
::
SetFormat
(
Arc
::
UserExtTime
);
}
else
if
(
strcmp
(
log_time_format
,
"ELASTIC"
)
==
0
)
{
Arc
::
Time
::
SetFormat
(
Arc
::
ElasticTime
);
}
else
if
(
strcmp
(
log_time_format
,
"MDS"
)
==
0
)
{
Arc
::
Time
::
SetFormat
(
Arc
::
MDSTime
);
}
else
if
(
strcmp
(
log_time_format
,
"ASC"
)
==
0
)
{
...
...
@@ -208,6 +210,8 @@ int main(int argc,char** argv) {
Arc
::
Time
::
SetFormat
(
Arc
::
UserTime
);
}
else
if
(
strcmp
(
log_time_format
,
"USEREXT"
)
==
0
)
{
Arc
::
Time
::
SetFormat
(
Arc
::
UserExtTime
);
}
else
if
(
strcmp
(
log_time_format
,
"ELASTIC"
)
==
0
)
{
Arc
::
Time
::
SetFormat
(
Arc
::
ElasticTime
);
}
else
if
(
strcmp
(
log_time_format
,
"MDS"
)
==
0
)
{
Arc
::
Time
::
SetFormat
(
Arc
::
MDSTime
);
}
else
if
(
strcmp
(
log_time_format
,
"ASC"
)
==
0
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment