Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
SigNoz
Commits
1d07dd1e
Commit
1d07dd1e
authored
3 years ago
by
Ankit Nayan
Browse files
Options
Download
Email Patches
Plain Diff
chore: changed ttl get response to number of hours in int
parent
992644df
ttl-get-int
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
pkg/query-service/app/clickhouseReader/reader.go
+8
-3
pkg/query-service/app/clickhouseReader/reader.go
pkg/query-service/go.sum
+2
-0
pkg/query-service/go.sum
pkg/query-service/model/response.go
+2
-2
pkg/query-service/model/response.go
with
12 additions
and
5 deletions
+12
-5
pkg/query-service/app/clickhouseReader/reader.go
+
8
-
3
View file @
1d07dd1e
...
...
@@ -856,7 +856,7 @@ func (r *ClickHouseReader) SetTTL(ctx context.Context, ttlParams *model.TTLParam
func
(
r
*
ClickHouseReader
)
GetTTL
(
ctx
context
.
Context
,
ttlParams
*
model
.
GetTTLParams
)
(
*
model
.
GetTTLResponseItem
,
*
model
.
ApiError
)
{
parseTTL
:=
func
(
queryResp
string
)
str
in
g
{
parseTTL
:=
func
(
queryResp
string
)
in
t
{
values
:=
strings
.
Split
(
queryResp
,
" "
)
N
:=
len
(
values
)
ttlIdx
:=
-
1
...
...
@@ -868,12 +868,17 @@ func (r *ClickHouseReader) GetTTL(ctx context.Context, ttlParams *model.GetTTLPa
}
}
if
ttlIdx
==
-
1
{
return
""
return
ttlIdx
}
output
:=
strings
.
SplitN
(
values
[
ttlIdx
],
"("
,
2
)
timePart
:=
strings
.
Trim
(
output
[
1
],
")"
)
return
timePart
seconds_int
,
err
:=
strconv
.
Atoi
(
timePart
)
if
err
!=
nil
{
return
-
1
}
ttl_hrs
:=
seconds_int
/
3600
return
ttl_hrs
}
getMetricsTTL
:=
func
()
(
*
model
.
DBResponseTTL
,
*
model
.
ApiError
)
{
...
...
This diff is collapsed.
Click to expand it.
pkg/query-service/go.sum
+
2
-
0
View file @
1d07dd1e
...
...
@@ -53,6 +53,8 @@ github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
github.com/SigNoz/prometheus v1.9.4 h1:HqMPTM/QXgsjzuG5whSS+9l0mVePuya/uZmrAt2H9HQ=
github.com/SigNoz/prometheus v1.9.4/go.mod h1:39/E+7N2hh5Q6NunhoRz9EHCRAyRGj63YK1hE4SiHdk=
github.com/SigNoz/prometheus v1.9.5 h1:ITuK/71BFY3Hxv50/Upsvo6KJUdOxT7o6lCXmVxyLF0=
github.com/SigNoz/prometheus v1.9.5/go.mod h1:BHEawFYBYkVr9BjPXsz9Ye6QVVQ+2a99m6r/S8hO/lA=
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
...
...
This diff is collapsed.
Click to expand it.
pkg/query-service/model/response.go
+
2
-
2
View file @
1d07dd1e
...
...
@@ -205,6 +205,6 @@ type DBResponseTTL struct {
}
type
GetTTLResponseItem
struct
{
MetricsTime
str
in
g
`json:"metrics_ttl_duration"`
TracesTime
str
in
g
`json:"traces_ttl_duration"`
MetricsTime
in
t
`json:"metrics_ttl_duration
_hrs
"`
TracesTime
in
t
`json:"traces_ttl_duration
_hrs
"`
}
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
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
Menu
Projects
Groups
Snippets
Help