Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
9.2.2023: Due to updates GitLab will be unavailable for some minutes between 9:00 and 11:00.
Open sidebar
dcdb
dcdb
Commits
3c4f43c0
Commit
3c4f43c0
authored
Dec 17, 2020
by
Michael Ott
Browse files
Report time in local time by default, add -u switch for UTC time
parent
7118a5c5
Changes
2
Hide whitespace changes
Inline
Side-by-side
tools/dcdbquery/dcdbquery.cpp
View file @
3c4f43c0
...
...
@@ -45,8 +45,8 @@ void usage(void)
if
(
isatty
(
fileno
(
stdin
)))
{
/* 0---------1---------2---------3---------4---------5---------6---------7--------- */
std
::
cout
<<
"Usage:"
<<
std
::
endl
;
std
::
cout
<<
" dcdbquery [-h <host>] [-r] [-l] <Sensor 1> [<Sensor 2> ...] [<Start> <End>]"
<<
std
::
endl
;
std
::
cout
<<
" dcdbquery [-h <host>] [-r] [-l] -j <jobId> <Sensor 1> [<Sensor 2> ...]"
<<
std
::
endl
;
std
::
cout
<<
" dcdbquery [-h <host>] [-r] [-l]
[-u]
<Sensor 1> [<Sensor 2> ...] [<Start> <End>]"
<<
std
::
endl
;
std
::
cout
<<
" dcdbquery [-h <host>] [-r] [-l]
[-u]
-j <jobId> <Sensor 1> [<Sensor 2> ...]"
<<
std
::
endl
;
std
::
cout
<<
std
::
endl
;
std
::
cout
<<
"Parameters:"
<<
std
::
endl
;
std
::
cout
<<
" <jobId> a job to query sensors for"
<<
std
::
endl
;
...
...
@@ -57,7 +57,8 @@ void usage(void)
std
::
cout
<<
"Options:"
<<
std
::
endl
;
std
::
cout
<<
" -h<host> Cassandra host [default: "
<<
DEFAULT_CASSANDRAHOST
<<
":"
<<
DEFAULT_CASSANDRAPORT
<<
"]"
<<
endl
;
std
::
cout
<<
" -r Report timestamps in numerical format"
<<
std
::
endl
;
std
::
cout
<<
" -l Report times in local time (not UTC)"
<<
std
::
endl
;
std
::
cout
<<
" -l Report times in local time (not UTC) [default]"
<<
std
::
endl
;
std
::
cout
<<
" -u Report times in UTC time"
<<
std
::
endl
;
}
else
{
std
::
cout
<<
"Invalid request."
<<
std
::
endl
;
...
...
@@ -119,7 +120,7 @@ int main(int argc, char * const argv[])
}
std
::
string
jobId
;
while
((
ret
=
getopt
(
argcReal
,
argvReal
,
"+h:rlj:"
))
!=-
1
)
{
while
((
ret
=
getopt
(
argcReal
,
argvReal
,
"+h:rl
u
j:"
))
!=-
1
)
{
switch
(
ret
)
{
case
'h'
:
host
=
optarg
;
...
...
@@ -130,6 +131,9 @@ int main(int argc, char * const argv[])
case
'l'
:
myQuery
->
setLocalTimeEnabled
(
true
);
break
;
case
'u'
:
myQuery
->
setLocalTimeEnabled
(
false
);
break
;
case
'j'
:
jobId
=
optarg
;
break
;
...
...
tools/dcdbquery/query.cpp
View file @
3c4f43c0
...
...
@@ -409,6 +409,6 @@ void DCDBQuery::dojobQuery(std::list<std::string> sensors, std::string jobId) {
DCDBQuery
::
DCDBQuery
()
{
connection
=
nullptr
;
useLocalTime
=
fals
e
;
useLocalTime
=
tru
e
;
useRawOutput
=
false
;
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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